[Xapian-discuss] ValueRanges & FLAG_PARTIAL

Olly Betts olly at survex.com
Fri Dec 2 02:09:49 GMT 2011


On Tue, Nov 22, 2011 at 02:34:45PM +0100, Alain Denzler wrote:
> Just another newbie question.. I've been playing around with  
> ValueRangeProcessor and it works, but I think I don't get all the  
> Results. I enabled FLAG_PARTIAL, and it works without  
> ValueRangeProcessor. Also query->get_description() looks like partial  
> matching isn't possible with value ranges. Is there a way to get partial  
> matching with value ranges? Am I missing something?

Partial matching only works on terms, at least currently.

I'm not sure how sanely it would work with ranges.  I think the
ValueRangeProcessor subclass would need to have a way to say what to
do, since the correct answer depends on the range type.

For a numeric range, there would just be no upper bound, since $10..100
could have any number on zeros typed after it.  Handling of suffixes is
tricky though - 5..10k could potentially be a filter on km or kg.

For string ranges, you'd bound at the end string with the last character
increment by one (and ideally with the bound non-inclusive, though that
isn't supported currently).

Date ranges would probably want to be unbounded above, at least unless
the year is already partly specified.

And for custom range types, you'd have to define what to do, or get
no partial matching, or perhaps some default handling.

Cheers,
    Olly



More information about the Xapian-discuss mailing list