Imagine that you are sorting your results by a timestamp
field, and
two documents have the same timestamp. Because search requests are
round-robined between all available shard copies, these two documents may be
returned in one order when the request is served by the primary, and in
another order when served by the replica.
This is known as the bouncing results problem: every time the user refreshes
the page, the results appear in a different order. The problem can be avoided by always using the same shards for the same user,
which can be done by setting the preference
parameter to an arbitrary string
like the user’s session ID.