yxixi 发表于 2017-12-19 10:27:18

智能提示(一) Solr (suggest)

<searchComponent name=&quot;suggest&quot;><!-- <str name=&quot;queryAnalyzerFieldType&quot;>text_general</str>-->   <lst name=&quot;spellchecker&quot;>   
  <str name=&quot;name&quot;>suggest</str>   
  <str name=&quot;classname&quot;>org.apache.solr.spelling.suggest.Suggester</str>   
  <str name=&quot;lookupImpl&quot;>org.apache.solr.spelling.suggest.tst.TSTLookup</str>
  <str name=&quot;field&quot;>article</str>
  <float name=&quot;threshold&quot;>0.0001</float>
  <!-- 使用自己定义suggest词库词能够将例如以下两行的凝视取消
  <str name=&quot;sourceLocation&quot;>suggest.txt</str>
  <str name=&quot;spellcheckIndexDir&quot;>spellchecker</str>
  -->   
  <str name=&quot;comparatorClass&quot;>freq</str>
  <str name=&quot;buildOnOptimize&quot;>true</str>
  <str name=&quot;buildOnCommit&quot;>true</str>      
  </lst>   
  </searchComponent>   

  <requestHandler name=&quot;/suggest&quot;>  <lst name=&quot;defaults&quot;>   
  <str name=&quot;spellcheck&quot;>true</str>   
  <str name=&quot;spellcheck.dictionary&quot;>suggest</str>   
  <str name=&quot;spellcheck.count&quot;>11</str>   
  <str name=&quot;spellcheck.onlyMorePopular&quot;>true</str>
  <str name=&quot;spellcheck.extendedResults&quot;>false</str>      
  <str name=&quot;spellcheck.collate&quot;>true</str>
  <!--<str name=&quot;spellcheck.build&quot;>true</str>-->   
  </lst>   
  <arr name=&quot;components&quot;>   
  <str>suggest</str>   
  </arr>   
  </requestHandler>
页: [1]
查看完整版本: 智能提示(一) Solr (suggest)