Skip to content

Commit

Permalink
Don't use an asserting searcher at all in MatchingDirectoryReader (el…
Browse files Browse the repository at this point in the history
…astic#100668)

Follow up to elastic#100527

We are not testing anything to do with searching with this searcher, and so
there is no point in using LuceneTestCase.newSearcher() which will wrap
it with all sorts of extra checks that may access the underlying reader in
ways that are not anticipated by tests.

Fixes elastic#100460
Fixes elastic#99024
  • Loading branch information
romseygeek committed Oct 11, 2023
1 parent 1a683d1 commit c78c7c1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ public MatchingDirectoryReader(DirectoryReader in, Query query) throws IOExcepti
@Override
public LeafReader wrap(LeafReader leaf) {
try {
final IndexSearcher searcher = newSearcher(leaf, false, true, false);
final IndexSearcher searcher = new IndexSearcher(leaf);
searcher.setQueryCache(null);
final Weight weight = searcher.createWeight(query, ScoreMode.COMPLETE_NO_SCORES, 1.0f);
final Scorer scorer = weight.scorer(leaf.getContext());
Expand Down

0 comments on commit c78c7c1

Please sign in to comment.