Elasticsearch reduce latency with allow_partial_search_results

I have an index with 60 shards. I am trying to get total counts which match my Elasticsearch query. I am using the "allow_partial_search_results" query param to get total results. Without this query param, some of the shards fail and return incomplete results.

But with this approach, my p99 latency gets increased significantly. Is there any way I can optimize this?

Thank you for the help and your time. :slight_smile:

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