Re: Negating multiple array fileds

2016-02-17 Thread Jack Krupansky
I actually thought seriously about whether to mention wildcard vs. range, but... it annoys me that the Lucene and query parser folks won't fix either PrefixQuery or the query parsers to do the right/optimal thing for single-asterisk query. I wrote up a Jira for it years ago, but for whatever

Re: Negating multiple array fileds

2016-02-17 Thread Shawn Heisey
On 2/17/2016 12:34 AM, Salman Ansari wrote: > 2) "Behind the scenes, Solr will interpret this as "all possible values for > field" --which sounds like it would be exactly what you're looking for, > except that if there are ten million possible values in the field > you're searching, > the

Re: Negating multiple array fileds

2016-02-17 Thread Salman Ansari
Thanks Shawn for explaining in details. Regarding the performance issue you mentioned, there are 2 points 1) "The [* TO *] syntax is an all-inclusive range query, which will usually be much faster than a wildcard query." I will take your statement for granted and let the space for people to

Re: Negating multiple array fileds

2016-02-16 Thread Binoy Dalal
Hi Shawn, Please correct me If I'm wrong here, but don't the all inclusive range query [* TO *] and an only wildcard query like the one above essentially do the same thing from a black box perspective? In such a case wouldn't it be better to default an only wildcard query to an all inclusive range

Re: Negating multiple array fileds

2016-02-16 Thread Shawn Heisey
On 2/15/2016 9:22 AM, Jack Krupansky wrote: > I should also have noted that your full query: > > (-persons:*)AND(-places:*)AND(-orgs:*) > > can be written as: > > -persons:* -places:* -orgs:* > > Which may work as is, or can also be written as: > > *:* -persons:* -places:* -orgs:* Salman, One

Re: Negating multiple array fileds

2016-02-15 Thread Jack Krupansky
I should also have noted that your full query: (-persons:*)AND(-places:*)AND(-orgs:*) can be written as: -persons:* -places:* -orgs:* Which may work as is, or can also be written as: *:* -persons:* -places:* -orgs:* -- Jack Krupansky On Mon, Feb 15, 2016 at 1:57 AM, Salman Ansari

Re: Negating multiple array fileds

2016-02-14 Thread Salman Ansari
@Binoy: The query does work but for one term (-persons:[* TO *]) but it does not work for multiple terms such as http://[Myserver]/solr/[Collection]/select?q=(-persons:[* TO *])AND(-orgs:[* TO *]) This returns zero records although I do have records that has both persons and orgs empty. @Jack:

Negating multiple array fileds

2016-02-14 Thread Salman Ansari
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

Re: Negating multiple array fileds

2016-02-14 Thread Binoy Dalal
Try negating by using a range query like (-persons:[* TO *]) I've always used this and it has always worked for me. On Sun, 14 Feb 2016, 18:51 Salman Ansari wrote: > Hi, > > I think what I am asking should be easy to do but for some reasons I am > facing issues in

Re: Negating multiple array fileds

2016-02-14 Thread Jack Krupansky
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