[Xapian-discuss] How "NOT expression" used in Xapian
Olly Betts
olly at survex.com
Thu Sep 1 14:11:45 BST 2011
On Tue, Aug 09, 2011 at 12:02:53AM +0800, Bruce Zhang wrote:
> I want to use "NOT expression", from xapian document, it is supported.
>
> >From omega, however I can't make it successfully, like
> omega P=<keyword> NOT B=XTAGf
When omega is called this way, each command line argument should be of
the form <cgiparam>=<value> so this really isn't going to work as "NOT"
like that will be interpreted as a parameter NOT with an empty value.
If you set up a queryparser boolean prefix for XTAG, then you can use
this:
omega P='<keyword> NOT tag:f'
To make this work, add this near the top of your query template:
$setmap{boolprefix,tag,XTAG}
There isn't an equivalent to 'B' but filtering to exclude documents
which match the term (this could be implemented, though I'm not sure
how it should interact with 'B' if both are present for terms with
the same prefix).
Cheers,
Olly
More information about the Xapian-discuss
mailing list