Class FunctionQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.queries.function.FunctionQuery
- All Implemented Interfaces:
Cloneable
Returns a score for each document based on a ValueSource,
often some function of the value of a field.
Note: This API is experimental and may change in non backward-compatible ways in the future
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateWeight
(IndexSearcher searcher) Expert: Constructs an appropriate Weight implementation for this query.boolean
Returns true ifo
is equal to this.void
extractTerms
(Set<Term> terms) Expert: adds all terms occurring in this query to the terms set.int
hashCode()
Returns a hash code value for this object.rewrite
(IndexReader reader) Expert: called to re-write queries into primitive queries.Prints a user-readable version of this query.
-
Constructor Details
-
FunctionQuery
- Parameters:
func
- defines the function to be used for scoring
-
-
Method Details
-
getValueSource
- Returns:
- The associated ValueSource
-
rewrite
Description copied from class:Query
Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.- Overrides:
rewrite
in classQuery
- Throws:
IOException
-
extractTerms
Description copied from class:Query
Expert: adds all terms occurring in this query to the terms set. Only works if this query is in itsrewritten
form.- Overrides:
extractTerms
in classQuery
-
createWeight
Description copied from class:Query
Expert: Constructs an appropriate Weight implementation for this query.Only implemented by primitive queries, which re-write to themselves.
- Overrides:
createWeight
in classQuery
- Throws:
IOException
-
toString
Prints a user-readable version of this query. -
equals
Returns true ifo
is equal to this. -
hashCode
public int hashCode()Returns a hash code value for this object.
-