Why there still been rank when using Query::MatchAll() ?
On Sat, Sep 27, 2008 at 10:17:41AM +0800, Allen wrote:> Why there still been rank when using Query::MatchAll() ?I thin I must have misunderstood your question - I just tested and I get 100% for all results if I modify examples/quest.cc to do this: enquire.set_query(Xapian::Query::MatchAll); Can you show us a simple (but complete) example program along with the output you'd expect to get from it? Cheers, Olly
The sources come from http://www.xapian.org/docs/quickstart.html, and in quickstartsearchall, like quickstartsearch, but query replaced by Query::MatchAll 2008/10/6 Olly Betts <olly at survex.com>> On Mon, Oct 06, 2008 at 06:35:08PM +0800, Allen wrote: > > $ ./quickstartsearchall proverbs/ > > 2 results found > > #1 100% [hello] > > #2 84% [world] > > And the source code to quickstartsearchall is? > > Cheers, > Olly >
int main(int argc, char *argv[]) { if (argc < 2) { cout << "usage: " << argv[0] << " <path to database>" << endl; return EXIT_FAILURE; } try { Database db(argv[1]); Enquire enquire(db); enquire.set_query(Query::MatchAll); MSet matches = enquire.get_mset(0, 10); cout << matches.size() << " results found" << endl; for (MSetIterator i = matches.begin(); i != matches.end(); i++) { Document doc = i.get_document(); cout << "#" << *i << "\t" << i.get_percent() << "% [" << doc.get_data() << "]" << endl; } } catch (const Error &e) { cout << "Xapian.Error: " << e.get_msg() << endl; } return EXIT_SUCCESS; } 2008/10/6 Olly Betts <olly at survex.com>> On Mon, Oct 06, 2008 at 06:35:08PM +0800, Allen wrote: > > $ ./quickstartsearchall proverbs/ > > 2 results found > > #1 100% [hello] > > #2 84% [world] > > And the source code to quickstartsearchall is? > > Cheers, > Olly >