3

Why do these solr queries yield different results?

  1. /select/?q=-id:abc OR -id:def
  2. /select/?q=-(id:abc) OR -(id:def)
  3. /select/?q=(-id:abc) OR (-id:def)

1 and 2 yield the answer I expect (all documents with abc and def removed)

however 3 yields no results. Why is 3 incorrect and what is going on behind the scenes?

1 Answers1

1

Boolean queries must have at least one "positive" expression (ie; MUST or SHOULD) in order to match.

I think, using () changes the scope / fields of the search. check this

Community
  • 1
  • 1
Vinod
  • 1,965
  • 1
  • 9
  • 18