[Xapian-discuss] strange problem with number value range in 1.0.4

Olly Betts olly at survex.com
Thu Nov 15 10:23:22 GMT 2007


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



More information about the Xapian-discuss mailing list