As luck would have it, there's an explanation of the NOT operator in the thread below posted after your original one.......
*Getting a Better Understanding of Lucene's Search Operators * On 1/10/07, Erick Erickson <[EMAIL PROTECTED]> 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] > >