File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
lucene/core/src/java/org/apache/lucene/codecs/lucene101 Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ public final class Lucene101PostingsReader extends PostingsReaderBase {
7373 private static final List <Impact > DUMMY_IMPACTS =
7474 Collections .singletonList (new Impact (Integer .MAX_VALUE , 1L ));
7575
76+ // We stopped storing a placeholder impact with freq=1 for fields with DOCS after 9.12.0
77+ private static final List <Impact > DUMMY_IMPACTS_NO_FREQS =
78+ Collections .singletonList (new Impact (1 , 1L ));
79+
7680 private final IndexInput docIn ;
7781 private final IndexInput posIn ;
7882 private final IndexInput payIn ;
@@ -1328,13 +1332,14 @@ public int getDocIdUpTo(int level) {
13281332
13291333 @ Override
13301334 public List <Impact > getImpacts (int level ) {
1331- if (indexHasFreq ) {
1332- if (level == 0 && level0LastDocID != NO_MORE_DOCS ) {
1333- return readImpacts (level0SerializedImpacts , level0Impacts );
1334- }
1335- if (level == 1 ) {
1336- return readImpacts (level1SerializedImpacts , level1Impacts );
1337- }
1335+ if (indexHasFreq == false ) {
1336+ return DUMMY_IMPACTS_NO_FREQS ;
1337+ }
1338+ if (level == 0 && level0LastDocID != NO_MORE_DOCS ) {
1339+ return readImpacts (level0SerializedImpacts , level0Impacts );
1340+ }
1341+ if (level == 1 ) {
1342+ return readImpacts (level1SerializedImpacts , level1Impacts );
13381343 }
13391344 return DUMMY_IMPACTS ;
13401345 }
You can’t perform that action at this time.
0 commit comments