Skip to content

Return the aggregation type in the response #5867

@Mpdreamz

Description

@Mpdreamz

Right now aggregations responses are hard to differentiate if you do not know how they were originally constructed.

In the .NET client I manage just about to peace back together the type of the aggregations by doing some simple property inspection.

For now this works even with the newly added 1.1 aggregations but I fear this approach won't scale in the long run.

If I could specify a agg_type_hint flag on the search requests so aggregations are returned like this:

"aggregations": {
  "myagg": {
     "_type": "nested",
     "doc_count": 2
  }
}

I could parse the aggregations to a typed response a lot easier without having the hold a ref to original search request object.

Note: I'm working on a PR for this

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions