We have an Elasticsearch index where each document represents an employee, and each employee has an account_id
field identifying the account they belong to. Our index uses 18 shards, and we’ve implemented custom routing based on the account_id
, so all employees belonging to the same account are stored within the same shard.
We’re considering using the index sorting feature (index.sort.field
), specifically sorting by account_id
, and would like some advice:
Would enabling index sorting by account_id
help improve the performance of search requests to our index?
What are the potential benefits or drawbacks of sorting documents within each segment by account_id
in a setup like ours, where routing already ensures account-based data locality? Are there specific query patterns or search scenarios where this would make a meaningful difference in performance?
Any best practices about combining custom routing with index sorting would be very helpful.