Hi,

 I'm trying to get search suggestions like Google 'Did you mean ?' with indexed 
data with Solr from Nutch.

 I added this to my schema.xml :

 <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" >
 <analyzer>
 <tokenizer class="solr.StandardTokenizerFactory"/>
 <filter class="solr.LowerCaseFilterFactory"/>
 <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
 </analyzer>
 </fieldType>

 <field name="textSpell" type="text" stored="false" indexed="true" 
multiValued="true" />

 <copyField source="*_text" dest="textSpell" />

 ---

 I added this to my solrconfig.xml :

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

 <str name="queryAnalyzerFieldType">textSpell</str>

 <lst name="spellchecker">
 <str name="classname">solr.IndexBasedSpellChecker</str>
 <str name="name">textSpell</str>
 <str name="field">textSpell</str>
 <str name="spellcheckIndexDir">./spellcheckerDefault</str>
 </lst>
 </searchComponent>

 I modified this :

 <requestHandler name="standard" class="solr.SearchHandler" default="true">
 <lst name="defaults">
 <str name="echoParams">explicit</str>

 <str name="spellcheck">true</str>
 <str name="spellcheck.dictionary">textSpell</str>
 <str name="spellcheck.onlyMorePopular">false</str>
 <str name="spellcheck.extendedResults">true</str>
 <str name="spellcheck.collate">true</str>
 <str name="spellcheck.count">5</str>

 </lst>

 <arr name="last-components">
 <str>spellcheck</str>
 </arr>
 </requestHandler>

 ---

 The first time, I put a spellcheck.build=true in the request, the index was 
modified, but has only 20 bytes. (I think that's strange for 7000 indexed pages)

 This request : http://localhost:8983/solr/select/?q=nytames

 returns that :

 −
 <response>
 −
 <lst name="responseHeader">
 <int name="status">0</int>
 <int name="QTime">33</int>
 −
 <lst name="params">
 <str name="q">nytames</str>
 </lst>
 </lst>
 <result name="response" numFound="0" start="0"/>
 −
 <lst name="spellcheck">
 −
 <lst name="suggestions">
 <bool name="correctlySpelled">false</bool>
 </lst>
 </lst>
 </response>

 I tried with spellcheck=true but it doesn't change nothing.

 I should get some suggestions in the <lst name="suggestions" but I get nothing.

 Do someone has an idea about the problem ?

 Thanks.

Reply via email to