Last active
December 24, 2019 23:10
-
-
Save dorsev/134e53dd5af683804ea7e88f4e74a63b to your computer and use it in GitHub Desktop.
dynamic_template schema
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X PUT "localhost:9200/_template/my_template?pretty" -H 'Content-Type: application/json' -d ' | |
{ | |
"index_patterns": [ | |
"your-index-names*" | |
], | |
"mappings": { | |
"_doc": { | |
"dynamic_templates": [ | |
{ | |
"tags": { | |
"mapping": { | |
"type": "text" | |
}, | |
"path_match": "actions.tags.*" | |
} | |
} | |
] | |
} | |
}, | |
"aliases": {} | |
}' | |
curl -X PUT "localhost:9200/your-index-names-1/_doc/1?pretty" -H 'Content-Type: application/json' -d' | |
{ | |
"actions": { | |
"tags" : { | |
"name": "John", | |
"lname" : "Smith" | |
} | |
} | |
} | |
' | |
curl -X PUT "localhost:9200/your-index-names-1/_doc/2?pretty" -H 'Content-Type: application/json' -d' | |
{ | |
"actions": { | |
"tags" : { | |
"name": "Dor", | |
"lname" : "Sever" | |
} | |
} | |
} | |
' | |
curl -X PUT "localhost:9200/your-index-names-1/_doc/3?pretty" -H 'Content-Type: application/json' -d' | |
{ | |
"actions": { | |
"tags" : { | |
"name": "AnotherName", | |
"lname" : "AnotherLastName" | |
} | |
} | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment