Skip to content

Instantly share code, notes, and snippets.

@ypasmk
Created January 16, 2015 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ypasmk/df441c24a7de0f8ceb69 to your computer and use it in GitHub Desktop.
Save ypasmk/df441c24a7de0f8ceb69 to your computer and use it in GitHub Desktop.
ElasticSearch dynamic_date_formats is not applied if there is a mapping created with the index
curl -XDELETE "http://localhost:9200/myindex"
curl -XPOST "http://localhost:9200/myindex/" -d '
{
"state": "open",
"mappings": {
"message": {
}
}
}'
curl -XPOST "http://localhost:9200/myindex/_mapping/message" -d '
{
"message": {
"dynamic_templates": [],
"dynamic_date_formats": [
"dd.MM.yyyy"
],
"properties": {
"myfield": {
"type": "string"
}
}
}
}'
curl -XDELETE "http://localhost:9200/myindex"
curl -XPOST "http://localhost:9200/myindex/"
curl -XPOST "http://localhost:9200/myindex/_mapping/message" -d '
{
"message": {
"dynamic_templates": [],
"dynamic_date_formats": [
"dd.MM.yyyy"
],
"properties": {
"myfield": {
"type": "string"
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment