简体   繁体   English

如何在Solr中为提示器配置solrconfig.xml?

[英]How to configure solrconfig.xml for suggester in solr?

I have configured my solrconfig.xml to use Suggester component as suggested in http://wiki.apache.org/solr/Suggester . http://wiki.apache.org/solr/Suggester所建议,我已经将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.fst.FSTLookup</str>
      <str name="field">name</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>

  <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">true</str>
      <str name="spellcheck.count">5</str>
      <str name="spellcheck.collate">true</str>
    </lst>
    <arr name="components">
      <str>suggest</str>
    </arr>
  </requestHandler>

However, when i browse from the browser url i am not getting any suggestions. 但是,当我从浏览器URL浏览时,没有任何建议。

http://localhost:8080/solr/collection1/suggest?q=ava&fq=type%3ACategory&wt=xml

<response>
<lst name="responseHeader">
<int name="status">
0
</int>
<int name="QTime">
0
</int>
</lst>
<lst name="spellcheck">
<lst name="suggestions"/>
</lst>
</response>

Even if i remove the fq filter, I am not getting the suggestions. 即使删除了fq过滤器,我也没有得到建议。

Please help. 请帮忙。

Thanks 谢谢

我不确定,您可以尝试添加spellcheck = on

http://localhost:8080/solr/collection1/suggest?q=ava&spellcheck=on&fq=type%3ACategory&wt=xml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM