We are upgrading to ElasticSearch 2.0 and have come across an issue with our mappings in Nest 1.7.0 : we have two types that share a field (with the same format):
"@timestamp": {
"type": "date",
"format": "epoch_millis||dateOptionalTime"
}
When we try to add a mapping on startup for one of the affected types (we are currently PUT
ing the mappings every time), we get this error back:
{
"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
}
We are using a code based mapping described here, but I do not see a way of hanging a query string off of this method without resorting to the Raw
property of our client using something like this:
_client.Raw.IndicesPutMapping("ourindex", "ourtype", PutMappingDescriptorObj, parameters => parameters.AddQueryString("update_all_types", null));
I've browsed the 2.0 branch of Nest, but have not found any references to this update_all_types query string parameter for these mapping calls.
Assuming that IndicesPutMapping()
call could be made to work, is that our only option at this point? I am starting to wonder if we should instead only conditionally add these mappings.