[Xapian-discuss] Set Term Frequency for a Query

Pierre-Alain Moellic pamoellic at gmail.com
Mon Mar 7 11:43:33 GMT 2011


Hello,

I have a problem when trying to define a query and setting for each term its
"term frequency" with the classical constructor
Xapian::Query<http://xapian.org/docs/apidoc/html/classXapian_1_1Query.html#f396e213df0d8bcffa473a75ebf228d6>(const
std::string &tname_,
Xapian::termcount<http://xapian.org/docs/apidoc/html/namespaceXapian.html#72b5a76dd8cfb7b251fe7986e86390cb>wqf_=1,
Xapian::termpos<http://xapian.org/docs/apidoc/html/namespaceXapian.html#e5a16f073d0c8ed54085a9de07248d45>pos_=0)
:

    Xapian::Query query_test(Xapian::Query::OP_OR, Xapian::Query("Bonjour",
10), Xapian::Query("Hello", 5));
    Xapian::TermIterator qt = query_test.get_terms_begin();
    while (qt != query_test.get_terms_end())
    {
      cout<<*qt<<" "<<qt.get_wdf()<<" ";
      qt++;
    }

returns : Bonjour 1 Hello 1

I don't understand why get_wdf returns "1" and not Bonjour 10 Hello 5 ?

Regards,

pa.


More information about the Xapian-discuss mailing list