You simple need another value with sticky true-false i think:
Xapian::MultiValueKeyMaker
sorter;sorter.add_value(3);sorter.add_value(1,
true);enquire.set_sort_by_key(&sorter, true);Xapian::MSet mset
enquire.get_mset(0, 10);
Mit freundlichem Gru?
Felix Ostmann
-----------------------------------------------------------
QE GmbH & Co. KG, Martinistra?e 3, D-49080 Osnabr?ck
-----------------------------------------------------------
Tel.: +49 (0) 541 / 40666 0, Fax: +49 (0) 541 / 40666 22
Email: info at qe.de, Web: www.qe.de
-----------------------------------------------------------
AG Osnabr?ck - HRA 200252, Ust-IdNr.: DE814737310
-----------------------------------------------------------
Komplement?rin: QE24 GmbH, AG Osnabr?ck - HRB 200359,
Gesch?ftsf?hrer: Ansas Meyer, Firmensitz: Osnabr?ck
-----------------------------------------------------------
Die in dieser Email enthaltenen Informationen sind vertrau-
lich zu behandeln und ausschlie?lich f?r den Adressaten be-
stimmt. Jegliche Ver?ffentlichung, Verteilung oder sonstige
in diesem Zusammenhang stehende Handlung wird ausdr?cklich
untersagt.
2013/2/20 Andrew Betts <andrew at trib.tv>
> 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
> _______________________________________________
> Xapian-discuss mailing list
> Xapian-discuss at lists.xapian.org
> http://lists.xapian.org/mailman/listinfo/xapian-discuss
>