Skip to content

Instantly share code, notes, and snippets.

@razorcd
Created May 17, 2017 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save razorcd/31c9ccddc78dd2a2f30f9135cd1002b6 to your computer and use it in GitHub Desktop.
Save razorcd/31c9ccddc78dd2a2f30f9135cd1002b6 to your computer and use it in GitHub Desktop.
query based on a nested field
POST http://localhost:9200/devices/_search
{
"query": {
"bool": {
"must": [
{
"nested": {
"path": "contractAttributions",
"query": {
"bool": {
"must": [
{
"match": {
"contractAttributions.contractNumber": "1111"
}
}
]
}
}
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment