[Xapian-discuss] Sticky results

Andrew Betts andrew at trib.tv
Wed Feb 20 10:10:32 GMT 2013


Hi there,

I have a xapian index whose results are being sorted by a value, with (PHP bindings):

$enquire->set_sort_by_value($sort_data_value);

This is because I want the results returned in chronological order of publication date.  However, I now have a need to have certain results be 'sticky' at the top of the resultset, regardless of their publication date.  Obviously there are hacks such as setting a publication date in the distant future, but I'm wondering if there is a best practice way to do this within the Xapian world.

I considered that perhaps the answer was to remove the sort by value and replace it with a custom posting source that combined that value with the post's stickiness to give the post a weight.  Would that be the right approach?  If I do that how do I turn off all the default relevance weight logic?

Cheers,

Andrew


More information about the Xapian-discuss mailing list