I'm using solr 6.6.0 ,and here are the documents in the collection.
{"id":1,"content":test1"}
{"id":2,"content":test2"}
{"id":3,"content":test3"}
Say I wanto to include the documents not containing "test1" and "test2",It seems legal to write the query string in the following way,according to the Grouping Terms to Form Sub-Queries section of refernce guide.
content:((NOT "test1") AND (NOT "test2"))
the result of the query is to expected return only document #3,but the actual result is empty.
Alternatively,if the above query is changed to the following,without parentheses surround the "NOT expressions",the expected result is returned.
content:(NOT "test1" AND NOT "test2")
My question is,why the first query string does not work in the expected way?
-content:("test1" OR "test2")
that is equivalent to*:* NOT content:("test1" OR "test2")
, equivalent to*:* AND content:(NOT "test1" AND NOT "test2")
– Accommodating