Description
It seems the client is not parsing/returning sub aggregations that appear under filter aggregation. Here is a sample query and response.
Request:
{ "_source": { "excludes": [ "attachmentContents.*" ], "includes": [ "*" ] }, "aggregations": { "count": { "value_count": { "field": "messageStorageId.messageId" } }, "login_filter": { "aggregations": { "date": { "terms": { "field": "year", "order": [ { "_key": "desc" } ] } }, "to_domain": { "terms": { "exclude": [ "unknown" ], "field": "to.domain" } }, "file_ext": { "terms": { "exclude": [ "" ], "field": "attachments.fileExt" } }, "has_att": { "terms": { "field": "hasAttachments" } }, "from": { "terms": { "exclude": [ "unknown" ], "field": "sender.name" } }, "from_domain": { "terms": { "exclude": [ "unknown" ], "field": "sender.domain" } }, "to": { "terms": { "exclude": [ "unknown" ], "field": "to.name" } } }, "filter": { "bool": { "must": [ { "bool": { "minimum_should_match": "1" } } ] } } } }, "from": 0, "highlight": { "fields": { "body": { "fragment_size": 0, "number_of_fragments": 0 }, "attachments.fileName": { "fragment_size": 0, "number_of_fragments": 0 }, "attachmentContents.*": { "fragment_size": 200, "number_of_fragments": 2 }, "subject": { "fragment_size": 0, "number_of_fragments": 0 } }, "post_tags": [ "</span>" ], "pre_tags": [ "<span class=\"blue-hilite\">" ] }, "query": { "bool": { "must": [ { "bool": { "must": [ { "query_string": { "default_operator": "and", "query": "Tsang" } } ] } }, { "bool": { "minimum_should_match": "1", "should": [ { "match_all": {} } ] } } ] } }, "size": 10, "sort": [ { "messageDate": { "order": "asc" } } ], "stored_fields": [ "_source" ] }
Response:
{ "took": 190, "timed_out": false, "_shards": { "total": 1, "successful": 1, "skipped": 0, "failed": 0 }, "hits": { "total": { "value": 1, "relation": "eq" }, "max_score": null, "hits": [] }, "aggregations": { "count": { "value": 1 }, "login_filter": { "meta": { }, "doc_count": 1, "to_domain": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "cnn.com", "doc_count": 1 } ] }, "date": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "2008", "doc_count": 1 } ] }, "has_att": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": 1, "key_as_string": "true", "doc_count": 1 } ] }, "file_ext": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "doc", "doc_count": 1 } ] }, "from_domain": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "gmail.com", "doc_count": 1 } ] }, "from": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "John Tsang", "doc_count": 1 } ] }, "to": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "John Smith", "doc_count": 1 } ] } } } }
Specifically, sub aggregations above under "login_filter" section are not visible in the java client: