Thanks Erick,
this is what I ended up doing more or less but I'm not happy with it
really,
hparser.setDefaultOperator(QueryParser.Operator.AND);
Query hideQuery =hparser.parse("properties@"+hideterm+":"+hidevalue);
cquery.add(hideQuery, BooleanClause.Occur.MUST_NOT);
what I was really looking for was a way to code the fields I wanted
hidden without such a loose interface. I was expecting something like a
fieldQuery object but couldn't find anything appropriate.
Thank you for your help.
Erick Erickson wrote:
Would something like the following work for you?
BooleanQuery bq = new BooleanQuery();
bq.add(your built-up query);
bq.add(your not clause, MUSTNOT);
Now you can use your bq as your query to search.
NOTE: there is continual confusion what the - syntax really does, you might
want to search the mail archive for one of several explications if you are
thinking of the NOT operator like a boolean logic operator. It's not,
quite.
On 1/10/07, Jason <[EMAIL PROTECTED]> wrote:
how can I filter my search to not include items containing a particular
field and value?
I want effectively to add -myfieldname:myvalue to the end of my search
query, but I cant see how to do this via the api.
I have a complex query built up via the api and just want to filter it
based on field name/value pairs.
I'm sure it must be simple - I just cant see how to do it.
thanks.
Jason.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]