好吧,我elastisearch我使用下面的映射为一个索引:如何在elasticsearch中定义一个映射,该映射不接受映射映射的字段?
{
"mappings": {
"mytype": {
"type":"object",
"dynamic" : "false",
"properties": {
"name": {
"type": "string"
},
"address": {
"type": "string"
},
"published": {
"type": "date"
}
}
}
}
}
它的工作原理。事实上,如果我在“已发布”字段中输入格式错误的日期,它会发生抱怨并失败。 此外,我已经配置如下:
...
node.name : node1
index.mapper.dynamic : false
index.mapper.dynamic.strict : true
...
而且没有映射,我真的不能使用的类型。问题是,如果我插入这样的:
{ “名”: “boh58585”, “地址”: “hiohio”, “发表”: “2014年4月4日”, “测试” :“hophiophop” }
它会高兴地接受它。这不是我期望的行为,因为字段test
不在映射中。我怎样才能限制文档的字段只有那些在映射?