xapian-haystack icon indicating copy to clipboard operation
xapian-haystack copied to clipboard

DateTime index ordering occasionally simply incorrect.

Open melinath opened this issue 13 years ago • 1 comments

I'm involved in a project which uses haystack to handle cases like "display results which are in this category, sorted by date". We're using xapian-haystack. The ordering on the fields is... bizarre. Here's an example; the columns are: results[n].date, results[n+1].date, results[n].date >= results[n+1].date, and the ordering is '-date' (so the right column should always be True.)

2011-09-24 05:28:53 2011-09-23 23:21:16 True
2011-09-23 23:21:16 2011-09-23 17:44:44 True
2011-09-23 17:44:44 2011-09-22 18:39:28 True
2011-09-22 18:39:28 2011-09-22 13:30:00 True
2011-09-22 13:30:00 2011-09-22 12:58:14 True
... snip ...
2011-09-20 21:47:21 2011-09-20 21:02:50 True
2011-09-20 21:02:50 2011-01-14 08:55:48 True
2011-01-14 08:55:48 2011-06-09 06:42:43 False
2011-06-09 06:42:43 2010-09-21 18:44:49 True
2010-09-21 18:44:49 2010-09-17 22:31:14 True
... snip ...

In this particular query, only one item is out of order; I've also seen queries where most of the items are out of order. I am using haystack 1.2.X, xapian-haystack master.

melinath avatar Feb 07 '12 23:02 melinath

Incidentally, the ordering is always wrong in the same way, and this seems to be resolved by rebuilding the index. I'm waiting right now to see whether subsequent updates screw the order up again.

melinath avatar Feb 08 '12 18:02 melinath