track_total_hits should be Union of boolean and integer #43954
Labels
:Search/Search
Search-related issues that do not fall into other categories
Team:Search
Meta label for search team
Issue
The search.json REST API spec in 7.x defines
track_total_hits
as aboolean
elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/api/search.json
Lines 162 to 165 in c593085
The documentation indicates however that
track_total_hits
can be aboolean
or aninteger
i.e. a discriminated union of two different types.Since Elasticsearch clients generate code from the REST API specs,
track_total_hits
will be modelled as aboolean
only. For examplein elasticsearch-js
https://github.com/elastic/elasticsearch-js/blob/21863965706e0ebfcbe34e0436bf3359579dc834/api/requestParams.d.ts#L1123
in elasticsearch-net
https://github.com/elastic/elasticsearch-net/blob/69cf48c400bfc774ed16aeb502abd13565d72f3c/src/Nest/Requests.NoNamespace.cs#L2812-L2817
Request
track_total_hits
should be modelled as a union ofboolean
andint
. For example,I propose making this change for 8.x. It would not be feasible to make this change in 7.x because it would break (binary) compatibility of already released, generated client code.
The text was updated successfully, but these errors were encountered: