On 9/9/2016 9:17 PM, Prasanna S. Dhakephalkar wrote: > Further search on net got me answer > > The query to be > > a_id:20 OR (*:* NOT a_id:*) > > I don't understand this syntax
The basic problem here is that negative queries don't work. If you're going to subtract X, you have to start with something (like all docs), or the result is nothing. For simple queries (just a single "-field:X" clause), Solr is able to detect the unworkable situation and implicitly add a "*:*" starting point, so the query works. When the query has ANY complexity, Solr's negative query detection isn't possible, and the query can't be fixed automatically, so it doesn't work. Thanks, Shawn