Created
December 18, 2013 15:55
-
-
Save serj-p/8024737 to your computer and use it in GitHub Desktop.
complexity of multifield mapping
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
def F_DEFAULT_MULTIFIELD_MAPPING_IN_ALL(f_name): | |
return { | |
"fields": { | |
f_name: ANALYZED_FIELD_MAPPING_IN_ALL, | |
'na': NA_MAPPING | |
}, | |
"type": "multi_field", | |
"include_in_all": True | |
} | |
ADDRESS_MAPPING = { | |
"type": "object", | |
"dynamic": False, | |
"properties": { | |
"street": F_DEFAULT_MULTIFIELD_MAPPING_IN_ALL('street') | |
} | |
} | |
#This could be done easier | |
DEFAULT_MULTIFIELD_MAPPING_IN_ALL = { | |
"fields": { | |
'_default': ANALYZED_FIELD_MAPPING_IN_ALL, | |
'na': NA_MAPPING | |
}, | |
"type": "multi_field", | |
"include_in_all": True | |
} | |
ADDRESS_MAPPING = { | |
"type": "object", | |
"dynamic": False, | |
"properties": { | |
"street": DEFAULT_MULTIFIELD_MAPPING_IN_ALL | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment