Class FunctionQuery
- java.lang.Object
-
- org.apache.lucene.search.Query
-
- org.apache.lucene.queries.function.FunctionQuery
-
public class FunctionQuery extends Query
Returns a score for each document based on a ValueSource, often some function of the value of a field.- See Also:
ValueSourceScorer- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classFunctionQuery.AllScorerScores all documents, applying the function to each documentprotected classFunctionQuery.FunctionWeightCreates FunctionQuery scorer instances
-
Constructor Summary
Constructors Constructor Description FunctionQuery(ValueSource func)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WeightcreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)booleanequals(Object other)Returns true ifois equal to this.ValueSourcegetValueSource()inthashCode()StringtoString(String field)Prints a user-readable version of this query.voidvisit(QueryVisitor visitor)
-
-
-
Constructor Detail
-
FunctionQuery
public FunctionQuery(ValueSource func)
- Parameters:
func- defines the function to be used for scoring
-
-
Method Detail
-
getValueSource
public ValueSource getValueSource()
- Returns:
- The associated ValueSource
-
visit
public void visit(QueryVisitor visitor)
-
createWeight
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException
- Overrides:
createWeightin classQuery- Throws:
IOException
-
equals
public boolean equals(Object other)
Returns true ifois equal to this.
-
-