Is there a limit for number of routing values

The index contains one routing field and has 50 shards. I use the routing field in search requests. I do, however, wonder if there would be a performance problem if I sent 1000 routing values in a single query.

Should I send separate (parallel) search queries for each routing value, or should I use all routing variables in the same query?

The routing value is just used to direct queries and indexing to the correct shard. If you are querying a lot of routing values it is likely that you will hit most shards so you may just as well not submit routing values at all at that point and just query all shards. A simple rule may be to use routing values if you have less than e.g. 10 (would hit up to 20% of the 50 shards), and not use routing at all above that. The more routing values you submit, the less benefit you get from it.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.