Class QueryTermExtractor.BoostedTermExtractor
- java.lang.Object
-
- org.apache.lucene.search.QueryVisitor
-
- org.apache.lucene.search.highlight.QueryTermExtractor.BoostedTermExtractor
-
- Enclosing class:
- QueryTermExtractor
private static class QueryTermExtractor.BoostedTermExtractor extends QueryVisitor
-
-
Field Summary
Fields Modifier and Type Field Description (package private) floatboost(package private) java.util.function.Predicate<java.lang.String>fieldSelector(package private) booleanincludeProhibited(package private) java.util.Set<WeightedTerm>terms-
Fields inherited from class org.apache.lucene.search.QueryVisitor
EMPTY_VISITOR
-
-
Constructor Summary
Constructors Modifier Constructor Description privateBoostedTermExtractor(float boost, java.util.Set<WeightedTerm> terms, boolean includeProhibited, java.util.function.Predicate<java.lang.String> fieldSelector)
-
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 interestvoidconsumeTerms(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_VISITOR-
Methods inherited from class org.apache.lucene.search.QueryVisitor
consumeTermsMatching, termCollector, visitLeaf
-
-
-
-
Field Detail
-
boost
final float boost
-
terms
final java.util.Set<WeightedTerm> terms
-
includeProhibited
final boolean includeProhibited
-
fieldSelector
final java.util.function.Predicate<java.lang.String> fieldSelector
-
-
Constructor Detail
-
BoostedTermExtractor
private BoostedTermExtractor(float boost, java.util.Set<WeightedTerm> terms, boolean includeProhibited, java.util.function.Predicate<java.lang.String> fieldSelector)
-
-
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
-
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
-
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
-
-