我下面,以便找到部分字詞與elasticsearch這裏給出的建議是:Elasticsearch總是返回「映射類型缺少」
ElasticSearch n-gram tokenfilter not finding partial words
我已經創建了一個試圖運行一個簡單的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"}
}
}
}'
以下運行此腳本的前兩個命令(傾銷產品,然後設定指數)似乎工作給我這個:
{"ok":true,"acknowledged":true}
{"ok":true,"acknowledged":true}
然後出現了錯誤以下映射調用給我這個:
{"error":"ActionRequestValidationException[Validation Failed: 1: mapping type is missing;]","status":500}
有人能看到我在做什麼錯?搜索谷歌開始autocompleting「映射未找到elasticsearch」,所以它似乎是一個非常常見的錯誤。
elasticsearch仍然是一個年輕的項目,文檔越來越多,但仍然缺乏。我通常會在郵件列表中獲得很好的回覆,https://groups.google.com/group/elasticsearch – Andy