> q=description:(test)&&!(type:10)&&!(type:14)

You can't use an '&' symbol in your query (without escaping it). The boolean 
operator for 'and' in Lucene is 'AND': and it is case sensitive. Your query 
should probably look like:

> q=description:test AND -type:10 AND -type:14

See the Lucene query syntax here:

http://lucene.apache.org/java/docs/queryparsersyntax.html#Boolean%20operators

Thanks,
Stu


-----Original Message-----
From: "Dave C." <[EMAIL PROTECTED]>
Sent: Sunday, November 18, 2007 1:50am
To: solr-user@lucene.apache.org
Subject: RE: Query multiple fields

Hi Nick,

Maybe you can help me with this related problem I am having.
My query is: q=description:(test)&&!(type:10)&&!(type:14).

However, my results are not as expected (55 results instead of the expected 23)

The response header shows: 
"responseHeader":{
  "status":0,
  "QTime":1,
  "params":{
        "wt":"json",
        "!(type:10)":"",
        "!(type:14)":"",
        "indent":"on",
        "q":"description:(test)",
        "fl":"*"}},

I am confused about why the "&&!(type:10)&&!(type:14)" is not in the 'q' 
parameter.

Any ideas?

Thanks,
David


> From: [EMAIL PROTECTED]
> To: solr-user@lucene.apache.org
> Subject: RE: Query multiple fields
> Date: Sun, 18 Nov 2007 03:18:12 +0000
> 
> oh, awesome thanks
> 
> -david
> 
> 
> 
> > Date: Sun, 18 Nov 2007 15:24:00 +1300
> > From: [EMAIL PROTECTED]
> > To: solr-user@lucene.apache.org
> > Subject: Re: Query multiple fields
> > 
> > Hi David
> > You had it write in your example :)
> > 
> > description:test AND type:10
> > 
> > But it would probably be wise to wrap any text in parenthesis:
> > 
> > description:(test foo bar baz) AND type:10
> > 
> > You can find more info on the query syntax here:
> > http://lucene.apache.org/java/docs/queryparsersyntax.html
> > -Nick
> > On 11/18/07, Dave C. <[EMAIL PROTECTED]> wrote:
> > > Hello,
> > >
> > > I've been trying to figure out how to query multiple fields at a time.
> > > For example, I want to do something like: description:test AND type:10.
> > > I've tried things like: "?q=description:test&type:10" etc, but I keep 
> > > getting syntax errors.
> > >
> > > Can anyone tell me how this can be done?
> > >
> > > Thanks,
> > > David
> > >
> > > P.S. Perhaps the solution to this could/should be added to the 
> > > FAQ/tutorial?
> > >
> > > _________________________________________________________________
> > > You keep typing, we keep giving. Download Messenger and join the i'm 
> > > Initiative now.
> > > http://im.live.com/messenger/im/home/?source=TAGLM
> 
> _________________________________________________________________
> You keep typing, we keep giving. Download Messenger and join the i’m 
> Initiative now.
> http://im.live.com/messenger/im/home/?source=TAGLM

_________________________________________________________________
You keep typing, we keep giving. Download Messenger and join the i’m Initiative 
now.
http://im.live.com/messenger/im/home/?source=TAGLM

Reply via email to