Class FunctionQuery
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
Inherited Members
Namespace: Lucene.Net.Queries.Function
Assembly: Lucene.Net.Queries.dll
Syntax
public class FunctionQuery : Query
Constructors
FunctionQuery(ValueSource)
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
Declaration
public FunctionQuery(ValueSource func)
Parameters
Type | Name | Description |
---|---|---|
ValueSource | func | defines the function to be used for scoring |
Properties
ValueSource
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
Declaration
public virtual ValueSource ValueSource { get; }
Property Value
Type | Description |
---|---|
ValueSource | The associated ValueSource |
Methods
CreateWeight(IndexSearcher)
Expert: Constructs an appropriate Lucene.Net.Search.Weight implementation for this query.
Only implemented by primitive queries, which re-write to themselves.Declaration
public override Weight CreateWeight(IndexSearcher searcher)
Parameters
Type | Name | Description |
---|---|---|
IndexSearcher | searcher |
Returns
Type | Description |
---|---|
Weight |
Overrides
Equals(object)
Returns true if o
is equal to this.
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
object | o |
Returns
Type | Description |
---|---|
bool |
Overrides
ExtractTerms(ISet<Term>)
Expert: adds all terms occurring in this query to the terms set. Only works if this query is in its rewritten (Lucene.Net.Search.Query.Rewrite(Lucene.Net.Index.IndexReader)) form.
Declaration
public override void ExtractTerms(ISet<Term> terms)
Parameters
Type | Name | Description |
---|---|---|
ISet<Term> | terms |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | If this query is not yet rewritten |
GetHashCode()
Returns a hash code value for this object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
Rewrite(IndexReader)
Expert: called to re-write queries into primitive queries. For example, a Lucene.Net.Search.PrefixQuery will be rewritten into a Lucene.Net.Search.BooleanQuery that consists of Lucene.Net.Search.TermQuerys.
Declaration
public override Query Rewrite(IndexReader reader)
Parameters
Type | Name | Description |
---|---|---|
IndexReader | reader |
Returns
Type | Description |
---|---|
Query |
Overrides
ToString(string)
Prints a user-readable version of this query.
Declaration
public override string ToString(string field)
Parameters
Type | Name | Description |
---|---|---|
string | field |
Returns
Type | Description |
---|---|
string |