lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alessandro Benedetti <benedetti.ale...@gmail.com>
Subject Re: Solr Exact match boost Reduce the results
Date Fri, 12 Jun 2015 13:08:28 GMT
Hi jack, do you mean exact match over the synonyms ?
In that case, with your Analyzer you are not going to be able to see that.
You apply index analysis synonym expansion.
So for your Index there is no difference between the synonyms, there is no
"exact match" .

In this case I would suggest you to use a custom Synonym query parser that
actually solve this problem boosting original terms and providing nice
query time synonyms :

http://nolanlawson.com/2012/10/31/better-synonym-handling-in-solr/

If it's not related the synonyms, you should take a look to the edismax
query parser.
I think he enhance exact phrase matches out of the box.

Cheers



2015-06-12 10:38 GMT+01:00 JACK <mfalakh@gmail.com>:

> I have two fields, one is copy field. I have to get Exact match results
> first
> along with entire result of fuzzy search.
>
>     <field name="product_name" type="text_wslc" indexed="true"
> stored="true"
> required="true" multiValued="false"/>
> <field name="dummy_name" type="string_ci" indexed="true" stored="false"
> required="true" />
> <copyField source="product_name" dest="dummy_name"/>
>
> Its filed definition is given below
>
> <fieldType name="text_wslc" class="solr.TextField"
> positionIncrementGap="100">
>                         <analyzer type="index">
>                                   <tokenizer
> class="solr.WhitespaceTokenizerFactory"/>
>                                 <filter class="solr.SynonymFilterFactory"
> synonyms="synonyms.txt"
> ignoreCase="true" expand="true"/>
>                                 <filter
> class="solr.WordDelimiterFilterFactory"
>                                          generateWordParts="1"
>                                          generateNumberParts="1"
>                                          catenateWords="1"
>                                          catenateNumbers="1"
>                                          catenateAll="1"
>                                          preserveOriginal="1"
>                                          />
>                                 <filter
> class="solr.LowerCaseFilterFactory"/>
>                                 <filter
> class="solr.SnowballPorterFilterFactory" language="English" />
>                                 <filter
> class="solr.PorterStemFilterFactory"/>
>                                 <filter class="solr.KStemFilterFactory"/>
>                                 <filter
> class="solr.EnglishMinimalStemFilterFactory"/>
>                         </analyzer>
>                         <analyzer type="query">
>                                 <tokenizer
> class="solr.WhitespaceTokenizerFactory"/>
>                                 <filter class="solr.SynonymFilterFactory"
> synonyms="synonyms.txt"
> ignoreCase="true" expand="true"/>
>                                 <filter
> class="solr.WordDelimiterFilterFactory"
>                                          generateWordParts="1"
>                                          generateNumberParts="1"
>                                          catenateWords="1"
>                                          catenateNumbers="1"
>                                          catenateAll="1"
>                                          preserveOriginal="1"
>                                          />
>                                 <filter
> class="solr.LowerCaseFilterFactory"/>
>                                 <filter
> class="solr.SnowballPorterFilterFactory" language="English" />
>                                 <filter
> class="solr.PorterStemFilterFactory"/>
>                                 <filter class="solr.KStemFilterFactory"/>
>                                 <filter
> class="solr.EnglishMinimalStemFilterFactory"/>
>                         </analyzer>
>  </fieldType>
>
> <fieldType name="string_ci" class="solr.TextField" sortMissingLast="true"
> omitNorms="true">
>                       <analyzer type="index">
>                         <tokenizer
> class="solr.WhitespaceTokenizerFactory"/>
>                         <filter class="solr.LimitTokenCountFilterFactory"
> maxTokenCount="20"/>
>                         <filter class="solr.LowerCaseFilterFactory"/>
>                      </analyzer>
>                      <analyzer type="query">
>                         <tokenizer
> class="solr.WhitespaceTokenizerFactory"/>
>                         <filter class="solr.LimitTokenCountFilterFactory"
> maxTokenCount="20"/>
>                         <filter class="solr.LowerCaseFilterFactory"/>
>                         <filter class="solr.SnowballPorterFilterFactory"
> language="English" />
>                         <filter class="solr.KStemFilterFactory"/>
>                         <filter
> class="solr.EnglishMinimalStemFilterFactory"/>
>                    </analyzer>
> </fieldType>
>
> The dummy filed is to get the exact match results.
> 1. To get exact results first just use quotes around the search words. So i
> am getting the exact results first. But the result is too less.Around
> 8000.Query is given below
>
> q="laptop+bag"&df=product_name&defType=edismax&qf=product_name^0.01+dummy_name^200
>
> 2. But for the query without quotes gives huge amount of results around
> 20000, but won't give exact one first. Its query is below
>
> q=laptop+bag&df=product_name&defType=edismax&qf=product_name^0.01+dummy_name^200
>
> I have to get huge results like my second option with exact results first.
> Is this the way to do it or any problem in my query?
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-Exact-match-boost-Reduce-the-results-tp4211352.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
--------------------------

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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message