Aggregation Response

I recently migrated to Elasticsearch 7.0 and currently using RestHighLevelClient. I noticed my search response, specifically the aggregation response has some added prefixes on the aggregation name (filters#. sterm, min, max.

This is an example:

  "aggregations":{
    "filters#aggregation_ids_custom":{
      "buckets":{
        "_none_":{
          "doc_count":0
        }
      }
    },
    "sterms#aggregation_ids":{
      "doc_count_error_upper_bound":0,
      "sum_other_doc_count":0,
      "buckets":[

      ]
    }
  }

Is there something that I need to se in the SearchRequest or RestHighLevelClient class?

Elasticsearch 7.0 is EOL and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

The additional filters or sterms are the type of aggregation results, that depend on the type of aggregation defined in the request.

By default Elasticsearch will just return the aggregation name. However RestHighLevelClient needs to know the result type to deserialize it and adds the typed_keys=true parameter to search requests to this effect.

So you don't have anything to do as RestHighLevelClient automatically adds this request parameter.

See Aggregations | Elasticsearch Guide [7.17] | Elastic

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