[Xapian-discuss] Trouble understanding MultiValueSorter with PHP bindings
Jason Chapin
jason at roasted.org
Wed Aug 5 17:50:38 BST 2009
Hi all,
Using the PHP5 bindings, I have been trying to sort results using
MultiValueSorter:
...
$enquire = new XapianEnquire($database);
$enquire->set_query($query);
$sorter = new XapianMultiValueSorter();
$sorter->add(2);
$enquire->set_sort_by_key($sorter, false);
$matches = $enquire->get_mset((int)$startAt, (int)$perPage);
...
the results always come sorted by ascending docId. My understanding of
$sorter->add(2) is to sort the results on the third field of the
document (field 0 being the docId and field 3 being the second field
defined in the scriptindex file used to build the database). Any advice
apreciated.
Regards,
Jason
--
////////////////////////////////////
Jason Chapin
jason at roasted.org
More information about the Xapian-discuss
mailing list