Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GET /employees/_search
- {
- "size" : 0,
- "aggs": {
- "locations": {
- "terms": {
- "field": "location"
- },
- "aggs": {
- "sex": {
- "terms": {
- "field": "sex"
- },
- "aggs": {
- "age_ranges": {
- "field": "age",
- "ranges" : [
- { "to" : 20 },
- { "from" : 20, "to" : 40 },
- { "from" : 40 }
- ],
- "aggs": {
- "avg_salary": {
- "avg": {
- "field": "salary"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement