【发布时间】:2016-02-10 19:18:13
【问题描述】:
具有以下映射:
curl -X PUT 'localhost:9200/cambio_indice?pretty=true' -d '{
"mappings" : {
"el_tipo" : {
"properties" : {
"name" : { "type" : "string" },
"age" : { "type" : "integer" },
"read" : { "type" : "integer" }
}}}}'
如果我添加以下代码,即使它与映射不匹配(read 缺失),它也能完美运行,但 ES 不会抱怨。
curl -X PUT 'localhost:9200/cambio_indice/el_tipo/1?pretty=true' -d '{
"name" : "Eduardo Inda",
"age" : 23
}'
如果我添加以下条目,它也可以工作。
curl -X PUT 'localhost:9200/cambio_indice/el_tipo/2?pretty=true' -d '{
"jose" : "stuff",
"ramon" : 23,
"garcia" : 1
}'
映射似乎没有对我添加的元素生效。当我尝试映射我的类型时,我做错了什么?
【问题讨论】:
-
您的期望是什么?
-
输入时失败,或者显示错误
you are trying to add a propierty that is not mapped
标签: elasticsearch