Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使solr建议在特定领域发挥作用?_Solr_Autosuggest - Fatal编程技术网

如何使solr建议在特定领域发挥作用?

如何使solr建议在特定领域发挥作用?,solr,autosuggest,Solr,Autosuggest,我正在尝试实现solr的自动建议这是我在solrconfig.xml文件中所做的更改 <requestHandler class="org.apache.solr.handler.component.SearchHandler" name="/suggest"> <lst name="defaults"> <str name="spellcheck">true</str> <str name="spellcheck.dictionar

我正在尝试实现solr的自动建议这是我在solrconfig.xml文件中所做的更改

<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>
<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.TSTLookupFactory</str>
  <str name="field">displayName</str>  <!-- the indexed field to derive suggestions from -->
  <float name="threshold">0.005</float>
  <str name="buildOnCommit">true</str>
</lst>
</searchComponent>
它返回5个单词

“比萨饼”、“土豆”、“意大利面”、“蛋白质”、“高级”


但是在displayName字段中,我得到了一些单词,如paneer、palak等,但没有显示出来为什么会这样?

您能否将以下内容添加到配置中并运行下面的查询在进行这些更改后,不要忘记重新加载solr core。

<str name="suggestAnalyzerFieldType">string</str>
<str name="storeDir">suggester_fuzzy_dir</str>
字符串
建议者\u模糊\u目录

http://localhost:8983/solr/food/suggest?suggest=true&suggest.build=true&suggest.dictionary=suggest&wt=json&suggest.q=p&suggest.count=10

您可以将以下内容添加到配置中并运行以下查询在进行这些更改后,不要忘记重新加载solr core。

<str name="suggestAnalyzerFieldType">string</str>
<str name="storeDir">suggester_fuzzy_dir</str>
字符串
建议者\u模糊\u目录

http://localhost:8983/solr/food/suggest?suggest=true&suggest.build=true&suggest.dictionary=suggest&wt=json&suggest.q=p&suggest.count=10

字段:索引中的一个字段,用作建议术语的基础。是的,我提到了我的字段。您是否在寻找五个以上的结果,然后提供更新默认配置
5
。您还可以在查询命令
&suggest.count=10
中传递参数。您没有在url中引用suggestre名称吗?哎呀,您传递的是。。试试阿披舍克的建议试试这个
http://localhost:8983/solr/food/suggest?q=p&wt=json&indent=true&suggest.count=10
字段:索引中的一个字段,用作建议术语的基础。是的,我提到了我的字段。您是否正在查找五个以上的结果,然后提供更新默认配置
5
。您还可以在查询命令
&suggest.count=10
中传递参数。您没有在url中引用suggestre名称吗?哎呀,您传递的是。。试试阿披舍克的建议试试这个
http://localhost:8983/solr/food/suggest?q=p&wt=json&indent=true&suggest.count=10
它不起作用我甚至试着重新编制整个数据的索引,但它不起作用我甚至试着重新编制整个数据的索引,但它不起作用