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<CharacterRunAutomaton> |
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 |
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 |
void |
visitLeaf(Query query)
Called by leaf queries that do not match on terms
|
consumeTerms, termCollectorjava.util.List<CharacterRunAutomaton> 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 visitLeaf(Query query)
QueryVisitorvisitLeaf in class QueryVisitorquery - the query