Skip to content

Commit

Permalink
1. Remove calling deprecated document api
Browse files Browse the repository at this point in the history
2. Fixed some calling and Tests
3. Spotless java

Signed-off-by: luyuncheng <[email protected]>
  • Loading branch information
luyuncheng committed May 27, 2023
1 parent 4db9da6 commit c18cd7f
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,7 @@ private static void consumeFromType(IndexSearcher indexSearcher, String type, Ch
while (docIdSetIterator.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
if (isLiveDoc.test(docIdSetIterator.docID())) {
logger.trace("processing doc {}", docIdSetIterator.docID());
bytesRefConsumer.accept(
storedFields.document(docIdSetIterator.docID()).getBinaryValue(DATA_FIELD_NAME)
);
bytesRefConsumer.accept(storedFields.document(docIdSetIterator.docID()).getBinaryValue(DATA_FIELD_NAME));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.apache.lucene.index.PostingsEnum;
import org.apache.lucene.index.ReaderUtil;
import org.apache.lucene.index.StoredFieldVisitor;
import org.apache.lucene.index.StoredFields;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.search.ConstantScoreScorer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
import org.apache.lucene.index.PointValues;
import org.apache.lucene.index.SegmentInfos;
import org.apache.lucene.index.SoftDeletesRetentionMergePolicy;
import org.apache.lucene.index.StoredFields;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,7 @@ public void testLotsOfThreads() throws Exception {
assertTrue("document not found", getResult.exists());
assertEquals(iteration, getResult.version());
StoredFields storedFields = getResult.docIdAndVersion().reader.storedFields();
org.apache.lucene.document.Document document = storedFields.document(
getResult.docIdAndVersion().docId
);
org.apache.lucene.document.Document document = storedFields.document(getResult.docIdAndVersion().docId);
assertThat(document.getValues("test"), arrayContaining(testFieldValue));
}
} catch (Exception t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import java.util.List;

import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
Expand Down

0 comments on commit c18cd7f

Please sign in to comment.