You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2016/09/26 18:07:50 UTC

[Solr Wiki] Update of "NegativeQueryProblems" by ShawnHeisey

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "NegativeQueryProblems" page has been changed by ShawnHeisey:
https://wiki.apache.org/solr/NegativeQueryProblems?action=diff&rev1=2&rev2=3

Comment:
Initial page creation.

  
  '''field1:value1 AND -field2:value2'''
  
- This works because "field1:value1" is the starting point for the query, then documents where field2 contains value2 are subtracted from that starting point.  The "AND" operator links these two clauses together in a way that allows this to function.
+ The fact that this works but similar queries using "OR" don't work is NOT a bug.  It's just a byproduct of the way that boolean and MUST/SHOULD/MUST NOT query logic works.  The query with "AND" works because "field1:value1" is the starting point for the query, then documents where field2 contains value2 are subtracted from that starting point.