[Xapian-tickets] [Xapian] #476: OR decaying to AND_MAYBE sometimes skips a document
Xapian
nobody at xapian.org
Wed May 12 11:51:57 BST 2010
#476: OR decaying to AND_MAYBE sometimes skips a document
---------------------+------------------------------------------------------
Reporter: richard | Owner: olly
Type: defect | Status: new
Priority: normal | Milestone: 1.2.1
Component: Matcher | Version: SVN trunk
Severity: normal | Blockedby:
Platform: All | Blocking:
---------------------+------------------------------------------------------
When an OR postlist decays to an AND_MAYBE postlist in the next() method
of the OR postlist, the next document which should be returned by the
AND_MAYBE postlist sometimes isn't returned.
Consider the OR postlist with lhead=22, rhead=23 when it decays, such that
the left subtree of the OR becomes the right subtree of the AND_MAYBE.
The code implementing this in OrPostList::next() is:
{{{
ret = new AndMaybePostList(r, l, matcher, dbsize, rhead, lhead);
next_handling_prune(ret, w_min, matcher);
}}}
The OR was at document 22, so the next document returned should have been
23. However, the AndMaybePostList is created pointing at document 23, so
the call to next_handling_prune() moves past this document.
To fix this, I think we need to check whether rhead <= lhead before
advancing. If rhead > lhead, we shouldn't call the
"next_handling_prune()" method, but we do need to call check() on the LHS
postlist of the OR to move it to match the position of the RHS.
I've seen this error happening in my "soaktest" testscript, but have no
short testcase for it. I suspect this problem occurs in other places in
the matcher, too.
--
Ticket URL: <http://trac.xapian.org/ticket/476>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list