You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by marotosg <ma...@gmail.com> on 2012/10/18 15:57:21 UTC
Query excluding empty values and some criteria
Hi.
I am trying to do query where I need to include empty values and exclude
some specific data.
For instance my field name is "Industry" and my query looks like
(-Industry:"Agriculture") OR (-Industry:[* TO *])
I want to get all empty values OR industries which are not Agriculture. This
query does not work for me.
I tried it to split in two and it works.
First query --> (-Industry:"Agriculture")
Second Query --> (-Industry:[* TO *])
Any idea?
Thanks
Sergio
--
View this message in context: http://lucene.472066.n3.nabble.com/Query-excluding-empty-values-and-some-criteria-tp4014498.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Query excluding empty values and some criteria
Posted by Jack Krupansky <ja...@basetechnology.com>.
A parenthesized pure negative query needs a "*:*" to apply the negative
query against:
(*:* -Industry:"Agriculture") OR (*:* -Industry:[* TO *])
or,
(some terms -Industry:"Agriculture") OR (*:* -Industry:[* TO *]))
-- Jack Krupansky
-----Original Message-----
From: marotosg
Sent: Thursday, October 18, 2012 9:57 AM
To: solr-user@lucene.apache.org
Subject: Query excluding empty values and some criteria
Hi.
I am trying to do query where I need to include empty values and exclude
some specific data.
For instance my field name is "Industry" and my query looks like
(-Industry:"Agriculture") OR (-Industry:[* TO *])
I want to get all empty values OR industries which are not Agriculture. This
query does not work for me.
I tried it to split in two and it works.
First query --> (-Industry:"Agriculture")
Second Query --> (-Industry:[* TO *])
Any idea?
Thanks
Sergio
--
View this message in context:
http://lucene.472066.n3.nabble.com/Query-excluding-empty-values-and-some-criteria-tp4014498.html
Sent from the Solr - User mailing list archive at Nabble.com.