Incorrect number of displayed indexed products count for ES. The system cannot display more than 10,000

When you use Elastic Search provider, you can see an Incorrect number of displayed indexed products count for ES. The system cannot display more than 10,000.

The reason of the problem, the default implementation use Search request to find the count of the elements.

But the maximum value of for searches to this index is limited by index.max_result_window with defaults to 10000.

One possible solution is to increase the value max_result_window

curl -XPUT "http://localhost:9200/my_index/_settings" -H 'Content-Type: application/json' -d '{ "index" : { "max_result_window" : 500000 } }'