Describe the bug
When I enable ElasticPress in my WooCommerce store, the number of products listed are limited to 10000.
With the ElasticPress plugin disabled, I get the correct number of products from the category (313851).
I'm not sure if it's a problem from ElasticPress or maybe ElasticSearch?
Steps to Reproduce
Screenshots

Additional context
Tried tweaking search.max_buckets: 100000 or even 1000000 but with no success.
What could be the problem?
@roditi3811 you can increase the value of https://github.com/10up/ElasticPress/blob/7f5debeff99ea61c104d443f16b1ac61d0104bce/includes/classes/Indexable/Post/Post.php#L635 up to 1,000,000 (that's the index.max_result_window set by the plugin) and you'll get the updated total of results. It's just another default setting we build in to handle performance. You might check out the scroll API referenced in the code comment above that filter, but based on your previous ticket your Elasticsearch instance might just be large enough to handle the window change 馃槃
Thank for the reply, but it doesn't seem to change anything, I'm still getting 10000 results :(

Also I've tried
curl -XPUT "http://XXX:9200/XXX-post-1/_settings" -H 'Content-Type: application/json' -d '{ "index" : { "max_result_window" : 10000000 } }'
And the results of http://XXX:9200/XXX-post-1/_settings

I'm not sure if it means something, but the first time when I am accessing the category, I see the correct number of products.
If I make a search for a general term and I hit the 10000 limit, when I go back and access that category again, I see the limit of 10000 there also, as if it applies the search limit to the categories also.
What is your ElasticSearch version? From version 7.0 is track_total_hits set to 10000 by default: https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#track-total-hits-10000-default
You can force it like this:
add_filter( 'ep_formatted_args', function ( $formatted_args ) {
$formatted_args['track_total_hits'] = true;
return $formatted_args;
} );
add_filter( 'ep_formatted_args', function ( $formatted_args ) {
$formatted_args['track_total_hits'] = true;
return $formatted_args;
} );
PERFECT! That did the job indeed, thanks very much, works like a charm now.
Elasticsearch version is 7.5.2
Most helpful comment
What is your ElasticSearch version? From version 7.0 is
track_total_hitsset to 10000 by default: https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#track-total-hits-10000-defaultYou can force it like this: