Created
November 21, 2018 12:35
-
-
Save fabiante/d59e877a15a7e6fb054c9c524742d6da to your computer and use it in GitHub Desktop.
Elasticsearch - Dynamic Template for Java util.Map fields
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
PUT /archive_document | |
{ | |
"mappings": { | |
"document": { | |
"dynamic_templates": [ | |
{ | |
"map_string": { | |
"match_mapping_type": "string", | |
"path_match": "fields.*", | |
"mapping": { | |
"type": "text" | |
} | |
} | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This template is just a starter and needs lots of adjustments for your needs. For now the template matches only strings.
The idea is to create a template that maps Java's util.Map instances as plain JSON objects. Every map entry should be indexed.