Last active
March 13, 2018 21:10
-
-
Save sebastialonso/b8958417d62fa94b24d215fdcae1a72c to your computer and use it in GitHub Desktop.
Aggregation in Elastic
This file contains hidden or 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
curl -X POST -H 'Content-Type: application/json' http://localhost:9200/data-obj/data-obj/_search?size=0&pretty -d ' | |
{ | |
"aggs": { | |
"range_agg": { | |
"range": { | |
"field": "age", | |
"ranges": [ | |
{"to": 20}, | |
{"from": 20, "to": 25}, | |
{"from": 25, "to": 30}, | |
{"from": 30} | |
] | |
}, | |
"aggs": { | |
"job": { | |
"terms": {"field": "job"}, | |
"aggs": { | |
"damage": { | |
"terms": {"field": "damage"}, | |
"aggs": { | |
"iv": { | |
"avg": {"field": "iv"} | |
}, | |
"blood": { | |
"avg": {"field": "blood"} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment