合并类型为 date/string 的动态字段触发了冲突
Merging dynamic field with type date/string triggered conflict
我正在我的 Elasticsearch 服务器上上传 json 个文件,我有一个对象 "meta",其中包含一个字段名称和一个字段值。有时值是字符串,有时是日期,因此动态映射不起作用。
我试图放置一个显式映射以将字段设置为字符串,但我总是遇到相同的错误 "Merging dynamic updates triggered a conflict: mapper [customer.meta.value] of different type, current_type [string], merged_type [date]"}}}, :level=>:warn"
我可以使用参数 "ignore_conflict" 或者我如何上传多类型字段?
感谢
elasticsearch 中的同一字段不能有两种数据类型。无法对其进行索引。动态映射意味着类型是从插入字段的第一个值开始识别的。如果您尝试在该字段中插入其他类型,则会出错。如果您需要同时存储字符串和日期,最好的办法是将映射设置为使用字符串,并在将日期传递给 elasticsearch 之前将其显式转换为字符串。
我为 _ default_ 禁用了 date_detection 并且它起作用了。
现在我的问题如下:我只想为 meta.value 和 customer.meta.value 禁用 date_detection。第一个是正确的,但第二个我不能,因为我认为它是一个嵌套对象。
我试过这个:
curl -XPUT 'localhost:9200/rr_sa' -d '
{
"mappings": {
"meta": {
"date_detection": false
},
"customer.meta": {
"date_detection": false
}
}
}
'
我正在我的 Elasticsearch 服务器上上传 json 个文件,我有一个对象 "meta",其中包含一个字段名称和一个字段值。有时值是字符串,有时是日期,因此动态映射不起作用。 我试图放置一个显式映射以将字段设置为字符串,但我总是遇到相同的错误 "Merging dynamic updates triggered a conflict: mapper [customer.meta.value] of different type, current_type [string], merged_type [date]"}}}, :level=>:warn"
我可以使用参数 "ignore_conflict" 或者我如何上传多类型字段?
感谢
elasticsearch 中的同一字段不能有两种数据类型。无法对其进行索引。动态映射意味着类型是从插入字段的第一个值开始识别的。如果您尝试在该字段中插入其他类型,则会出错。如果您需要同时存储字符串和日期,最好的办法是将映射设置为使用字符串,并在将日期传递给 elasticsearch 之前将其显式转换为字符串。
我为 _ default_ 禁用了 date_detection 并且它起作用了。 现在我的问题如下:我只想为 meta.value 和 customer.meta.value 禁用 date_detection。第一个是正确的,但第二个我不能,因为我认为它是一个嵌套对象。
我试过这个:
curl -XPUT 'localhost:9200/rr_sa' -d '
{
"mappings": {
"meta": {
"date_detection": false
},
"customer.meta": {
"date_detection": false
}
}
}
'