Count API with track_total_hits

While the search API has the track_total_hits optimization to approximate search hit count, I noticed the count API does not.

If I am only looking for the approximate hit count, is it more performant to use the search API with track_total_hits: 10000 and a size of 0, or use the count API and truncate the result in the client (i.e. convert anything over 10,000 to { value: 10000, relation: 'gte' }).

Alternatively, is there a way to get the count API to use the track_total_hits param, or a reason why it does not make that optimization available?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.