Skip to content

Instantly share code, notes, and snippets.

@serj-p
Created December 18, 2013 15:55
Show Gist options
  • Save serj-p/8024737 to your computer and use it in GitHub Desktop.
Save serj-p/8024737 to your computer and use it in GitHub Desktop.
complexity of multifield mapping
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