[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#658227: better search results



Hi Olly,

in #1015198 I also reported useless search results
similar to #658227 (still open since 2012).

I found this in the xapian docs. Do you think this would be the best
solution to get the results sorted by date? I'm not sure if it would
be easy to index all our html documents by date, since the time stamps
on the files do not reflect the date of the last modification of the
content. Do you know of any other solutions?



Sorting by Other Properties

If you want to offer a "sort by date" feature, and can arrange for
documents to be indexed in date order (or a close-enough
approximation), then you can implement a very efficient "sort by date"
feature by using a boolean search (i.e. call
enquire.set_weighting_scheme(Xapian::BoolWeight());) with
enquire.set_docid_order(Xapian::Enquire::DESCENDING); (for newest
first) or enquire.set_docid_order(Xapian::Enquire::ASCENDING); (for
oldest first). There's no inherent reason why this technique can't be
used  for sorting by something other than date, but it's usually much
easier to arrange for new documents to arrive in date order than in
other orders.

-- 
best regards Thomas


Reply to: