Algolia's Python Api : How to get 'exhaustiveFacetsCount:True' for a specific facet

I am trying to get the exaustive facet count for the facet ‘category’ by
using query “index.search(”", {“facets”: “*”, “maxValuesPerFacet”: 1000})".
But all the time this query give ‘exhaustiveFacetsCount’ as ‘False’ and there is too much differece between expected and recieved values.

It seems, engine does not always return the exact amount of facets, depending on timeout. It is highly required for me to have exhaustiveFacetsCount:True.
**Is there any thing that can make it possible ?**

Hi there,

Thanks of reaching out!

As you noticed, depending on if and when the timeout is reached, the number of results can vary greatly.
In order to improve the likelihood of an exhaustive facet count, the best is to reduce the computational need of the query.

To do so, you may want to start by restricting the faceting to only some of your attributes depending on your need (by settings facets to something else than *). I am not aware of all the settings you are using for the query, but distinct is another costly feature.

Regards,