Class MultiTermHighlighting.AutomataCollector
- java.lang.Object
-
- org.apache.lucene.search.QueryVisitor
-
- org.apache.lucene.search.uhighlight.MultiTermHighlighting.AutomataCollector
-
- Enclosing class:
- MultiTermHighlighting
private static class MultiTermHighlighting.AutomataCollector extends QueryVisitor
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.function.Predicate<java.lang.String>fieldMatcher(package private) booleanlookInSpan(package private) java.util.List<LabelledCharArrayMatcher>runAutomata-
Fields inherited from class org.apache.lucene.search.QueryVisitor
EMPTY_VISITOR
-
-
Constructor Summary
Constructors Modifier Constructor Description privateAutomataCollector(boolean lookInSpan, java.util.function.Predicate<java.lang.String> fieldMatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptField(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 asTermInSetQuerythat are not running on fields of interestvoidconsumeTermsMatching(Query query, java.lang.String field, java.util.function.Supplier<ByteRunAutomaton> automaton)Called by leaf queries that match on a class of termsQueryVisitorgetSubVisitor(BooleanClause.Occur occur, Query parent)Pulls a visitor instance for visiting child clauses of a query The default implementation returnsthis, unlessoccuris equal toBooleanClause.Occur.MUST_NOTin which case it returnsQueryVisitor.EMPTY_VISITOR-
Methods inherited from class org.apache.lucene.search.QueryVisitor
consumeTerms, termCollector, visitLeaf
-
-
-
-
Field Detail
-
runAutomata
java.util.List<LabelledCharArrayMatcher> runAutomata
-
lookInSpan
final boolean lookInSpan
-
fieldMatcher
final java.util.function.Predicate<java.lang.String> fieldMatcher
-
-
Method Detail
-
acceptField
public boolean acceptField(java.lang.String field)
Description copied from class:QueryVisitorWhether or not terms from this field are of interest to the visitor Implement this to avoid collecting terms from heavy queries such asTermInSetQuerythat are not running on fields of interest- Overrides:
acceptFieldin classQueryVisitor
-
getSubVisitor
public QueryVisitor getSubVisitor(BooleanClause.Occur occur, Query parent)
Description copied from class:QueryVisitorPulls a visitor instance for visiting child clauses of a query The default implementation returnsthis, unlessoccuris equal toBooleanClause.Occur.MUST_NOTin which case it returnsQueryVisitor.EMPTY_VISITOR- Overrides:
getSubVisitorin classQueryVisitor- Parameters:
occur- the relationship between the parent and its childrenparent- the query visited
-
consumeTermsMatching
public void consumeTermsMatching(Query query, java.lang.String field, java.util.function.Supplier<ByteRunAutomaton> automaton)
Description copied from class:QueryVisitorCalled by leaf queries that match on a class of terms- Overrides:
consumeTermsMatchingin classQueryVisitor- Parameters:
query- the leaf queryfield- the field queried againstautomaton- a supplier for an automaton defining which terms match
-
-