Elasticsearch で部分的な単語を見つけるために、ここで与えられたアドバイスに従っています。
ElasticSearch n-gram tokenfilter で部分的な単語が見つからない
これのバージョンを実行しようとする単純な bash スクリプトを作成しました。
curl -XDELETE 10.160.86.134:9200/products
curl -XPOST 10.160.86.134:9200/products -d '{
"index": {
"number_of_shards": 1,
"analysis": {
"filter": {
"mynGram" : {"type": "nGram", "min_gram": 2, "max_gram": 10}
},
"analyzer": {
"a1" : {
"type":"custom",
"tokenizer": "standard",
"filter": ["lowercase", "mynGram"]
}
}
}
}
}
}'
curl -XPUT 10.160.86.134:9200/products/_mapping -d '{
"product" : {
"index_analyzer" : "a1",
"search_analyzer" : "standard",
"properties" : {
"product_description": {"type":"string"},
"product_name": {"type":"string"}
}
}
}'
このスクリプトを実行した後、最初の 2 つのコマンド (製品のダンプ、次にインデックスの設定) が機能するようで、次のように表示されます。
{"ok":true,"acknowledged":true}
{"ok":true,"acknowledged":true}
次に、マッピング呼び出しに続いてエラーが発生し、次のようになります。
{"error":"ActionRequestValidationException[Validation Failed: 1: mapping type is missing;]","status":500}
誰かが私が間違っていることを見ることができますか? Google を検索すると、「mapping not found elasticsearch」のオートコンプリートが開始されるため、非常に一般的なエラーのようです。