diff --git a/server/src/main/java/org/elasticsearch/common/lucene/search/function/RandomScoreFunction.java b/server/src/main/java/org/elasticsearch/common/lucene/search/function/RandomScoreFunction.java index 8694b6fa019f1..b55730f514ac9 100644 --- a/server/src/main/java/org/elasticsearch/common/lucene/search/function/RandomScoreFunction.java +++ b/server/src/main/java/org/elasticsearch/common/lucene/search/function/RandomScoreFunction.java @@ -70,7 +70,7 @@ public LeafScoreFunction getLeafScoreFunction(LeafReaderContext ctx) { public double score(int docId, float subQueryScore) throws IOException { int hash; if (values == null) { - hash = BitMixer.mix(docId, saltedSeed); + hash = BitMixer.mix(ctx.docBase + docId, saltedSeed); } else if (values.advanceExact(docId)) { hash = StringHelper.murmurhash3_x86_32(values.nextValue(), saltedSeed); } else {