I'm trying to insert data directly to elastic search into a specific index called "cars" via the curl command but it is constantly encountering errors.
curl -XPOST http://elk.local:9200/cars/my_doc -H "Content-Type: application/json" -d @test.json
JSON example:
{
"name":"John",
"age":30,
"cars":[ "Ford", "BMW", "Fiat" ]
}
Error:
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Rejecting mapping update to [cars] as the final mapping would have more than 1 type: [my_doc, log]"}],"type":"illegal_argument_exception","reason":"Rejecting mapping update to [cars] as the final mapping would have more than 1 type: [my_doc, log]"},"status":400}
any ideas how to do it correctly?
Important
Multiple mapping types are not supported in indices created in 6.0 – Always Sunny