java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.queries.function.FunctionQuery
Returns a score for each document based on a ValueSource, often some function of the value of a
field.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classScores all documents, applying the function to each documentprotected classCreates FunctionQuery scorer instances -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) Expert: Constructs an appropriate Weight implementation for this query.booleanReturns true ifois equal to this.inthashCode()Override and implement query hash code properly in a subclass.Prints a user-readable version of this query.voidvisit(QueryVisitor visitor) Recurse through the query tree, visiting any child queries.
-
Field Details
-
func
-
-
Constructor Details
-
FunctionQuery
- Parameters:
func- defines the function to be used for scoring
-
-
Method Details
-
getValueSource
- Returns:
- The associated ValueSource
-
visit
Description copied from class:QueryRecurse through the query tree, visiting any child queries. -
createWeight
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException Description copied from class:QueryExpert: Constructs an appropriate Weight implementation for this query.Only implemented by primitive queries, which re-write to themselves.
- Overrides:
createWeightin classQuery- Parameters:
scoreMode- How the produced scorers will be consumed.boost- The boost that is propagated by the parent queries.- Throws:
IOException
-
toString
Prints a user-readable version of this query. -
equals
Returns true ifois equal to this. -
hashCode
public int hashCode()Description copied from class:QueryOverride and implement query hash code properly in a subclass. This is required so thatQueryCacheworks properly.
-