Hi,
According to the Lucene query syntax:
"The symbol && can be used in place of the word AND." So, I shouldn't have to
use 'AND'.
If I do the same query: q=description:(test)&&!(type:10)&&!(type:14) in the
Solr admin interface, I get the correct results.
Re: special characters:
"To escape these character use the \ before the character. For example to
search for (1+1):2 use the query".
I am not searching for "&&" or "!" or "(". So, I shouldn't have to escape
these characters either.
Is my thinking incorrect?
Thanks,
- David
> Date: Sun, 18 Nov 2007 12:46:00 -0500
> Subject: RE: Query multiple fields
> From: [EMAIL PROTECTED]
> To: [email protected]
>
> > 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: [email protected]
> 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: [email protected]
> > 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: [email protected]
> > > 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
>
_________________________________________________________________
Put your friends on the big screen with Windows Vista® + Windows Live™.
http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_102007