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 private
QueryBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryTree
apply(TermWeightor termWeightor)
void
consumeTerms(Query query, Term... terms)
Called by leaf queries that match on specific termsQueryVisitor
getSubVisitor(BooleanClause.Occur occur, Query parent)
Pulls a visitor instance for visiting child clauses of a query The default implementation returnsthis
, unlessoccur
is equal toBooleanClause.Occur.MUST_NOT
in which case it returnsQueryVisitor.EMPTY_VISITOR
void
visitLeaf(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:QueryVisitor
Pulls a visitor instance for visiting child clauses of a query The default implementation returnsthis
, unlessoccur
is equal toBooleanClause.Occur.MUST_NOT
in which case it returnsQueryVisitor.EMPTY_VISITOR
- Overrides:
getSubVisitor
in 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:QueryVisitor
Called by leaf queries that match on specific terms- Overrides:
consumeTerms
in classQueryVisitor
- Parameters:
query
- the leaf queryterms
- the terms the query will match on
-
visitLeaf
public void visitLeaf(Query query)
Description copied from class:QueryVisitor
Called by leaf queries that do not match on terms- Overrides:
visitLeaf
in classQueryVisitor
- Parameters:
query
- the query
-
apply
public QueryTree apply(TermWeightor termWeightor)
- Specified by:
apply
in interfacejava.util.function.Function<TermWeightor,QueryTree>
-
-