Use the global doc id to generate a random score (#33599)
This commit changes the random_score function to use the global docID of the document rather than the segment docID to generate random scores. As a result documents that have the same segment docID within the shard will generate different scores.
This commit is contained in:
parent
c4261bab44
commit
61e1df0274
|
@ -70,7 +70,7 @@ public class RandomScoreFunction extends ScoreFunction {
|
|||
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 {
|
||||
|
|
Loading…
Reference in New Issue