Last active
February 27, 2018 19:39
-
-
Save ryantbrown/a8319d32b3820804ba6322e46815453a to your computer and use it in GitHub Desktop.
Elastic search nested aggregate with nested query
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 influencers/_search | |
{ | |
"size": 0, | |
"aggregations": { | |
"influencers": { | |
"nested": { | |
"path": "interests" | |
}, | |
"aggs": { | |
"names": { | |
"filter": { | |
"bool": { | |
"must": [ | |
{ | |
"match": { | |
"interests.name": "Travel destinations" | |
} | |
} | |
] | |
} | |
}, | |
"aggs": { | |
"max_score": { | |
"max": { | |
"field": "interests.score" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment