Class QueryTermExtractor.BoostedTermExtractor
java.lang.Object
org.apache.lucene.search.QueryVisitor
org.apache.lucene.search.highlight.QueryTermExtractor.BoostedTermExtractor
- Enclosing class:
QueryTermExtractor
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final float(package private) final boolean(package private) final Set<WeightedTerm> Fields inherited from class org.apache.lucene.search.QueryVisitor
EMPTY_VISITOR -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBoostedTermExtractor(float boost, Set<WeightedTerm> terms, boolean includeProhibited, Predicate<String> fieldSelector) -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptField(String field) Whether or not this field is of interest to the visitorvoidconsumeTerms(Query query, Term... terms) Called by leaf queries that match on specific termsgetSubVisitor(BooleanClause.Occur occur, Query parent) Pulls a visitor instance for visiting child clauses of a queryMethods inherited from class org.apache.lucene.search.QueryVisitor
consumeTermsMatching, termCollector, visitLeaf
-
Field Details
-
boost
final float boost -
terms
-
includeProhibited
final boolean includeProhibited -
fieldSelector
-
-
Constructor Details
-
BoostedTermExtractor
private BoostedTermExtractor(float boost, Set<WeightedTerm> terms, boolean includeProhibited, Predicate<String> fieldSelector)
-
-
Method Details
-
acceptField
Description copied from class:QueryVisitorWhether or not this field is of interest to the visitorImplement this to avoid collecting terms from heavy queries such as
TermInSetQuerythat are not running on fields of interest- Overrides:
acceptFieldin classQueryVisitor
-
consumeTerms
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
Description copied from class:QueryVisitorPulls a visitor instance for visiting child clauses of a queryThe default implementation returns
this, 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
-