How to get the serialise score returned in Xapian::KeyMaker->operator().

张少华 xiangqianzsh at
Mon Jan 15 12:55:26 GMT 2018

Thanks for you reply.
In our case, we want to get a weight using the user' properties(age, gender, price preference) and products' properties(price, comment count, purchased amount among different gender or range of age). So our weight function is complex, no matter we use KeyMaker or PostingSource, six to eight values in slot will be used.

But we find that using doc.get_value(slot) several times separately in each search makes getting result slowly. 

Now we want to constuct a forward index (using unordered map) which uses docid as key and its value contains the slot values we need, also the forward index will be constructed while we starting our application. Then we can get the values we used at the same time, and we need not to use sortable_unserialise().

Do you have some suggestions about this or is there some other way to make our search faster? 

By the way, our application scenario is here.



在 2017-12-19 06:40:52,"Olly Betts" <olly at> 写道:
>On Sat, Dec 16, 2017 at 10:11:40PM +0000, Olly Betts wrote:
>> Unfortunately the sort key isn't currently exposed via the public API.
>> It's available internally and it seems like it ought to be accessible
>> but there's no accessor method for it - I can add one but that won't
>> help for existing releases.
>I've added MSetIterator::get_sort_key() to master in
>9f807b83ab61a943a355a9ff6733299eab8e6bb1, and backported to the
>RELEASE/1.4 branch in 93ea6216fe8141d6223c869c6bccb039414db0fa, so this
>should be in 1.4.6 when that's released.
>    Olly

More information about the Xapian-discuss mailing list