Pierre-Alain Moellic
2011-Mar-07 11:43 UTC
[Xapian-discuss] Set Term Frequency for a Query
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.
On Mon, Mar 07, 2011 at 12:43:33PM +0100, Pierre-Alain Moellic wrote:> 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 ?Well, 10 and 5 are wqfs not wdfs, but I think you're right that get_wdf() should return the wqf in this case. So it's a bug, I'd say. Cheers, Olly