Revert to resolve conflicts.

This commit is contained in:
zhouhui 2024-06-20 10:02:58 +08:00
parent fff6116dd2
commit 07ab2eb6e8
1 changed files with 5 additions and 12 deletions

View File

@ -59,12 +59,6 @@ final class FreqProxTermsWriter extends TermsHash {
FrozenBufferedUpdates.TermDocsIterator iterator =
new FrozenBufferedUpdates.TermDocsIterator(fields, true);
// Since we have already applied delete-by-docID, liveDocs maybe not null.
if (state.liveDocs == null) {
state.liveDocs = new FixedBitSet(state.segmentInfo.maxDoc());
state.liveDocs.set(0, state.segmentInfo.maxDoc());
}
segDeletes.forEachOrdered(
(term, docId) -> {
DocIdSetIterator postings = iterator.nextTerm(term.field(), term.bytes());
@ -72,17 +66,16 @@ final class FreqProxTermsWriter extends TermsHash {
assert docId < PostingsEnum.NO_MORE_DOCS;
int doc;
while ((doc = postings.nextDoc()) < docId) {
if (state.liveDocs.get(doc)) {
if (state.liveDocs == null) {
state.liveDocs = new FixedBitSet(state.segmentInfo.maxDoc());
state.liveDocs.set(0, state.segmentInfo.maxDoc());
}
if (state.liveDocs.getAndClear(doc)) {
state.delCountOnFlush++;
state.liveDocs.clear(doc);
}
}
}
});
if (state.delCountOnFlush == 0) {
state.liveDocs = null;
}
}
}