When forging an aggregation query, we need to choose the fields to aggregate on. Currently, the list of proposed fields is limited to fields available in the index doc mapping. But, in the case of a dynamic mapping, this means that most of the fields can be missed. Instead of using the doc mapping to get the list of available fields, we should use the field capabilities endpoint of Quickwit when it will be added.
When forging an aggregation query, we need to choose the fields to aggregate on. Currently, the list of proposed fields is limited to fields available in the index doc mapping. But, in the case of a dynamic mapping, this means that most of the fields can be missed. Instead of using the doc mapping to get the list of available fields, we should use the field capabilities endpoint of Quickwit when it will be added.
Endpoint to use:
_elastic/{index-id}/_field_caps
Docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html