romseygeek commented on code in PR #15961:
URL: https://github.com/apache/lucene/pull/15961#discussion_r3085336643
##########
lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/MultiTermHighlighting.java:
##########
@@ -84,5 +85,11 @@ public void consumeTermsMatching(
Query query, String field, Supplier<ByteRunAutomaton> automaton) {
runAutomata.add(LabelledCharArrayMatcher.wrap(query.toString(),
automaton.get()));
}
+
Review Comment:
I think we can just replace the `Supplier<ByteRunAutomaton>` with a
`Supplier<ByteRunnable>` in the signature of `consumeTermsMatching`? It's a
minimal change, replacing an implementation with an interface, and keeps the
API surface on QueryVisitor low.
There's a further question around whether this should be taking something as
complicated as a `ByteRunnable` in the first place, and should instead take a
`Predicate<BytesRef>` but that's a bigger change and one that we can keep
separate.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]