Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sub aggregation of metric aggregation #10059

Closed
zijian1981 opened this issue Mar 11, 2015 · 5 comments
Closed

sub aggregation of metric aggregation #10059

zijian1981 opened this issue Mar 11, 2015 · 5 comments

Comments

@zijian1981
Copy link

Is it possible to support sub aggregation of metric aggregation ?
For example ,term agg→mean agg →max agg

@zijian1981 zijian1981 changed the title subaggregation subaggregation of Mar 11, 2015
@zijian1981 zijian1981 changed the title subaggregation of subaggregation of metric Mar 11, 2015
@zijian1981 zijian1981 changed the title subaggregation of metric sub aggregation of metric aggregation Mar 11, 2015
@colings86
Copy link
Contributor

What would you expect the output of this to be? if you want to calculate the mean and max of a field for each terms bucket you can do the following:

{
  "aggs": {
    "terms_agg": {
      "terms": {
        "field": "category",
        "size": 10
      },
      "aggs": {
        "mean_agg": {
          "avg": {
            "field": "value"
          }
        },
        "max_agg": {
          "max": {
            "field": "value"
          }
        }
      }
    }
  }
}

Does this fit what you wanted to do?

@zijian1981
Copy link
Author

No,i want to calculate the max value from all the mean value

@markwalkom
Copy link
Contributor

You cannot do this at this stage. Once you get an aggregation result you can only sub-aggregate that, not do a different aggregation across those results.

@colings86
Copy link
Contributor

@zijian1981 there is an issue open for this kind of thing (#10000) which is being considered as part of #9876

@colings86
Copy link
Contributor

Closing in favour of #10000 and #9876

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants