我使用同义词标记过滤器和自定义文件。
在windows 10机器上安装elasticsearch 6.7作为服务我的synonyms.txt位于C:\ProgramData\Elastic\Elasticsearch\config\analysis\synonyms.txt
这是我的索引设置
PUT /synonyms
{
"settings": {
"analysis": {
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "analysis/synonyms.txt"
}
},
"analyzer": {
"my_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
"synonym"
]
}
}
}
},
"mappings": {
"_doc": {
"properties": {
"description": {
"type": "text",
"analyzer": "my_analyzer"
}
}
}
}
}在创建上面的索引时,我得到了这个错误
{
"error": {
"root_cause": [{
"type": "illegal_argument_exception",
"reason": "IOException while reading synonyms_path_path: C:\ProgramData\Elastic\Elasticsearch\config\analysis\synonyms.txt"
}],
"type": "illegal_argument_exception",
"reason": "IOException while reading synonyms_path_path: C:\ProgramData\Elastic\Elasticsearch\config\analysis\synonyms.txt",
"caused_by": {
"type": "no_such_file_exception",
"reason": "C:\ProgramData\Elastic\Elasticsearch\config\analysis\synonyms.txt"
}
},
"status": 400
}在elasticsearch中也尝试了同义词令牌过滤器,在windows机器上安装为存档分发版.zip,但是得到了相同的错误,但是在linux中,无论是在存档还是包发行版中,它都在工作。
提前谢谢。快乐寻觅
发布于 2019-09-03 10:53:59
这里的问题是文件扩展名隐藏在控件panel.so中,您可以转到“控制panel>file资源管理器”options>,单击“视图”选项卡,取消选中选项(隐藏已知文件类型的扩展名),应该是这样的现在相应地重命名文件,然后再试一次。
https://stackoverflow.com/questions/57766376
复制相似问题