elastic / elasticsearch-java

Official Elasticsearch Java Client
Apache License 2.0
408 stars 237 forks source link

The DateHistogramAggregation fails when adding the field 'name' #766

Closed frank-montyne closed 5 months ago

frank-montyne commented 5 months ago

Java API client version

8.12.2

Java version

21

Elasticsearch Version

8.12.2

Problem description

On the DateHistogramAggregation.Builder it is possible to add a name using builder.name("xyz"). when doing that the aggregation fails saying that the content is invalid. If the name is not set the aggregation works. It seems to me that there is no need for that field anyway since the name of the aggregation is the key in the map Map<String, Aggregation>

l-trotta commented 5 months ago

Hello, thank you for reporting this! You are correct, the name parameter should not be part of the DateHistogramAggregation builder (or other sub aggregation builders), it's likely an issue with the API specification used to produce the Java code. Once fixed the Java client code will be updated to solve this. Thanks again!

l-trotta commented 5 months ago

also see #466