Aggregation max additional info

Hi all,

I have a question if there is a possibility to add some extra fields somehow to the max aggregation result?

My document looks like this:

    "updated": {
      "type": "date"
    "scores": {
      "properties": {
        "score": {
          "properties": {
            "value": {
              "type": "long"
        "type": {
          "type": "keyword"
      "type": "nested"

I want to get max score "values" for each score "type", but I need also "updated" date for each "max" result and I don't know how to do this...

I'm using python elasticsearch-dsl library and I have the first part:


and this is working fine for the aggregation itself but I don't know how to extract "updated" for each max value document.

Appreciate any answer...

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.