【发布时间】:2015-11-11 05:42:51
【问题描述】:
我们正在升级到 ElasticSearch 2.0,但在 Nest 1.7.0 中的映射遇到了问题:我们有两种类型共享一个字段(格式相同):
"@timestamp": {
"type": "date",
"format": "epoch_millis||dateOptionalTime"
}
当我们尝试在启动时为其中一种受影响的类型添加映射时(我们目前每次都PUTing 映射),我们收到此错误:
{
"error": {
"root_cause": [{
"type": "merge_mapping_exception",
"reason": "Merge failed with failures {[mapper [@timestamp] is used by multiple types. Set update_all_types to true to update [format] across all types.]}"
}],
"type": "merge_mapping_exception",
"reason": "Merge failed with failures {[mapper [@timestamp] is used by multiple types. Set update_all_types to true to update [format] across all types.]}"
},
"status": 400
}
我们正在使用描述为here 的基于代码的映射,但我没有看到在不借助我们客户端的Raw 属性的情况下使用类似这样的方法来挂起查询字符串的方法:
_client.Raw.IndicesPutMapping("ourindex", "ourtype", PutMappingDescriptorObj, parameters => parameters.AddQueryString("update_all_types", null));
我浏览了 Nest 的 2.0 branch,但没有找到对这些映射调用的 update_all_types 查询字符串参数的任何引用。
假设IndicesPutMapping() 调用可以工作,这是我们目前唯一的选择吗?我开始怀疑我们是否应该只有条件地添加这些映射。
【问题讨论】:
标签: elasticsearch nest elasticsearch-net