You can use this library to determine the appropriate routing keys for specific shards, and then use those routing keys when indexing documents: https://www.npmjs.com/package/elastic-shard-router