views:

65

answers:

2

In the query syntax of Lucene it is said the following:

The NOT operator excludes documents that contain the term after NOT.
...
The "-" or prohibit operator excludes documents that contain 
the term after the "-" symbol

I think the difference is that the - operator can be used alone, which is not the case for NOT. Is that it?

A: 

Long time back i read this somewhere... Something similar to your guess... :)

The NOT operator cannot be used with just one term. For example, the following search will return no results:

NOT "jakarta apache"

whereas the "-" or prohibit operator excludes documents that contain the term after the "-" symbol...

Hope this will be useful..

Favonius
+1  A: 

There is a very subtle difference. Take a look at this long thread on "Getting a Better Understanding of Lucene's Search Operators" which should hopefully answer your question.

dogbane