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)
Change History (4)
by , 18 years ago
Attachment: | enquire_sort_bug_demo.php added |
---|
comment:1 by , 18 years ago
Status: | new → assigned |
---|
comment:2 by , 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 , 18 years ago
Operating System: | → Linux |
---|---|
Resolution: | → invalid |
Status: | assigned → closed |
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.
demonstration code