[Xapian-discuss] query syntax?

Richard Boulton richard at lemurconsulting.com
Thu Nov 6 13:01:32 GMT 2008


Torsten Foertsch wrote:
> I am a bit confused about query syntax if wildcard queries are allowed. 
> The code looks like:
> 
>   my $query=$qp->parse_query( $qstring, FLAG_WILDCARD );
>   printf "Parsed query '%s'\n", $query->get_description();

> That means the wildcard flag turns "AND" from an operator into a search 
> word. Is that on purpose?

What's happening is that the default flag argument for parse_query() is
"FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE". If you specify a set of flags 
manually, this default is overridden with the flags you specify.

> Can search operators be used together with wildcard searches?

Yes.  Just replace FLAG_WILDCARD in your line with:
FLAG_WILDCARD|FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE

-- 
Richard



More information about the Xapian-discuss mailing list