[Xapian-discuss] Re: bug in query parser or wrong usage?

Olly Betts olly at survex.com
Fri Mar 31 19:12:55 BST 2006


On Thu, Mar 30, 2006 at 09:58:31AM -0800, Michel Pelletier wrote:
> Olly Betts wrote:
> >I'd say this is a bug, but fixing it properly is a little involved 
> >as I think it requires changes to the Query class itself, so it'll
> >take a but of time.
> >
> >A sort-of workaround is to use non-boolean prefixes instead of
> >boolean ones.
> 
> I found success building the queries "by hand" composing them from 
> nested xapian.Query objects.
> 
> >>> Query(Query.OP_AND, Query(Query.OP_OR, Query("FOObar"), 
> Query("FIZfaz")), Query("DINGdong")).get_description()
> 'Xapian::Query(((FOObar OR FIZfaz) AND DINGdong))'
> >>>

But that's not a boolean query (well, not by itself, it would be if
you ran it with BoolWeight() as the weighting scheme).  This is exactly
what you'd with my workaround of using non-boolean prefixes with the
QueryParser (except that the QueryParser sets the term positions which
is irrelevant here).

Cheers,
    Olly



More information about the Xapian-discuss mailing list