我遇到了这个问题,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}}任何帮助都将不胜感激。谢谢。
发布于 2016-07-22 04:47:34
简单的方法是将您的spellings.txt放在solrconfig.xml所在的同一文件夹中。如果我没弄错的话。
https://stackoverflow.com/questions/38514023
复制相似问题