[Xapian-discuss] Sorting by value - direction

Olly Betts olly at survex.com
Tue Mar 5 20:04:00 GMT 2013


On Tue, Mar 05, 2013 at 10:58:15AM +0000, Andrew Betts wrote:
> $enquire->set_sort_by_value(2);

Passing one argument to set_sort_by_value() is deprecated (and you'll
get a warning with the C++ headers if your compiler supports that, but
sadly that's not wired up to give a PHP warning).

The original meaning of the second parameter was backwards to what
people expected, so we changed it and deprecated the single argument
form:

http://trac.xapian.org/ticket/311

> But for some reason, the results are coming out Z-A, not A-Z.  I've
> tried setting true as the second argument to set_sort_by_value, even
> though we shouldn't need to reverse the direction because a standard
> sort should produce the right order already.  But even setting the
> second argument to true, I still get Z-A.

Set the second argument to *false* (since you don't want to reverse the
order), and it should do what you want.

Cheers,
    Olly



More information about the Xapian-discuss mailing list