In addition to what Erick correctly proposed, are you storing norms for your field of interest ( to boost documents with shorter field values )? If you are, I find suspicious "Sony Ear Phones" to win over "Ear Phones" for your "Ear Phones" query. What are the other factors currently involved in your relevancy score calculus ?
Cheers On Tue, Jun 14, 2016 at 4:48 PM, Erick Erickson <erickerick...@gmail.com> wrote: > If these are the complete field, i.e. your document > contains exactly "ear phones" and not "ear phones > are great" use a copyField to put it into an "exact_match" > field that uses a much simpler analysis chain based > on KeywordTokenizer (plus, perhaps things like > lowercaseFilter, maybe strip punctuation and the like". > Then you add a clause on exact_match boosted > really high. > > Best, > Erick > > On Tue, Jun 14, 2016 at 1:01 AM, Naveen Pajjuri > <pajjuri.re...@myntra.com> wrote: > > Hi, > > > > I have documents with a field (data type definition for that field is > > below) values as ear phones, sony ear phones, philips ear phones. when i > > query for earphones sony ear phones is the top result where as i want ear > > phones as top result. please suggest how to boost exact matches. PS: I > have > > earphones => ear phones in my synonyms.txt and the datatype definition > for > > that field keywords is <fieldType name="text" class="solr.TextField" > > positionIncrementGap="100"> <analyzer type="index"> <tokenizer class= > > "solr.WhitespaceTokenizerFactory"/> <filter > class="solr.StopFilterFactory" > > ignoreCase="true" words="stopwords.txt"/> <filter class= > > "solr.LowerCaseFilterFactory"/> <filter class="solr.SynonymFilterFactory" > > synonyms="synonyms.txt" ignoreCase="true" expand="true"/> <filter class= > > "solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> <analyzer type= > > "query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter > class= > > "solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> > <filter > > class="solr.SynonymFilterFactory" synonyms="synonyms.txt" > ignoreCase="true" > > expand="true"/> <filter class="solr.LowerCaseFilterFactory"/> <filter > class= > > "solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> </fieldType> > REGARDS, > > Naveen > -- -------------------------- Benedetti Alessandro Visiting card : http://about.me/alessandro_benedetti "Tyger, tyger burning bright In the forests of the night, What immortal hand or eye Could frame thy fearful symmetry?" William Blake - Songs of Experience -1794 England