Last active
April 30, 2022 19:15
-
-
Save NathBabs/5c6c5d7e4b881dc2a6db4c5f0234a47d to your computer and use it in GitHub Desktop.
ElasticSearch Sum and Terms combination
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
"aggs": { | |
"bank_card_metrics": { | |
"terms": { | |
"field": "cardBank.keyword" | |
}, | |
"aggs": { | |
"cards": { | |
"terms": { | |
"field": "cardType.keyword" | |
}, | |
"aggs": { | |
"volume": { | |
"terms": { | |
"field": "transactionStatus.keyword" | |
}, | |
"aggs": { | |
"totalValue": { | |
"sum": { | |
"field": "amount" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment