Skip to content

Instantly share code, notes, and snippets.

@ipedrazas
Last active March 28, 2019 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ipedrazas/3d2786874692e90db3ca to your computer and use it in GitHub Desktop.
Save ipedrazas/3d2786874692e90db3ca to your computer and use it in GitHub Desktop.
EalsticSearch multiple aggregations example - Term count and Average
GET _search
{
"query" : {
"match" : { "PostCode" : "PO18*"}
},
"aggs" : {
"Food_hygiene_ratings" : {
"terms" : {
"field" : "RatingValue"
}
},
"avg_height" : {
"avg" : {
"field" : "RatingValue" }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment