Reputation: 355
I have problem with the uploading of index in Elasticsearch.
curl -H "Content-Type: application/json" -XPUT http://localhost:9200/technogym_error_timeline -d "{\"mappings\":{\"timestamp\":{\"type\":\"date\",\"format\":\"yyyy-MM-dd\"}}}"
I get this error:
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [format : yyyy-MM-dd] [type : date]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [timestamp]: Root mapping definition has unsupported parameters: [format : yyyy-MM-dd] [type : date]","caused_by":{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [format : yyyy-MM-dd] [type : date]"}},"status":400}
Why is my curl command wrong?
Thanks.
Upvotes: 0
Views: 568
Reputation: 217554
You're missing the type declaration:
curl -H "Content-Type: application/json" -XPUT http://localhost:9200/technogym_error_timeline -d '{
"mappings":{
"your_type_name": { <--- add this
"properties": { <--- and this
"timestamp":{
"type":"date",
"format":"yyyy-MM-dd"
}
}
}
}
}'
Upvotes: 1