【问题标题】:Upload Dictionary in Solr for Spell Check在 Solr 中上传字典以进行拼写检查
【发布时间】:2016-07-21 20:42:14
【问题描述】:

我在这个 Solr 中遇到了这个问题:Solr 只能根据数据库中的文件进行拼写检查并给出建议。但是,我想添加一个英文词典,所以即使数据库中不存在该词,Solr 也可以根据英文词典给出建议。

我知道我必须在 solrconfig.xml 中使用 FileBasedSpellChecker:

 <searchComponent name=”spellcheck” class=”solr.SpellCheckComponent”>
         <lst name=”spellchecker”>
             <str name=”classname”>solr.FileBasedSpellChecker</str>
             <str name=”name”>file</str>
             <str name=”sourceLocation”>spellings.txt</str>
             <str name=”characterEncoding”>UTF-8</str>
             <str name=”spellcheckIndexDir”>./spellcheckerFile</str>
         </lst>
     </searchComponent>

但我不知道如何将 spellings.txt 上传到 Solr。我收到此错误:

{
  "responseHeader":{
    "status":404,
    "QTime":1},
  "response":{"numFound":0,"start":0,"docs":[]
  },
  "error":{
    "metadata":[
      "error-class","org.apache.solr.common.SolrException",
      "root-error-class","org.apache.solr.common.SolrException"],
    "msg":"Specified dictionaries do not exist: file",
    "code":404}}

任何帮助将不胜感激。谢谢。

【问题讨论】:

    标签: solr lucidworks


    【解决方案1】:

    简单的方法是将您的spellings.txt 放在solrconfig.xml 所在的同一文件夹中。如果我正确理解了这个问题。

    【讨论】:

    • 是的,我也猜到了。但问题是我正在使用 Lucidworks Fusion,它建立在 Solr 和其他东西之上。 Fusion 不会公开 solrconfig 在其目录中的位置。我正在 Fusion UI 中访问它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-09
    • 2011-03-01
    • 2013-05-18
    相关资源
    最近更新 更多