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

张少华 xiangqianzsh at
Mon Jan 22 16:55:31 GMT 2018

>A possible workaround (and perhaps a better approach) would be to
>set BoolWeight as the weighting scheme, then feed in your score as
>a weight using a PostingSource.  Then it's available via get_weight()
>on the MSetIterator object:
>You may find that's faster because it'll mean sorting by doubles instead
>of strings.

We realise our score function using PostingSource instead of using KeyMaker,  we reference your python example and source code of xapian, the simple demo  is here.
But we found that using PostingSource is more slower than KeyMaker.  I think the reason maybe:
We only use one Xapian::Query of PostingSource and the upper bound of our get_weight() can not work on a single PostingSource.  So some optimizing  don't work, but waste time  oppositely.
How do you think about this?

Also, We found the BM25 algorithm is fast in xapian, so we think if we can modify our get_weight() function to adjust the BM25 algorithm. If so, the type of termfreq of document should be double. I am wondering if it works just re-typedef Xapian::termcount to double? Does it has a negative impact on other place of xapian source.


More information about the Xapian-discuss mailing list