Skip to content

Commit

Permalink
Merge branch 'lucene_snapshot' into refactor_changes_indexversion
Browse files Browse the repository at this point in the history
  • Loading branch information
jpountz committed Sep 22, 2023
2 parents 0bf852d + 0b971d2 commit 547e709
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo
for (Term term : terms) {
TermStates ts = termStates.computeIfAbsent(term, t -> {
try {
return TermStates.build(searcher.getTopReaderContext(), t, scoreMode.needsScores());
return TermStates.build(searcher, t, scoreMode.needsScores());
} catch (IOException e) {
throw new UncheckedIOException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ public Query rewrite(IndexSearcher searcher) throws IOException {
if (rewritten != this) {
return rewritten;
}
IndexReader reader = searcher.getIndexReader();
IndexReaderContext context = reader.getContext();
TermStates[] ctx = new TermStates[terms.length];
int[] docFreqs = new int[ctx.length];
for (int i = 0; i < terms.length; i++) {
ctx[i] = TermStates.build(context, terms[i], true);
ctx[i] = TermStates.build(searcher, terms[i], true);
docFreqs[i] = ctx[i].docFreq();
}

final IndexReader reader = searcher.getIndexReader();
final int maxDoc = reader.maxDoc();
blend(ctx, maxDoc, reader);
return topLevelQuery(terms, ctx, docFreqs, maxDoc);
Expand Down

0 comments on commit 547e709

Please sign in to comment.