lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danicela nutch" <>
Subject Spellcheck
Date Wed, 07 Sep 2011 08:22:34 GMT

 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" >
 <tokenizer class="solr.StandardTokenizerFactory"/>
 <filter class="solr.LowerCaseFilterFactory"/>
 <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>

 <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>

 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>


 <arr name="last-components">


 The first time, I put a 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 :

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

 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 ?


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