not query in lucene

Viewed 30725

i need to do not queries on my lucene index. Lucene currently allows not only when we have two or more terms in the query:

So I can do something like:

country:canada not sweden

but I can't run a query like:

country:not sweden

Could you please let me know if there is some efficient solution for this problem

Thanks

5 Answers

Try with the following query in the search box:

NOT message:"warning"

message being the search field

Related