Bug#658227: better search results

Thomas Lange <[email protected]>
Newsgroups gmane.linux.debian.devel.www
Message-ID <25331.23406.105993.361928__14576.7315685347$1660116819$gmane$org@cs.uni-koeln.de>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.