Skip to content

Instantly share code, notes, and snippets.

@dmregister
Created June 11, 2015 19:29
Show Gist options
  • Save dmregister/bc33adad4aaf34384e10 to your computer and use it in GitHub Desktop.
Save dmregister/bc33adad4aaf34384e10 to your computer and use it in GitHub Desktop.
es mapping
{
"settings": {
"number_of_shards": 5,
"number_of_replicas": 0
},
"mappings": {
"user": {
"dynamic": "strict",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"socialAccounts": {
"type": "nested",
"dynamic": false,
"properties": {
"provider": {
"type": "string"
}
}
}
}
}
}
}
@skhanker
Copy link

you can remove "dynamic": false under socialAccounts. the entire "user" mapping will not allow dynamic fields, as this is set before defining the properties within the mapping (and their respective nested properties, if any)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment