[Xapian-tickets] [Xapian] #653: OP_PHRASE seems to sometimes match terms in wrong order

Xapian nobody at xapian.org
Sat Aug 30 16:16:24 BST 2014


#653: OP_PHRASE seems to sometimes match terms in wrong order
---------------------+-----------------------------
 Reporter:  medoc    |             Owner:  olly
     Type:  defect   |            Status:  assigned
 Priority:  normal   |         Milestone:  1.3.3
Component:  Matcher  |           Version:  1.2.16
 Severity:  normal   |        Resolution:
 Keywords:           |        Blocked By:
 Blocking:           |  Operating System:  Linux
---------------------+-----------------------------
\
\
\
\
Changes (by olly):

 * status:  new => assigned
 * version:   => 1.2.16
 * component:  Backend-Chert => Matcher
 * milestone:   => 1.3.3

\
\
\

Comment:

 No need for the test database - I can trivially create one to reproduce
 the issue:

 {{{
 #!cpp
     Xapian::WritableDatabase wdb(get_writable_database());
     Xapian::Document doc;
     doc.add_posting("hurricane", 199881);
     doc.add_posting("hurricane", 203084);
     doc.add_posting("katrina", 199882);
     doc.add_posting("katrina", 202473);
     doc.add_posting("katrina", 203085);
     wdb.add_document(doc);
     wdb.commit();
     const char * qterms[] = { "katrina", "hurricane" };
     Xapian::Enquire e(wdb);
     Xapian::Query q(q.OP_PHRASE, qterms, qterms + 2, 5);
     e.set_query(q);
     Xapian::MSet mset = e.get_mset(0, 100);
     TEST_EQUAL(mset.size(), 0);
 }}}

 It's also present in trunk - I'll investigate.

 BTW, if you want a tool which can run queries for investigating these
 sorts of issues, take a look at "quest" (in xapian-core/examples/):

 {{{
 $ quest -d .brass/dbw 'katrina ADJ/4 hurricane'
 Parsed Query: Query((katrina at 1 PHRASE 5 hurricane at 2))
 MSet:
 1: [0.43676]
 }}}

 It doesn't support controlling every possible option, but you can
 certainly do more than just primitive querying with it, and it's gradually
 growing support for more things.
\
\
\

--
Ticket URL: <http://trac.xapian.org/ticket/653#comment:2>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list