我試圖讓ES(使用我使用ES v1.4.1)動態模板工作在我的本地機器上,由於某些原因"mappings"
沒有被包含在內?我先用一個簡單的Elasticsearch動態模板
PUT /bigtestindex (I'm using Sense plugin, not curl),
然後我請遵照
PUT /_template/bigtestindex_1
{
"template": "big*",
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edge_ngram",
"min_gram": "1",
"max_gram": "20",
"token_chars": [
"letter",
"digit"
]
}
},
"analyzer": {
"autocomplete": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase",
"asciifolding",
"autocomplete_filter"
]
},
"whitespace_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase",
"asciifolding"
]
}
}
},
"mappings": {
"doc": {
"properties": {
"anchor": {
"type": "string"
},
"boost": {
"type": "string"
},
"content": {
"type": "string",
"analyzer": "whitespace_analyzer"
},
"digest": {
"type": "string"
},
"host": {
"type": "string"
},
"id": {
"type": "string"
},
"metatag.description": {
"type": "string",
"analyzer": "standard"
},
"metatag.keywords": {
"type": "string",
"analyzer": "standard"
},
"segment": {
"type": "string"
},
"title": {
"type": "string",
"index": "not_analyzed",
"fields": {
"autocomplete": {
"type": "string",
"index_analyzer": "autocomplete",
"search_analyzer": "whitespace_analyzer"
}
}
},
"tstamp": {
"type": "date",
"format": "dateOptionalTime"
},
"url": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
我沒有收到任何錯誤和語法看起來是正確的,但創建索引時,我像做
GET /bigtestindex/_mappings
在某種意義上說,我得到
{
"bigtestindex": {
"mappings": {}
}
}
是的,你是正確的,但是 - 它不能解決問題 - 但這是正確的行動順序 – user3125823
它有更多的關於如何讓json設置匹配適當的API端點。 – user3125823
_it是什麼意思不解決probelm_?我不認爲用'template'存在API端點! – avr