Created
April 30, 2020 21:06
-
-
Save relwell/f4ac915aa0fd52515be896a03e4e8b0b to your computer and use it in GitHub Desktop.
nested aggregation filter?
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": { | |
"wiki_page_edits": { | |
"nested": { | |
"path": "wiki_page_edits" | |
}, | |
"aggs": { | |
"wiki_page_edits.email": { | |
"filter": { | |
"bool": { | |
"must": [ | |
{ | |
"bool": { | |
"must": [ | |
{ | |
"bool": { | |
"filter": [ | |
{ | |
"bool": { | |
"should": [ | |
{ | |
"bool": { | |
"filter": [ | |
{ | |
"term": { | |
"overall_status": { | |
"value": "Completed" | |
} | |
} | |
} | |
] | |
} | |
} | |
] | |
} | |
} | |
] | |
} | |
}, | |
{ | |
"bool": { | |
"filter": [ | |
] | |
} | |
} | |
] | |
} | |
} | |
] | |
} | |
}, | |
"aggs": { | |
"wiki_page_edits.email": { | |
"terms": { | |
"field": "wiki_page_edits.email", | |
"size": 1000000, | |
"order": { | |
"_term": "asc" | |
}, | |
"missing": "-99999999999" | |
}, | |
"aggs": { | |
"agg_bucket_sort": { | |
"bucket_sort": { | |
"from": 0, | |
"size": 25, | |
"sort": [ | |
{ | |
"_key": { | |
"order": "asc" | |
} | |
} | |
] | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"query_string": { | |
"query": "*" | |
} | |
} | |
], | |
"filter": [ | |
{ | |
"bool": { | |
"must": [ | |
{ | |
"bool": { | |
"filter": [ | |
{ | |
"bool": { | |
"should": [ | |
{ | |
"bool": { | |
"filter": [ | |
{ | |
"term": { | |
"overall_status": { | |
"value": "Completed" | |
} | |
} | |
} | |
] | |
} | |
} | |
] | |
} | |
} | |
] | |
} | |
}, | |
{ | |
"bool": { | |
"filter": [ | |
] | |
} | |
} | |
] | |
} | |
} | |
] | |
} | |
}, | |
"sort": [ | |
{ | |
"nct_id": "asc" | |
} | |
], | |
"timeout": "11s", | |
"size": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to filter the
wiki_page_edits.email
aggregation byoverall_status:Completed
, but I keep getting no matches back. I know for a fact there are pages that satisfy that search. For example, the result of this query by ID: