[Xapian-discuss] PHP5 - Query Parsing Bug

Olly Betts olly at survex.com
Sun Mar 27 03:16:55 BST 2016


On Sat, Mar 26, 2016 at 07:21:23PM -0500, Yannick Warnier wrote:
> I'm replying to a very old thread (9 years ago) here http://grokbase.com/t/xapian/xapian-discuss/072tprmr6h/php5-query-parsing-bug

It's a fairly safe bet that if you search for an error message and find
a 9 year old message which says it's been fixed, you aren't hitting the
same issue, but rather a different issue which gives the same error
message.

> The error appear when trying to instanciate a new XapianQuery object
> with a query element:
> 
>   new XapianQuery($subquery);

Their function doccomment says $extra is an array of arrays, so
$subquery is an array.  But the code fails to say what operator to use
to combine the elements in that array, so the error you're getting seems
correct to me.

Their should be something like:

    $subqueries[] = new XapianQuery(XapianQuery::OP_AND, $subquery);

Or maybe OP_OR - I'm not really sure what they are trying to do here.

Presumably the developers of this software haven't tested cases where
$extra is non-empty.

Cheers,
    Olly



More information about the Xapian-discuss mailing list