Is the data in different shared gets varied in search?

(lalitha.r) #1

In case if i had two documents with same field value across two shared is it differ for same search criteria. For example if i had two msgs

  1. Hi
  2. Hi

If i search

POST /test/test/_search
"query": {
"match_phrase_prefix": {
"msg": "hi"

Is there any possibility to get results varied?

(Mark Walkom) #2

Possibly yes, because the score of a document is relative to the other documents in the same shard.

(lalitha.r) #3

Thanks for your response. Is there any way to avoid it?

(Mark Walkom) #4

Have lots of documents, a single shard, or use routing.

(system) #5