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

Olly Betts olly at survex.com
Thu Dec 20 16:36:02 GMT 2007


On Thu, Dec 20, 2007 at 03:56:43PM +0100, Adam Sj?gren wrote:
> On Thu, 15 Nov 2007 10:23:22 +0000, Olly wrote:
> 
> > NumberValueRangeProcessor expects the value to be encoded with
> > Xapian::sortable_serialise().  Otherwise the string compare which
> > is used means that 123 < 20 < 3!
> 
> Is Xapian::sortable_serialise() wrapped in Search::Xapian?

Not currently I'm afraid.

> It didn't seem so when I tried it just now (1.0.4.0-2 from Debian
> unstable)

Odd, Debian only seems to have -1 currently:

http://packages.qa.debian.org/libs/libsearch-xapian-perl.html

Perhaps you're using a privately updated package?  But these issues
affect vanilla 1.0.4.0 anyway.

> - which means that NumberValueRangeProcessor is not that
> usable if you index from Perl, right?

Indeed.

> I was trying to use StringValueRangeProcessor, but the constructor does
> not take a prefix (as opposed to NumberVRP), so I can only have one
> "rangeable" value, which is too little in my case.

StringVRP really ought to support a prefix/suffix like NumberVRP does.
There's already a wishlist bug for adding this feature to DateVRP, so
I've updated that to cover StringVRP too:

http://www.xapian.org/cgi-bin/bugzilla/show_bug.cgi?id=220

> Should I try figuring out how to wrap sortable_serialise, or should I
> try to provide a patch for StringVRP that adds the str and prefix
> arguments, similar to NumberVRP?

Patches for either or both would certainly be welcome.  I'm currently
busy trying to get a 1.0.5 release together.

Cheers,
    Olly



More information about the Xapian-discuss mailing list