0
我试图设置Solr suggester模块。Solr - 建议不返回任何暗示
我跟着guide和设置我的核心是这样的:
solrconfig.xml中
<searchComponent class="solr.SpellCheckComponent" name="suggest">
<lst name="spellchecker">
<str name="name">suggest</str>
<str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
<str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
<str name="field">city</str> <!-- the indexed field to derive suggestions from -->
<float name="threshold">0</float>
<str name="buildOnCommit">true</str>
</lst>
</searchComponent>
<requestHandler class="org.apache.solr.handler.component.SearchHandler" name="/suggest">
<lst name="defaults">
<str name="spellcheck">true</str>
<str name="spellcheck.dictionary">suggest</str>
<str name="spellcheck.onlyMorePopular">false</str>
<str name="spellcheck.count">5</str>
<str name="spellcheck.collate">true</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
schema.xml中
<types>
<fieldType class="solr.TextField" name="textSpell" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
</types>
<fields>
<!-- my other fieldsfields -->
<field name="city" type="textSpell" indexed="true" stored="true"/>
</fields>
,然后与重建拼写检查:
http://localhost:4569/solr/myCore/suggest?q=a&spellcheck=true&spellcheck.build=true
,然后做一个搜索:
http://localhost:4569/solr/myCore/suggest?q=aberdean&spellcheck=true&spellcheck=on
,但我总是在响应空建议:
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">1</int>
</lst>
<lst name="spellcheck">
<lst name="suggestions"/>
</lst>
</response>
我检查的建议in this question
任何想法,为什么我不获得结果?