Dharmik Bhandari
Dharmik Bhandari

Reputation: 1702

Suggestion is not comes from main Index in solr

I was referring http://wiki.apache.org/solr/Suggester . There is a sentence

"sourceLocation - location of the dictionary file. If not empty then this is a path to a dictionary file (see below). If this value is empty then the main index will be used as a source of terms and weights. "
in SpellCheckComponent configuration.

When I sourceLocation leaves empty then I didn't get any suggestion otherwise I declare external dictionary path to sourchLocation it works fine...

What could be the reason???

My search Component is:

<searchComponent name="spellcheck" class="solr.SpellCheckComponent">

    <str name="queryAnalyzerFieldType">string</str>
<lst name="spellchecker"> 
      <str name="name">default</str>
      <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
      <str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
      <str name="spellcheckIndexDir">f:/spellchecker</str>
      <str name="field">Name</str>
      <str name="sourceLocation"></str>
      <float name="threshold">0.005</float>
      <str name="buildOnCommit">true</str>
</lst>
</searchComponent>

Request URL:

http://localhost:8983/solr/core-live/select/?spellcheck=true&spellcheck.q=dell&spellcheck.dictionary=default&spellcheck.count=10&spellcheck.onlyMorePopular=false

Upvotes: 0

Views: 367

Answers (1)

Paige Cook
Paige Cook

Reputation: 22555

Based on the spellcheck component settings in the example solrconfig.xml that comes with the Solr 3.6.1 distribution; in the case where you want to derive the source of terms from the index, I would remove the <sourceLocation> configuration completely. As the base example only shows the use of the <sourceLocation> setting when one wants to read the list of suggestions from an external file. Perhaps the behavior of this setting has changed and the documentation on the Solr Wiki needs to be updated.

Upvotes: 1

Related Questions