Hi Jan,

Thanks for reply.

I have tried the first variation in your example (and again after reading
your reply).

It returns no results!

Note: it is not a multivalued field, I think when you use example 1 below,
it looks for both xyz and abc in same field for same document, what i'm
trying to get are all records that match either of the two.

I hope I am making sense.

Thanks,
Ravish

On Tue, Feb 15, 2011 at 1:47 PM, Jan Høydahl <jan....@cominvent.com> wrote:

> http://wiki.apache.org/solr/SolrQuerySyntax
>
> Examples:
> q=myfield:(xyz OR abc)
>
> q={!lucene q.op=OR df=myfield}xyz abc
>
> q=xyz OR abc&defType=edismax&qf=myfield
>
> PS: If using type="string", you will not match individual words inside the
> field, only an exact case sensitive match of whole field. Use some variant
> of "text" if this is not what you want.
>
> --
> Jan Høydahl, search solution architect
> Cominvent AS - www.cominvent.com
>
> On 15. feb. 2011, at 14.39, Ravish Bhagdev wrote:
>
> > Hi Guys,
> >
> > I've been trying various combinations but unable to perform a "OR" query
> for
> > a specific field in my solr schema.
> >
> > I have a string field called myfield and I want to return all documents
> that
> > have this field which either matches "abc" or  "xyz"
> >
> > So all records that have myfield=abc and all records that have
> myfield=xyz
> > should be returned (union)
> >
> > What should my query be?  I have tried (myfield=abc OR myfield=xyz) which
> > works, but only returns all the documents that contain xyz in that field,
> > which I find quite weird. I have tried running this as fq query as well
> but
> > same result!
> >
> > It is such a simple thing but I can't find right syntax after going
> through
> > a lot of documentation and searching.
> >
> > Will appreciate any quick reply or examples, thanks very much.
> >
> > Ravish
>
>

Reply via email to