mirror of https://github.com/apache/lucene.git
Avoid reset BlockDocsEnum#freqBuffer when indexHasFreq is false (#12997)
This commit is contained in:
parent
4b1180372e
commit
75e1a0b96c
|
@ -199,6 +199,8 @@ Optimizations
|
||||||
|
|
||||||
* GITHUB#12841: Move group-varint encoding/decoding logic to DataOutput/DataInput. (Adrien Grand, Zhang Chao, Uwe Schindler)
|
* GITHUB#12841: Move group-varint encoding/decoding logic to DataOutput/DataInput. (Adrien Grand, Zhang Chao, Uwe Schindler)
|
||||||
|
|
||||||
|
* GITHUB#:12997 Avoid reset BlockDocsEnum#freqBuffer when indexHasFreq is false. (Zhang Chao, Adrien Grand)
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
---------------------
|
---------------------
|
||||||
* GITHUB#12866: Prevent extra similarity computation for single-level HNSW graphs. (Kaival Parikh)
|
* GITHUB#12866: Prevent extra similarity computation for single-level HNSW graphs. (Kaival Parikh)
|
||||||
|
|
|
@ -400,9 +400,9 @@ public final class Lucene99PostingsReader extends PostingsReaderBase {
|
||||||
this.needsFreq = PostingsEnum.featureRequested(flags, PostingsEnum.FREQS);
|
this.needsFreq = PostingsEnum.featureRequested(flags, PostingsEnum.FREQS);
|
||||||
this.isFreqsRead = true;
|
this.isFreqsRead = true;
|
||||||
if (indexHasFreq == false || needsFreq == false) {
|
if (indexHasFreq == false || needsFreq == false) {
|
||||||
for (int i = 0; i < ForUtil.BLOCK_SIZE; ++i) {
|
// Filling this buffer may not be cheap when doing primary key lookups, so we make sure to
|
||||||
freqBuffer[i] = 1;
|
// not fill more than `docFreq` entries.
|
||||||
}
|
Arrays.fill(freqBuffer, 0, Math.min(ForUtil.BLOCK_SIZE, docFreq), 1);
|
||||||
}
|
}
|
||||||
accum = 0;
|
accum = 0;
|
||||||
blockUpto = 0;
|
blockUpto = 0;
|
||||||
|
|
Loading…
Reference in New Issue