private static class MultiTermHighlighting.AutomataCollector extends QueryVisitor
| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.function.Predicate<java.lang.String> |
fieldMatcher |
(package private) boolean |
lookInSpan |
(package private) java.util.List<LabelledCharArrayMatcher> |
runAutomata |
EMPTY_VISITOR| Modifier | Constructor and Description |
|---|---|
private |
AutomataCollector(boolean lookInSpan,
java.util.function.Predicate<java.lang.String> fieldMatcher) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptField(java.lang.String field)
Whether or not terms from this field are of interest to the visitor
Implement this to avoid collecting terms from heavy queries such as
TermInSetQuery
that are not running on fields of interest |
void |
consumeTermsMatching(Query query,
java.lang.String field,
ByteRunAutomaton automaton)
Called by leaf queries that match on a class of terms
|
QueryVisitor |
getSubVisitor(BooleanClause.Occur occur,
Query parent)
Pulls a visitor instance for visiting child clauses of a query
The default implementation returns
this, unless occur is equal
to BooleanClause.Occur.MUST_NOT in which case it returns
QueryVisitor.EMPTY_VISITOR |
consumeTerms, termCollector, visitLeafjava.util.List<LabelledCharArrayMatcher> runAutomata
final boolean lookInSpan
final java.util.function.Predicate<java.lang.String> fieldMatcher
private AutomataCollector(boolean lookInSpan,
java.util.function.Predicate<java.lang.String> fieldMatcher)
public boolean acceptField(java.lang.String field)
QueryVisitorTermInSetQuery
that are not running on fields of interestacceptField in class QueryVisitorpublic QueryVisitor getSubVisitor(BooleanClause.Occur occur, Query parent)
QueryVisitorthis, unless occur is equal
to BooleanClause.Occur.MUST_NOT in which case it returns
QueryVisitor.EMPTY_VISITORgetSubVisitor in class QueryVisitoroccur - the relationship between the parent and its childrenparent - the query visitedpublic void consumeTermsMatching(Query query, java.lang.String field, ByteRunAutomaton automaton)
QueryVisitorconsumeTermsMatching in class QueryVisitorquery - the leaf queryfield - the field queried againstautomaton - an automaton defining which terms match