You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Harun Reşit Zafer <ha...@tubitak.gov.tr> on 2014/08/15 09:41:18 UTC

FuzzyLookup does not return exact matches first

I have the following configuration.

<searchComponent class="solr.SpellCheckComponent" name="suggest">
         <lst name="spellchecker">
             <str name="name">fsuggest</str>
             <str 
name="classname">org.apache.solr.spelling.suggest.Suggester</str>
             <str 
name="lookupImpl">org.apache.solr.spelling.suggest.fst.FuzzyLookupFactory</str>
             <str name="suggestAnalyzerFieldType">text_suggest</str>
             <str name="field">text_suggest</str>
             <str name="sourceLocation">suggestionsFull.txt</str>
             <bool name="exactMatchFirst">true</bool>
             <bool name="preserveSep">false</bool>
         </lst>
         <str name="queryAnalyzerFieldType">text_suggest</str>
</searchComponent>

<queryConverter name="queryConverter" 
class="org.apache.solr.spelling.SuggestQueryConverter"/>

  <requestHandler 
class="org.apache.solr.handler.component.SearchHandler" name="/fsuggest">
         <lst name="defaults">
             <str name="spellcheck">true</str>
             <str name="spellcheck.dictionary">fsuggest</str>
             <str name="spellcheck.onlyMorePopular">true</str>
             <str name="spellcheck.count">5</str>
         </lst>
         <arr name="components">
             <str>suggest</str>
         </arr>
     </requestHandler>

When I search for "beşiktaş s" I got the following suggesitons. Since 
minEdit=1 and all the following phrases has a prefix that has 1 edit 
distance with the query, they match.

beşiktaş ile
beşiktaş kulübü
beşiktaş ve
beşiktaş cola
beşiktaş teknik

However there are suggestions starting with exactly "beşiktaş s". But 
their weight are less than the above.

beşiktaş son
beşiktaş spor
beşiktaş spor toto
beşiktaş süper
beşiktaş sivasspor


Any solution/work around?


-- 
Harun Reşit Zafer
TÜBİTAK BİLGEM BTE
Bulut Bilişim ve Büyük Veri Analiz Sistemleri Bölümü
T +90 262 675 3268
W  http://www.hrzafer.com