search - using OR and NOT in solr query - Stack Overflow
Solr currently checks for a "pure negative" query and inserts *:* (which matches all documents) so that it works correctly.
-foo is transformed by solr into (*:* -foo)
The big caveat is that Solr only checks to see if the top level query is a pure negative query! So this means that a query like bar OR (-foo) is not changed since the pure negative query is in a sub-clause of the top level query. You need to transform this query yourself into bar OR (*:* -foo)
Read full article from search - using OR and NOT in solr query - Stack Overflow
No comments:
Post a Comment