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
次に、コマンドを実行してアナライザーをテストします $ 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
}
回答:
回答№1は8あなたが電話したら /_analyze
ルートパスでアナライザーが見つからない場合は、パスに少なくとも1つの既存のインデックスを指定してください
$ echo "A drop in the ocean"| http :5600/some_index/_analyze?analyzer=titleAnalyzer
^
|
add an index here