Created
April 15, 2016 17:44
-
-
Save honzakral/aa03d4d8270552b4053d671fc6ccd7e1 to your computer and use it in GitHub Desktop.
Dynamic template mappings in python DSL
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
from elasticsearch_dsl import DocType, Object, MetaField | |
class MyDoc(DocType): | |
inner = Object() | |
class Meta: | |
dynamic_templates = MetaField([ | |
{ | |
'strings_in_inner': { | |
'path_match': 'inner.*', | |
'match_mapping_type': 'string', | |
'mapping': {'type': 'string', 'index': 'not_analyzed'} | |
} | |
} | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment