Skip to content

(Doc+) Add typed_keys parameter set as true #8605

New issue

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/usage/aggregations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@

This page demonstrates how to use aggregations.

[discrete]
=== Using Aggregations with Search Templates

[IMPORTANT]
.A Note on `typed_keys` and `SearchTemplateAsync`
====
When using aggregations with the `SearchTemplateAsync` API, it is **mandatory** to include the `typed_keys: true` parameter in your request.

Unlike the `SearchAsync` API, which adds the `typed_keys=true` parameter to requests automatically, the `SearchTemplateAsync` API cannot do so due to the flexible nature of search templates.

If this parameter is omitted, the client's deserializer will fail with a `JsonException` as it cannot determine the aggregation types from the response.
====

To correctly receive aggregations from a search template, you must explicitly include `typed_keys: true` in the parameters you provide to the `SearchTemplateAsync` call.


[discrete]
=== Top-level aggreggation

Expand Down
Loading