[Xapian-discuss] Using relevance when sorting by generated key

redneb at gmx.com redneb at gmx.com
Fri Aug 27 08:00:30 BST 2010

Hi all,

I am trying to implement a scheme where documents in an MSet will be 
sorted based on relevance as well as geographical distance from a given 
(non-fixed) point.

I understand that this can be accomplished by using PostingSource in 
order to implement a custom weighting scheme that would combine BM25 
weighting and distance.  The problem is that I am using perl and 
PostingSource is not available for perl. Besides, I find this solution 
unnecessarily complicated.

A more simple solution would be if the sorter in 
Xapian::Enquire::set_sort_by_key provided an extra argument for 
Xapian::Sorter::operator, namely the weight of the current document with 
respect to the current query. Does this make sense? Is it possible to 
implement something like that in some future version of xapian?

More information about the Xapian-discuss mailing list