Last active
May 16, 2017 06:43
-
-
Save semyont/4d4f8d085a104d28eb996d0c1d67a1ca to your computer and use it in GitHub Desktop.
elasticsearch collect mode for nested aggregation when top hit size is bigger then fields. then inner aggregations returns unneeded fields to the upper aggregation layer, combining filtering/ match with this will reduce variance in fields
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
# use un-analyzed fields | |
{ | |
"aggs" : { | |
"domain" : { | |
"terms" : { | |
"field" : "doc.domain.keyword", | |
"size" : 4, | |
"collect_mode" : "breadth_first" | |
}, | |
"aggs" : { | |
"ads" : { | |
"terms" : { | |
"field" : "doc.ads.keyword", | |
"size" : 100 | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment