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 abhayd <aj...@hotmail.com> on 2011/01/28 07:45:30 UTC

NOT operator not working

i have a field in xml file <DeviceType>Accessory Data / Memory</DeviceType> 
solr schema field declared as   <field name="deviceType" type="text"
indexed="true" stored="true" />

I am trying to eliminate results by using NOT. For example I want all
devices for a term except where DeviceType is not Accessory*

SO here is what i m trying
/solr/select?indent=on&version=2.2&q=(sharp+AND+-deviceType:Access*)&qt=dismax&wt=standard

But for some reason its giving me all results for "sharp" irrespective of
what devicetype is

It works fine with fq=-deviceType:Accessory but due to some other
application constraint we want to use 
q=(sharp+AND+-deviceType:Access*)

Any thoughts what i m doing wrong?
-- 
View this message in context: http://lucene.472066.n3.nabble.com/NOT-operator-not-working-tp2365831p2365831.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: NOT operator not working

Posted by Grijesh <pi...@gmail.com>.
q=(sharp+AND+-deviceType:Access*)

that is not the query type of dismax for q operator (deviceType:Access*).
either you use as Filter query or write query like

q=(sharp AND -Access*)

-----
Thanx:
Grijesh
-- 
View this message in context: http://lucene.472066.n3.nabble.com/NOT-operator-not-working-tp2365831p2365952.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: NOT operator not working

Posted by abhayd <aj...@hotmail.com>.
thanks that helps
-- 
View this message in context: http://lucene.472066.n3.nabble.com/NOT-operator-not-working-tp2365831p2389803.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: NOT operator not working

Posted by Ahmet Arslan <io...@yahoo.com>.

--- On Fri, 1/28/11, abhayd <aj...@hotmail.com> wrote:

> From: abhayd <aj...@hotmail.com>
> Subject: NOT operator not working
> To: solr-user@lucene.apache.org
> Date: Friday, January 28, 2011, 8:45 AM
> 
> i have a field in xml file <DeviceType>Accessory Data
> / Memory</DeviceType> 
> solr schema field declared as   <field
> name="deviceType" type="text"
> indexed="true" stored="true" />
> 
> I am trying to eliminate results by using NOT. For example
> I want all
> devices for a term except where DeviceType is not
> Accessory*
> 
> SO here is what i m trying
> /solr/select?indent=on&version=2.2&q=(sharp+AND+-deviceType:Access*)&qt=dismax&wt=standard
> 
> But for some reason its giving me all results for "sharp"
> irrespective of
> what devicetype is
> 
> It works fine with fq=-deviceType:Accessory but due to some
> other
> application constraint we want to use 
> q=(sharp+AND+-deviceType:Access*)

Wildcard queries are not analyzed. For example if you have an lowercase filter at index time, you should lowercase your query manually.
Instead of fq=-deviceType:Access* you should use fq=-deviceType:access*