Description
action.search.shard_count.limit
was initially introduced as a soft limit that prevented queries to hit too many shards. In 6.x we introduced the can_match
phase that pre-filters non-matching shards and we decided to set this soft limit to unlimited by default.
Unfortunately this broke some users who were relying on this setting as a way to prevent their users from killing their clusters, e.g. by sending requests that don't have a time range.
I'd suggest to keep the default value of action.search.shard_count.limit
to unlimited, but change the semantics of this setting to apply to the number of shards after the can_match
request so that they could still protect their clusters against users who run queries without a time range.
Related discussion #35917