Fol*_*lyd 2 elasticsearch elasticsearch-plugin elasticsearch-2.0
我在elasticsearch.yml中配置了我的全局自定义分析器,这是我的配置:
index :
analysis :
analyzer :
titleAnalyzer :
type : custom
tokenizer : ik_max_word
filter : [titleSynoymFilter, englishStemmerFilter]
filter :
titleSynoymFilter :
type : synonym
synonyms_path : ../analysis/title_synonym.txt
englishStemmerFilter :
type : stemmer
name : english
Run Code Online (Sandbox Code Playgroud)
然后我通过运行命令测试我的分析器 $ echo 'A drop in the ocean'| http :5600/_analyze?analyzer=titleAnalyzer
但elasticsearch告诉我它找不到分析仪:
{
"error": {
"reason": "failed to find analyzer [titleAnalyzer]",
"root_cause": [
{
"reason": "[elastisearch][127.0.0.1:9300][indices:admin/analyze[s]]",
"type": "remote_transport_exception"
}
],
"type": "illegal_argument_exception"
},
"status": 400
}
Run Code Online (Sandbox Code Playgroud)
如果/_analyze在根路径上调用未找到分析器,请尝试在路径上指定至少一个现有索引
$ echo 'A drop in the ocean'| http :5600/some_index/_analyze?analyzer=titleAnalyzer
^
|
add an index here
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2271 次 |
| 最近记录: |