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

张少华 xiangqianzsh at 163.com
Fri Dec 15 07:10:48 GMT 2017


HI, all,

I am a user of Xapian, and now I have a problem in using it. 

After using boolean terms to get some candidates of documents (still too much), we want sorted them by self-defined function which is used in Xapian::KeyMaker->operator(). But how can I get the serialise score in Xapian::MSetIterator object.

c++ code likes this:

class SortKeyMaker : public Xapian::KeyMaker {
std::string operator()(const Xapian::Document& doc) const {
    double score = self-defined-function(doc);
    return Xapian::sortable_serialise(score);   // How get this value in Xapian::MSetIterator
}






--
发自我的网易邮箱手机智能版


More information about the Xapian-discuss mailing list