Skip to content
2 changes: 2 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ Bug Fixes
* GITHUB#14523, GITHUB#14530: Correct TermOrdValComparator competitive iterator so that it forces sparse
field iteration to be at least scoring window baseline when doing intoBitSet. (Ben Trent, Adrien Grand)

* GITHUB#14445: Provide better impacts for fields indexed with IndexOptions.DOCS GITHUB#14511 (Aniketh Jain)

* GITHUB#14543: Fixed lead cost computations for bulk scorers of conjunctive
queries that mix MUST and FILTER clauses, and disjunctive queries that
configure a minimum number of matching SHOULD clauses.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ public final class Lucene101PostingsReader extends PostingsReaderBase {
private static final List<Impact> DUMMY_IMPACTS =
Collections.singletonList(new Impact(Integer.MAX_VALUE, 1L));

// We stopped storing a placeholder impact with freq=1 for fields with DOCS after 9.12.0
private static final List<Impact> DUMMY_IMPACTS_NO_FREQS =
Collections.singletonList(new Impact(1, 1L));

private final IndexInput docIn;
private final IndexInput posIn;
private final IndexInput payIn;
Expand Down Expand Up @@ -1325,13 +1329,14 @@ public int getDocIdUpTo(int level) {

@Override
public List<Impact> getImpacts(int level) {
if (indexHasFreq) {
if (level == 0 && level0LastDocID != NO_MORE_DOCS) {
return readImpacts(level0SerializedImpacts, level0Impacts);
}
if (level == 1) {
return readImpacts(level1SerializedImpacts, level1Impacts);
}
if (indexHasFreq == false) {
return DUMMY_IMPACTS_NO_FREQS;
}
if (level == 0 && level0LastDocID != NO_MORE_DOCS) {
return readImpacts(level0SerializedImpacts, level0Impacts);
}
if (level == 1) {
return readImpacts(level1SerializedImpacts, level1Impacts);
}
return DUMMY_IMPACTS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public final class Lucene103PostingsReader extends PostingsReaderBase {
private static final List<Impact> DUMMY_IMPACTS =
Collections.singletonList(new Impact(Integer.MAX_VALUE, 1L));

// We stopped storing a placeholder impact with freq=1 for fields with DOCS after 9.12.0
private static final List<Impact> DUMMY_IMPACTS_NO_FREQS =
Collections.singletonList(new Impact(1, 1L));

private final IndexInput docIn;
private final IndexInput posIn;
private final IndexInput payIn;
Expand Down Expand Up @@ -1302,13 +1306,14 @@ public int getDocIdUpTo(int level) {

@Override
public List<Impact> getImpacts(int level) {
if (indexHasFreq) {
if (level == 0 && level0LastDocID != NO_MORE_DOCS) {
return readImpacts(level0SerializedImpacts, level0Impacts);
}
if (level == 1) {
return readImpacts(level1SerializedImpacts, level1Impacts);
}
if (indexHasFreq == false) {
return DUMMY_IMPACTS_NO_FREQS;
}
if (level == 0 && level0LastDocID != NO_MORE_DOCS) {
return readImpacts(level0SerializedImpacts, level0Impacts);
}
if (level == 1) {
return readImpacts(level1SerializedImpacts, level1Impacts);
}
return DUMMY_IMPACTS;
}
Expand Down