{"action":"opened","issue":{"url":"https://api.github.com/repos/sksamuel/elastic4s/issues/582","repository_url":"https://api.github.com/repos/sksamuel/elastic4s","labels_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/582/labels{/name}","comments_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/582/comments","events_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/582/events","html_url":"https://github.com/sksamuel/elastic4s/issues/582","id":160211897,"number":582,"title":"Can't use Pipeline Aggregation","user":{"login":"romainfage","id":8037612,"avatar_url":"https://avatars.githubusercontent.com/u/8037612?v=3","gravatar_id":"","url":"https://api.github.com/users/romainfage","html_url":"https://github.com/romainfage","followers_url":"https://api.github.com/users/romainfage/followers","following_url":"https://api.github.com/users/romainfage/following{/other_user}","gists_url":"https://api.github.com/users/romainfage/gists{/gist_id}","starred_url":"https://api.github.com/users/romainfage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainfage/subscriptions","organizations_url":"https://api.github.com/users/romainfage/orgs","repos_url":"https://api.github.com/users/romainfage/repos","events_url":"https://api.github.com/users/romainfage/events{/privacy}","received_events_url":"https://api.github.com/users/romainfage/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-14T15:30:02Z","updated_at":"2016-06-14T15:30:02Z","closed_at":null,"body":"Hi,\r\n\r\nI want to use some Pipeline Aggregation, but I’m encountering an issue.\r\n\r\nFor example, I want to do this: \r\n\r\n```json\r\n{\r\n    \"aggs\": {\r\n        \"foo1\": {\r\n            \"terms\": {\r\n                \"field\": \"field1\",\r\n                \"order\": {\r\n                    \"_term\": \"asc\"\r\n                },\r\n                \"size\": 1\r\n            },\r\n            \"aggs\": {\r\n                \"foo2\": {\r\n                    \"avg\": {\r\n                        \"field\": \"field2\"\r\n                    }\r\n                }\r\n            }\r\n        },\r\n        \"foo3\": {\r\n            \"avg_bucket\": {\r\n                \"buckets_path\": \"foo1>foo2\"\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\nwith this implementation\r\n\r\n```scala\r\naggs (\r\n  termAggregation(\"foo1\") field \"field1\" size 1 aggs {\r\n                  avgAggregation(\"foo2\") field \"field2\"\r\n  },\r\n  avgBucketAggregation(\"foo3\") bucketPaths Seq(\"foo1\", \"foo2\")\r\n)\r\n```\r\n\r\n but it didn’t compile :\r\n\r\n```bash\r\nType mismatch, found: AvgBucketDefinition, required: AbstractAggregationDefinition.\r\n```\r\n\r\nI looked into the source files and indeed `AvgBucketDefinition` extends `PipelineDefinition` which extends nothing.\r\n\r\nDo I do something wrong with my implementation? Shouldn't `PipelineDefinition` extend `AbstractAggregationDefinition`, so that they can be used in an `aggs(…)` block as any other aggregation?\r\n\r\nThanks a lot"}}
{"actor":{"display_login":"romainfage"}}