[Xapian-tickets] [Xapian] #201: NEAR search with two OR subqueries should be supported (was: Attempting to create a NEAR search with two OR nodes gives assertion error)
Xapian
nobody at xapian.org
Wed Dec 17 10:51:52 GMT 2008
#201: NEAR search with two OR subqueries should be supported
-------------------------+--------------------------------------------------
Reporter: richard | Owner: olly
Type: enhancement | Status: assigned
Priority: normal | Milestone: 1.1.1
Component: Library API | Version: SVN trunk
Severity: normal | Resolution:
Keywords: | Blockedby:
Platform: All | Blocking:
-------------------------+--------------------------------------------------
Changes (by olly):
* type: defect => enhancement
* milestone: 1.1.0 => 1.1.1
Old description:
> I've observed this from python, but I expect it can occur from C++ too.
> The
> following python script gives an assertion error:
>
> {{{
> import xapian
> a=xapian.Query('A')
> b=xapian.Query('B')
> c=xapian.Query(xapian.Query.OP_OR, a, b)
> d=xapian.Query(xapian.Query.OP_NEAR, c, c)
> }}}
>
> The error is:
> {{{
> xapian.AssertionError:
> /home/richard/private/Working/xapian/xapian-
> core/api/omqueryinternal.cc:770: op == Xapian::Query::OP_NEAR || op ==
> Xapian::Query::OP_PHRASE
> }}}
> This is because an attempt is made to flatten the query "(A OR B) NEAR (A
> OR
> B)", which isn't supported (I believe). It would be nice to fix this by
> supporting such searches, but meanwhile we shouldn't raise
> !AssertionError from
> the API; a more explanatory exception should be returned instead.
New description:
In trunk this now throws !UnimplementedError, but it really should be
supported:
{{{
import xapian
a=xapian.Query('A')
b=xapian.Query('B')
c=xapian.Query(xapian.Query.OP_OR, a, b)
d=xapian.Query(xapian.Query.OP_NEAR, c, c)
}}}
--
Comment:
(In comment:7 I meant 1.1.0 not 1.0.0, though this will likely be
backported to 1.0.10 too).
The !AssertionError issue is fixed in trunk by r11706, so retitling,
milestoning, etc.
--
Ticket URL: <http://trac.xapian.org/ticket/201#comment:8>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list