[Xapian-discuss] Multiple filters with PHP? How to?

James Aylett james-xapian at tartarus.org
Tue Jan 8 21:07:39 GMT 2008


On Tue, Jan 08, 2008 at 12:23:59PM -0800, athlon athlonf wrote:

> However, I'm not getting any results from the filtering as you described.
> This is how the query is eventually parsed (when searching for "andy):
> Parsed query is: Xapian::Query((Zandi:(pos=1) FILTER (G68 AND XAUTHORID5)))
>
> When simply using filter the filters indivdually I'd get hundreds of
> results, but when combined in an AND-clause they don't work anymore.

Do you have documents that match both those boolean terms? Try just
searching for the terms directly without the rest of the query.

> BTW. I've tried your hints a bit, I think that when I need to add
> more filters, this might should be the correct way? It does give the
> same parsed query.
> 
> $qarray[] = new XapianQuery('G68');
> $qarray[] = new XapianQuery('XAUTHORID5');
> 
> $filter = new XapianQuery(XapianQuery_OP_AND, $qarray);
> $query = new XapianQuery(XapianQuery_OP_FILTER, $probquery, $filter);

That looks believable, yes - I just can't remember which options PHP
supports :-)

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org



More information about the Xapian-discuss mailing list