sachin jain
sachin jain

Reputation: 224

Results returned by "did you mean" feature of Solr 4.6 are not in proper order

Following is the configuration that I have in solrconfig.xml:

<searchComponent name="suggest" class="solr.SpellCheckComponent">
    <str name="queryAnalyzerFieldType">text_m_ss</str>
    <lst name="spellchecker">
      <str name="name">suggest</str>
      <str name="classname">solr.IndexBasedSpellChecker</str>
      <str name="spellcheckIndexDir">./spellchecker</str>
      <str name="field">text_m_ss</str>
      <str name="buildOnCommit">true</str>
    </lst>
  </searchComponent>

  <requestHandler name="/sugegst" class="solr.SearchHandler">
    <lst name="defaults">
        <str name="spellcheck">true</str> 
     <str name="spellcheck.dictionary">sugegst</str> 
     <str name="spellcheck.onlyMorePopular">false</str> 
     <str name="spellcheck.count">25</str> 
     <str name="spellcheck.collate">true</str> 
    </lst>
    <arr name="components">
        <str>sugegst</str>
    </arr>
  </requestHandler>

Now when i query say appel: it returns appear, happen, apply, apple The desired result is: apple should be the first result returned where as in this case its 4th. Is there a way where i can get apple as the 1st result

Upvotes: 0

Views: 303

Answers (1)

Alex Howansky
Alex Howansky

Reputation: 53636

There's nothing "improper" about your result set. Solr can't read your mind and know that you think apple is better than appear -- that's why this feature is called the suggester.

That said, you can change the order by which the results are sorted -- but you have to realize that it's not going to always pick the same thing your brain does.

Upvotes: 2

Related Questions