Francis Irving
2006-Apr-05 18:55 UTC
[Xapian-discuss] Comparing against values (e.g. date ranges)
Hi all, I'm once again looking for search with date ranges. e.g. All entries before a certain date. I understand that Omega does this by adding keywords for each year, month and day number separately and construcing a big OR query year = 1980 or year = 1981 or year = 1982 .... or (year = 1983 and (month =1 or month = 2 ...)) I think Olly said he was considering adding something to Xapian, so the same fields used for sorting can be used for range comparison. Any progress on this? Francis (this is all for http://www.theyworkforyou.com which has a 4.2G Xapian database and growing!) -- Shhh! Abolish parliament quietly http://www.saveparliament.org.uk
Olly Betts
2006-Apr-05 19:49 UTC
[Xapian-discuss] Comparing against values (e.g. date ranges)
On Wed, Apr 05, 2006 at 04:44:21PM +0100, Francis Irving wrote:> I'm once again looking for search with date ranges. e.g. All entries > before a certain date. > > I understand that Omega does this by adding keywords for each year, > month and day number separately and construcing a big OR query > year = 1980 or year = 1981 or year = 1982 .... or (year = 1983 and > (month =1 or month = 2 ...))Actually it's more like: year = 1980 or year = 1981 or year = 1982 or (yearmonth = 198301 or yearmonth = 198302 ...)> I think Olly said he was considering adding something to Xapian, > so the same fields used for sorting can be used for range > comparison. > > Any progress on this?The feature already exists (the Xapian::MatchDecider class) - it's just that the way values are currently stored means it'll probably be significantly slower than Omega's approach (I've not actually benchmarked this though - I could be wrong). I plan to change how values are stored in flint, which I think is what you're referring to. But I haven't yet done this. Cheers, Olly