Package org.apache.lucene.monitor
Class QueryAnalyzer.QueryBuilder
- java.lang.Object
-
- org.apache.lucene.search.QueryVisitor
-
- org.apache.lucene.monitor.QueryAnalyzer.QueryBuilder
-
- All Implemented Interfaces:
java.util.function.Function<TermWeightor,QueryTree>
- Direct Known Subclasses:
QueryAnalyzer.Disjunction
- Enclosing class:
- QueryAnalyzer
private class QueryAnalyzer.QueryBuilder extends QueryVisitor implements java.util.function.Function<TermWeightor,QueryTree>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<java.util.function.Function<TermWeightor,QueryTree>>children-
Fields inherited from class org.apache.lucene.search.QueryVisitor
EMPTY_VISITOR
-
-
Constructor Summary
Constructors Modifier Constructor Description privateQueryBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryTreeapply(TermWeightor termWeightor)voidconsumeTerms(Query query, Term... terms)Called by leaf queries that match on specific 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_VISITORvoidvisitLeaf(Query query)Called by leaf queries that do not match on terms-
Methods inherited from class org.apache.lucene.search.QueryVisitor
acceptField, consumeTermsMatching, termCollector
-
-
-
-
Field Detail
-
children
final java.util.List<java.util.function.Function<TermWeightor,QueryTree>> children
-
-
Method Detail
-
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
-
consumeTerms
public void consumeTerms(Query query, Term... terms)
Description copied from class:QueryVisitorCalled by leaf queries that match on specific terms- Overrides:
consumeTermsin classQueryVisitor- Parameters:
query- the leaf queryterms- the terms the query will match on
-
visitLeaf
public void visitLeaf(Query query)
Description copied from class:QueryVisitorCalled by leaf queries that do not match on terms- Overrides:
visitLeafin classQueryVisitor- Parameters:
query- the query
-
apply
public QueryTree apply(TermWeightor termWeightor)
- Specified by:
applyin interfacejava.util.function.Function<TermWeightor,QueryTree>
-
-