Default Shard Search preference

I am wondering what is default search behavior in term of shard selection.

When a search execute will it either primary or replica shards or use few primary and few replica ?

Please explain.

Thanks!

Hi,

By default, this is randomized between primary and replica shards, but you can control this behaviour using the preference parameter: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-preference.html

Thanks Christoph,

"randomized between primary and replica shards" does not clear my question Whether it is combination primary and replica shards or randomized between any one of two (primary and replica).

By default, for each shard search can either hit primary or any of the replicas randomly.