lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Krupansky <jack.krupan...@gmail.com>
Subject Re: Negating multiple array fileds
Date Sun, 14 Feb 2016 16:51:23 GMT
Due to a bug (or poorly designed feature), you need to explicitly include a
non-negative query term in a purely negative sub-query. Usually this means
using *:* to select all documents. Note that the use of parentheses
introduces a sub-query. So, (-persons:*) s.b. (*:* -persons:*).

-- Jack Krupansky

On Sun, Feb 14, 2016 at 8:21 AM, Salman Ansari <salman.rahmat@gmail.com>
wrote:

> Hi,
>
> I think what I am asking should be easy to do but for some reasons I am
> facing issues in making that happen. The issue is that I want
> include/exclude some fields from my Solr query. All the fields that I need
> to include are multi valued int fields. When I include the fields I have
> the following query
>
> http://
>
> [MySolrServer]/solr/[Collection]/select?q=(persons:*)AND(places:*)AND(orgs:*)
> This does return the desired result. However, when I negate the values
>
> http://
>
> [MySolrServer]/solr/[Collection]/select?q=(-persons:*)AND(-places:*)AND(-orgs:*)
> This returns 0 documents although there are a lot of documents that have
> all those fields empty.
>
> Any ideas why this is happening?
>
> Appreciate any comments/feedback.
>
> Regards,
> Salman
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message