If I upgrade to using the edismax parser in my fq, I get the desired results. The default lucene parser on fq must not be able to parse the more complex nested clauses
q=*:*&fq={!type=edismax}((-(field:V1) AND -(field:V2)) AND -(field:V3)) - Works On 4/22/15, 3:27 PM, "Dhutia, Devansh" <ddhu...@gannett.com> 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)) > >However, for me, the following is a summary of what works & what doesn’t. >q=*:*&fq=(-(field:V1)) - Works > >q=*:*&fq=((-(field:V1) AND -(field:V2)) AND -(field:V3)) - Doesn’t >work >q=*:*&fq=(-(field:V1) AND -(field:V2) AND -(field:V3)) - Works >q=*:*&fq=((*:* -(field:V1) AND -(field:V2)) AND -(field:V3)) - Works > > > > >On 4/22/15, 3:02 PM, "Jack Krupansky" <jack.krupan...@gmail.com> wrote: > >>A purely negative sub-query is not supported by Lucene - you need to have >>at least one positive term, such as "*:*, at each level of sub-query. >>Try: >> >>((*:* -(field:V1) AND -(field:V2)) AND -(field:V3)) >> >>-- Jack Krupansky >> >>On Wed, Apr 22, 2015 at 10:56 AM, Dhutia, Devansh <ddhu...@gannett.com> >>wrote: >> >>> I have an automated filter query builder that uses the SolrNet nuget >>> package to build out boolean filters. I have a scenario where it is >>> generating a fq in the following format: >>> >>> ((-(field:V1) AND -(field:V2)) AND -(field:V3)) >>> The filter looks legal to me (albeit with extra parentheses), but the >>> above yields 0 total results, even though I know eligible data exists. >>> >>> If I manually re-write the above filter as >>> >>> (-(field:V1) AND -(field:V2) AND -(field:V3)) >>> I get the expected results. >>> >>> I realize the auto generated filter could be rewritten in a different >>>way, >>> but the question still remains, why is the first version not returning >>>any >>> results? >>> >>> Solr does not report any errors & returns successfully, just with 0 >>> results. >>> >>> Thanks >>>