We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
I was using the TypedClient to perform a search with multiple aggregations and I was not getting the result I expected.
Request:
GET /_search?typed_keys=true { "aggs": { "genres": { "terms": { "field": "genre" }, "aggs": { "max_play_count": { "max": { "field": "play_count" } } } } } }
Response :
{ ... "aggregations": { "terms#genres": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "electronic", "doc_count": 6, "max#max_play_count": { "value": 40 } }, { "key": "rock", "doc_count": 3, "max#max_play_count": { "value": 20 } }, { "key": "jazz", "doc_count": 2, "max#max_play_count": { "value": 10 } } ] } } }
But as in the (s *StringTermsBucket) UnmarshalJSON function, the code is expecting an "aggregations" field, it won't be able to parse the reponse correctly.
(s *StringTermsBucket) UnmarshalJSON
"aggregations"
As @Anaethelion pointed out, it should have something to do with the TypedClient's builder and the implementation of AdditionalProperties
AdditionalProperties
I think that it concerns the class SingleBucketAggregateBase and MultiBucketBase as they both implements
SingleBucketAggregateBase
MultiBucketBase
implements AdditionalProperties<AggregateName, Aggregate>
But unfortunately, I didn't find the builder for the TypedClient so I can't help you to resolve this issue 😕
Thanks, Ludo
The text was updated successfully, but these errors were encountered:
This could be closed with the release of 8.7.1
Sorry, something went wrong.
Thanks for noticing, this should have been closed automatically.
Closing now!
No branches or pull requests
Hello,
I was using the TypedClient to perform a search with multiple aggregations and I was not getting the result I expected.
Example:
Request:
Response :
But as in the
(s *StringTermsBucket) UnmarshalJSON
function, the code is expecting an"aggregations"
field, it won't be able to parse the reponse correctly.As @Anaethelion pointed out, it should have something to do with the TypedClient's builder and the implementation of
AdditionalProperties
I think that it concerns the class
SingleBucketAggregateBase
andMultiBucketBase
as they both implementsBut unfortunately, I didn't find the builder for the TypedClient so I can't help you to resolve this issue 😕
Thanks,
Ludo
The text was updated successfully, but these errors were encountered: