Last active
March 28, 2019 04:17
-
-
Save ipedrazas/3d2786874692e90db3ca to your computer and use it in GitHub Desktop.
EalsticSearch multiple aggregations example - Term count and Average
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
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