Hi,
I have a sample index called "restaurants" with an explicit mapping as follows
{
"mappings": {
"categories": {
"_source": {
"enabled": true
},
"numeric_detection": true,
"date_detection": true,
"properties": {
"restaurant": {
"properties": {
"name": {
"type": "text"
},
"current_address": {
"type": "text"
},
"zip": {
"type": "text"
},
"location": {
"type": "geo_point"
}
}
}
}
}
This is the command to create the index:
curl -XPUT 'localhost:9200/restaurants?pretty' -d @restaurant-mappings.json -H 'Content-type: application/json'
I try the bulk method of adding documents. The first command works ok
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/restaurants/mediterranean/_bulk?pretty&refresh' --data-binary @"mediterranean_restaurant_data.json"
However the second command throws an error:
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/restaurants/chinese/_bulk?pretty&refresh' --data-binary @"chinese_restaurant_data.json"
{
"took" : 42,
"errors" : true,
"items" : [
{
"index" : {
"_index" : "restaurants",
"_type" : "chinese",
"_id" : "VOhnGnMBGURHDTdYpAzX",
"status" : 400,
"error" : {
"type" : "illegal_argument_exception",
"reason" : "Rejecting mapping update to [restaurants] as the final mapping would have more than 1 type: [mediterranean, chinese]"
}
}
}
]
}
What am I doing wrong here ?
Thanks,
AS