dsmiley commented on a change in pull request #412: URL: https://github.com/apache/lucene/pull/412#discussion_r762601545
########## File path: lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighter.java ########## @@ -137,23 +141,24 @@ static UnifiedHighlighter randomUnifiedHighlighter( || (requireFieldMatch == null && random().nextBoolean())) { uhBuilder.withFieldMatcher(f -> true); // requireFieldMatch==false } - return overriddenBuilderForTests(uhBuilder, mandatoryFlags).build(); + return overriddenBuilderForTests(searcher, indexAnalyzer, uhBuilder, mandatoryFlags).build(); } static UnifiedHighlighter overrideFieldMatcherForTests( UnifiedHighlighter original, Predicate<String> value, String fieldName) { - return UnifiedHighlighter.builder() - .withSearcher(original.getIndexSearcher()) - .withIndexAnalyzer(original.getIndexAnalyzer()) + return UnifiedHighlighter.builder(original.getIndexSearcher(), original.getIndexAnalyzer()) .withFlags(original.getFlags(fieldName)) .withCacheFieldValCharsThreshold(original.getCacheFieldValCharsThreshold()) .withFieldMatcher(value) .build(); } static UnifiedHighlighter.Builder overriddenBuilderForTests( - UnifiedHighlighter.Builder uhBuilder, EnumSet<HighlightFlag> mandatoryFlags) { - return new UnifiedHighlighter.Builder() { + IndexSearcher searcher, Review comment: Why would a method ever need both the builder, and components that can be found on the builder? Just call uhBuilder.getIndexSearcher (or access the field if in scope) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org