[Xapian-discuss] Less than, greater than?

Eric B. Ridge ebr at tcdi.com
Wed Feb 9 15:29:41 GMT 2005


On Feb 9, 2005, at 9:51 AM, John Wards wrote:
> Doh..so it is.
>
> It was a bit of a long shot as I suppose.

Not really.  You can do it like some of us do wildcard searches.

For greater than, get a TermIterator from the Database, skip_to() the 
starting price and include all the prices after in your query, OR'd 
together as a group.  For less than, start at the beginning of the 
TermIterator and stop when you hit the end price.

I'm assuming you've got a term in each document like XP5.00 that would 
represent a field named Price with a value of five bucks.

I think a custom MatchDecider would work too.  Here you could use an 
indexed value of each document to make the decision, but I think this 
happens across the entire set of documents that match your initial 
query, not in-line with the query matching.

eric




More information about the Xapian-discuss mailing list