Opened 18 years ago

Closed 18 years ago

#84 closed defect (invalid)

Enquire_set_sort_by_value() and friends have no effect

Reported by: alec Owned by: Olly Betts
Priority: normal Milestone:
Component: Xapian-bindings Version: 0.9.6
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: Linux

Description

neither of the these functions seems to have an effect on the sorting of a result set (using xapian as a php module)

Enquire_set_sort_by_value() Enquire_set_sort_by_value() Enquire_set_sort_by_value_then_relevance() Enquire_set_sort_by_value_then_relevance()

they don't generate any errors, but no effect either.

Demonstration code will be attached.

Attachments (1)

enquire_sort_bug_demo.php (2.3 KB ) - added by alec 18 years ago.
demonstration code

Download all attachments as: .zip

Change History (4)

by alec, 18 years ago

Attachment: enquire_sort_bug_demo.php added

demonstration code

comment:1 by Olly Betts, 18 years ago

Status: newassigned

comment:2 by daniel andersson, 18 years ago

i'm experiencing this as well it's needed for my project, so please olly, can you sort it? :)

comment:3 by Olly Betts, 18 years ago

Operating System: Linux
Resolution: invalid
Status: assignedclosed

I've just taken a look. The example script is actually working correctly.

You should note that the sort uses a *STRING* compare as documented here:

http://www.xapian.org/docs/apidoc/html/classXapian_1_1Enquire.html#cc00543ba0459cc8ceca25e89fe69e19

So "100" < "20" < "3".

I suspect you were expecting a numeric sort - if you want to sort numbers you'll need to left pad them with zeros or spaces at present.

Note: See TracTickets for help on using tickets.