{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-net/issues/3331","repository_url":"https://api.github.com/repos/elastic/elasticsearch-net","labels_url":"https://api.github.com/repos/elastic/elasticsearch-net/issues/3331/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-net/issues/3331/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-net/issues/3331/events","html_url":"https://github.com/elastic/elasticsearch-net/issues/3331","id":340960038,"node_id":"MDU6SXNzdWUzNDA5NjAwMzg=","number":3331,"title":"when use C#'s NestedAggregation, response.DebugInformation is correct, but the value is null of response.Aggregations.Nested.","user":{"login":"muzizongheng","id":3926514,"node_id":"MDQ6VXNlcjM5MjY1MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/3926514?v=4","gravatar_id":"","url":"https://api.github.com/users/muzizongheng","html_url":"https://github.com/muzizongheng","followers_url":"https://api.github.com/users/muzizongheng/followers","following_url":"https://api.github.com/users/muzizongheng/following{/other_user}","gists_url":"https://api.github.com/users/muzizongheng/gists{/gist_id}","starred_url":"https://api.github.com/users/muzizongheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muzizongheng/subscriptions","organizations_url":"https://api.github.com/users/muzizongheng/orgs","repos_url":"https://api.github.com/users/muzizongheng/repos","events_url":"https://api.github.com/users/muzizongheng/events{/privacy}","received_events_url":"https://api.github.com/users/muzizongheng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-13T10:06:58Z","updated_at":"2018-07-14T05:35:25Z","closed_at":null,"author_association":"NONE","body":"Elasticsearch version: 6.2.3\r\n\r\n- Problem  step description:\r\n\r\n- index's object json like:\r\n```\r\n{\r\n  \"_index\": \"metric_ctdms\",\r\n  \"_type\": \"ctdms\",\r\n  \"_id\": \"lO_-kmQB1uD8GkS4gI32\",\r\n  \"_version\": 1,\r\n  \"_score\": 2,\r\n  \"_source\": {\r\n    \"type\": \"CTMonitorPa5min\",\r\n    \"description\": \"CT monitor data\",\r\n    \"guid\": \"99dc0c12-bf9d-46df-ae41-a98d7ba92f3e\",\r\n    \"serialNumber\": \"300001\",\r\n    \"productNumber\": \"88000032\",\r\n    \"systemID\": \"101014010001 \",\r\n    \"sourceName\": \"\",\r\n    \"level\": \"0\",\r\n    \"priority\": \"1\",\r\n    \"operationDateTime\": \"2018-07-13T17:02:07.5639857+08:00\",\r\n    \"uID\": \"\",\r\n    \"attamentFilePath\": \"\",\r\n    \"attamentFileMD5\": \"\",\r\n    \"devLogFilePath\": \"\",\r\n    \"devLogFileMD5\": \"\",\r\n    \"item\": {\r\n      \"key\": [\r\n        {\r\n          \"name\": \"DetectorTempL\",\r\n          \"lowerThreshold\": 300435,\r\n          \"upperThreshold\": 680912.76,\r\n          \"unit\": \"摄氏度\",\r\n          \"value\": 42.32\r\n        },\r\n        {\r\n          \"name\": \"DetectorTempM\",\r\n          \"lowerThreshold\": 4432.12,\r\n          \"upperThreshold\": 431503.62,\r\n          \"unit\": \"摄氏度\",\r\n          \"value\": 38.2\r\n        }\r\n      ]\r\n    }\r\n  },\r\n  \"fields\": {\r\n    \"operationDateTime\": [\r\n      \"2018-07-13T09:02:07.563Z\"\r\n    ]\r\n  }\r\n}\r\n```\r\n- C# Nest client access code like this:\r\n```\r\n var client = GetClient();\r\n            var filterPath = new string[] { \"aggregations.*.*.buckets\" };\r\n\r\n            var request = new SearchRequest(indices)\r\n            {\r\n                Query = new MatchQuery() { Field = \"systemID\", Query = systemID }\r\n                    && new DateRangeQuery() { Field = \"operationDateTime\", LessThanOrEqualTo = \"now\", Format = \"yyyyMMdd\" },\r\n                Size = 1,\r\n                Sort = new List<ISort>\r\n                {\r\n                    new SortField {Field = \"operationDateTime\", Order = SortOrder.Descending}\r\n                },\r\n\r\n                Aggregations = new NestedAggregation(\"nested\")\r\n                {\r\n                    Path = \"item.key\",\r\n                    Aggregations = new TermsAggregation(\"terms\")\r\n                    {\r\n                        Field = \"item.key.name.keyword\",\r\n\r\n                        Aggregations = new AverageAggregation(\"avg\", \"item.key.value\")\r\n                    }\r\n                },\r\n\r\n                FilterPath = filterPath,\r\n\r\n            };\r\n\r\n            var response = await client.SearchAsync<CTDMS<CTDMSItem>>(request);\r\n\r\n            var agg = response.Aggregations.Nested(\"nested\").Terms(\"terms\");\r\n\r\n```\r\n\r\n- response DebugInformation like this:\r\n```\r\nValid NEST response built from a successful low level call on POST: /%2Adms%2A/_search?typed_keys=true&filter_path=aggregations.%2A.%2A.buckets\r\n# Audit trail of this API call:\r\n - [1] HealthyResponse: Node: http://localhost:9200/ Took: 00:00:02.0860412\r\n# Request:\r\n{\"size\":1,\"sort\":[{\"operationDateTime\":{\"order\":\"desc\"}}],\"query\":{\"bool\":{\"must\":[{\"match\":{\"systemID\":{\"query\":\"101092010010\"}}},{\"range\":{\"operationDateTime\":{\"lte\":\"now\",\"format\":\"yyyyMMdd\"}}}]}},\"aggs\":{\"nested\":{\"nested\":{\"path\":\"item.key\"},\"aggs\":{\"terms\":{\"terms\":{\"field\":\"item.key.name.keyword\"},\"aggs\":{\"avg\":{\"avg\":{\"field\":\"item.key.value\"}}}}}}}}\r\n# Response:\r\n{\"aggregations\":{\"nested#nested\":{\"sterms#terms\":{\"buckets\":[{\"key\":\"DetectorTempL\",\"doc_count\":19,\"avg#avg\":{\"value\":34.906860753109584}},{\"key\":\"DetectorTempM\",\"doc_count\":19,\"avg#avg\":{\"value\":35.17318605121813}},{\"key\":\"DetectorTempR\",\"doc_count\":19,\"avg#avg\":{\"value\":35.05932958502518}},{\"key\":\"RackENVTemp\",\"doc_count\":19,\"avg#avg\":{\"value\":24.34830103422466}}]}}}}\r\n```\r\n\r\n- Problem result description:\r\n\r\n**the value of response's NestedAggration is null**\r\n\r\nI donot know what happened, do anyone give me some hint? \r\nthanks."},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch-net/issues/comments/405000434","html_url":"https://github.com/elastic/elasticsearch-net/issues/3331#issuecomment-405000434","issue_url":"https://api.github.com/repos/elastic/elasticsearch-net/issues/3331","id":405000434,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTAwMDQzNA==","user":{"login":"muzizongheng","id":3926514,"node_id":"MDQ6VXNlcjM5MjY1MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/3926514?v=4","gravatar_id":"","url":"https://api.github.com/users/muzizongheng","html_url":"https://github.com/muzizongheng","followers_url":"https://api.github.com/users/muzizongheng/followers","following_url":"https://api.github.com/users/muzizongheng/following{/other_user}","gists_url":"https://api.github.com/users/muzizongheng/gists{/gist_id}","starred_url":"https://api.github.com/users/muzizongheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muzizongheng/subscriptions","organizations_url":"https://api.github.com/users/muzizongheng/orgs","repos_url":"https://api.github.com/users/muzizongheng/repos","events_url":"https://api.github.com/users/muzizongheng/events{/privacy}","received_events_url":"https://api.github.com/users/muzizongheng/received_events","type":"User","site_admin":false},"created_at":"2018-07-14T05:35:25Z","updated_at":"2018-07-14T05:35:25Z","author_association":"NONE","body":"solution:\r\n`              //  FilterPath = filterPath,`\r\n\r\n"}}
{"actor":{"display_login":"muzizongheng"}}