You might look at the analysis page from the admin console for the field in question, it'll show you what various parts of the analysis chain do.
But I agree with Jan, having your field as a "string" type is a red flag. This field is NOT analyzed, parsed, or filtered. For instance, if a doc has a value for the field of: [My life], only [My life] will match. Not [my], not [life], not even [my life] (ignore all brackets, but quotes are often confused with phrases....). It may well be that this is the exact behavior you want, but this is often a point of confusion. Best Erick On Tue, Feb 15, 2011 at 9:00 AM, Ravish Bhagdev <ravish.bhag...@gmail.com> wrote: > Arghhh.. > > I think its the regexp parser messing things up (just looked at the > debugQuery ouput and its parsing incorrectly some "/" kind of letters I had. > > I think I can clean up the data off these characters or maybe there is a > way to escape them... > > Ravish > > On Tue, Feb 15, 2011 at 1:54 PM, Ravish Bhagdev > <ravish.bhag...@gmail.com>wrote: > >> 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 >>> >>> >> >