If you're submitting this:

field1 : This is a good string

then you're searching in "field1" ONLY for "This". the tokens "is",
"a" "good" and "string" are being searched against your default
search field as defined in your schema.....

Have you tried parenthesizing?

Try the SOLR admin page for looking at how a query is parsed and/or
attach &debugQuery=on to your http request to see how the query
actually works....

HTH
Erick

On Mon, Apr 19, 2010 at 5:47 AM, Sandhya Agarwal <sagar...@opentext.com>wrote:

> Also, one of the fields here, *field3* is a dynamic field. All the other
> fields except this field, are copied into "text" with copyField.
>
> Thanks,
> Sandhya
>
> -----Original Message-----
> From: Sandhya Agarwal [mailto:sagar...@opentext.com]
> Sent: Monday, April 19, 2010 2:55 PM
> To: solr-user@lucene.apache.org
> Subject: RE: Help using boolean operators
>
> Thank You Mitch.
>
> I have a query mentioned below : (my defaultOperator is set to "AND")
>
> (field1 : This is a good string AND field2 : This is a good string AND
> field3 : This is a good string AND (field4 : ASCIIDocument OR field4 :
> BinaryDocument OR field4 : HTMLDocument) AND field5 : doc)
>
> This is not giving me the desired results.
>
> I want all documents with field1 = ' This is a good string' and field2 =
> 'This is a good string'  and field3 = ' This is a good string' and (field4 =
> 'ASCIIDocument' or ' BinaryDocument' or ' HTMLDocument') and field5 = 'doc'
> to be returned.
>
> I am not sure why this is not giving me the desired results.
>
> Thanks,
> Sandhya
>
> -----Original Message-----
> From: MitchK [mailto:mitc...@web.de]
> Sent: Monday, April 19, 2010 2:19 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Help using boolean operators
>
>
> Hello Sandhya,
>
> title: star AND wars NOT sdi
> This query will match every document where "star" *and* "wars" occur but
> *not* the term "sdi" (SDI => Strategic Defense Initiative => in the media
> there was often the term star wars used to describe the project).
>
> title: star OR wars
> This query will match every document where "star" *or* "wars" occur.
>
> If your standard operator (defined in your schema.xml) is the OR, you don't
> need to add the "OR" operator to your query.
>
> Standard-operator: OR
> title: star wars
> This is the same as title: star OR wars
>
> standard-operator: AND
> title: star wars
> - > the same as title: star AND wars
>
> standard-operator: AND
> title: star wars NOT sdi
> is the same as: title: star AND wars NOT sdi
>
> Hope this helps.
>
> Kind regards
> - Mitch
> --
> View this message in context:
> http://n3.nabble.com/Help-using-boolean-operators-tp729102p729135.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to