On 4/22/2015 9:27 AM, Dhutia, Devansh wrote: > I don’t know if that’s completely true, or maybe I’m misunderstanding > something. > > If it doesn’t support purely negative subqueries, this shouldn't work, but > does: > q=*:*&fq=(-(field:V1))
It's Lucene that has no support for purely negative queries, which is what Jack said. The reason is deceptively simple ... you can't subtract from nothing. If you give Lucene the all docs query as a starting reference point, then everything is fine. Solr has some detection logic that is able to detect those queries when they are very simple, and implicitly add the *:* for you before sending it to Lucene ... but if there's any complexity at all, that detection fails and the query will return zero docs. Thanks, Shawn