Is your feature request related to a problem?
In one of my environments, I encountered an issue where an ISM index containing small documents and using custom routing reached the limit of allowed documents in one of its shards before its age and size based limits.
What solution would you like?
Allowing to make rollover/transition conditions based on the number of docs in a shard (similarly to the min_primary_shard_size compared to min_size). Maybe named min_primary_shard_doc_count for consistency.
What alternatives have you considered?
Using a simple min_doc_count works but is not optimal for indices with multiple shards and documents evenly balanced between them.
Do you have any additional context?
I'm currently working on an implementation that I'm willing to submit if this feature makes sense for you.