当前位置: 代码迷 >> 高性能WEB开发 >> solr使用suggest框架时不支持中文怎么处理,有好的解决方案吗
  详细解决方案

solr使用suggest框架时不支持中文怎么处理,有好的解决方案吗

热度:580   发布时间:2012-09-29 10:30:01.0
solr使用suggest框架时不支持中文怎么办,有好的解决方案吗
RT

------解决方案--------------------
<searchComponent class="solr.SpellCheckComponent" name="suggest">
<str name="queryAnalyzerFieldType">text</str>
<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="storeDir">suggest</str>-->
<str name="buildOnCommit">false</str>
<!--<bool name="exactMatchFirst">true</bool>
<str name="sourceLocation">phrasesuggest.txt</str>-->

<!-- Alternatives to lookupImpl: 
org.apache.solr.spelling.suggest.fst.FSTLookup [finite state automaton]
org.apache.solr.spelling.suggest.fst.WFSTLookupFactory [weighted finite state automaton]
org.apache.solr.spelling.suggest.jaspell.JaspellLookup [default, jaspell-based]
org.apache.solr.spelling.suggest.tst.TSTLookup [ternary trees]
-->
<str name="field">sugg</str> <!-- the indexed field to derive suggestions from -->
<float name="threshold">0.005</float>
<!--<str name="buildOnCommit">true</str>-->
<!--
<str name="sourceLocation">american-english</str>
-->
</lst>
</searchComponent>


设置成你分析的类型
  相关解决方案