Jim Spath
2007-Nov-14 20:52 UTC
[Xapian-discuss] strange problem with number value range in 1.0.4
I upgraded to 1.0.4 and am experiencing some strange problems with the parsing of a number value range. The first line is the query string being passed to the query parser, and the second line is resulting query description. test 20071113153701..20071114153701 Xapian::Query((Ztest:(pos=1) FILTER VALUE_RANGE 0 ?J?w)@ ?J?G?@)) I am using the Search::Xapian perl module to do the searching, and omega scriptindex tool to build the index. Any ideas? - Jim
Olly Betts
2007-Nov-15 10:23 UTC
[Xapian-discuss] strange problem with number value range in 1.0.4
On Wed, Nov 14, 2007 at 03:51:52PM -0500, Jim Spath wrote:> The first line is the query string being passed to the query parser, and > the second line is resulting query description. > > test 20071113153701..20071114153701 > Xapian::Query((Ztest:(pos=1) FILTER VALUE_RANGE 0 ?J?w)@ ?J?G?@))NumberValueRangeProcessor expects the value to be encoded with Xapian::sortable_serialise(). Otherwise the string compare which is used means that 123 < 20 < 3! In 1.0.0, NumberValueRangeProcessor had a broken design where it just used a string compare like this, but we did quickly realise and warn people not to use it until it was fixed.> I am using the Search::Xapian perl module to do the searching, and omega > scriptindex tool to build the index.I don't think scriptindex supports encoding with sortable_serialise() currently. But if your timestamps are always fixed length strings then you could just use StringValueRangeProcessor. Cheers, Olly