Class CustomScoreQuery
Query that sets document score as a programmatic function of several (sub) scores:
- the score of its subQuery (any query)
- (optional) the score of its Function
Query (or queries).
Note
This API is experimental and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Queries
Assembly: Lucene.Net.Queries.dll
Syntax
public class CustomScoreQuery : Query
Constructors
CustomScoreQuery(Query)
Create a CustomsubQuery
.
Declaration
public CustomScoreQuery(Query subQuery)
Parameters
Type | Name | Description |
---|---|---|
Query | subQuery | the sub query whose scored is being customized. Must not be |
CustomScoreQuery(Query, FunctionQuery)
Create a CustomsubQuery
and a Function
Declaration
public CustomScoreQuery(Query subQuery, FunctionQuery scoringQuery)
Parameters
Type | Name | Description |
---|---|---|
Query | subQuery | the sub query whose score is being customized. Must not be |
Function |
scoringQuery | a value source query whose scores are used in the custom score computation. This parameter is optional - it can be null. |
CustomScoreQuery(Query, params FunctionQuery[])
Create a CustomsubQuery
and a Function
Declaration
public CustomScoreQuery(Query subQuery, params FunctionQuery[] scoringQueries)
Parameters
Type | Name | Description |
---|---|---|
Query | subQuery | the sub query whose score is being customized. Must not be |
Function |
scoringQueries | value source queries whose scores are used in the custom score computation. This parameter is optional - it can be null or even an empty array. |
Properties
IsStrict
Checks if this is strict custom scoring.
In strict custom scoring, the Value
null
.
Declaration
public virtual bool IsStrict { get; set; }
Property Value
Type | Description |
---|---|
bool |
Name
A short name of this query, used in To
Declaration
public virtual string Name { get; }
Property Value
Type | Description |
---|---|
string |
ScoringQueries
The scoring queries that only affect the score of Custom
Declaration
public virtual Query[] ScoringQueries { get; }
Property Value
Type | Description |
---|---|
Query[] |
SubQuery
The sub-query that Custom
Declaration
public virtual Query SubQuery { get; }
Property Value
Type | Description |
---|---|
Query |
Methods
Clone()
Lucene.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
object |
Overrides
CreateWeight(IndexSearcher)
Expert: Constructs an appropriate Lucene.
Declaration
public override Weight CreateWeight(IndexSearcher searcher)
Parameters
Type | Name | Description |
---|---|---|
Index |
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>)
Declaration
public override void ExtractTerms(ISet<Term> terms)
Parameters
Type | Name | Description |
---|---|---|
ISet<Term> | terms |
Overrides
GetCustomScoreProvider(AtomicReaderContext)
Returns a Custom
Declaration
protected virtual CustomScoreProvider GetCustomScoreProvider(AtomicReaderContext context)
Parameters
Type | Name | Description |
---|---|---|
Atomic |
context |
Returns
Type | Description |
---|---|
Custom |
GetHashCode()
Returns a hash code value for this object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
Rewrite(IndexReader)
Lucene.
Declaration
public override Query Rewrite(IndexReader reader)
Parameters
Type | Name | Description |
---|---|---|
Index |
reader |
Returns
Type | Description |
---|---|
Query |
Overrides
ToString(string)
Declaration
public override string ToString(string field)
Parameters
Type | Name | Description |
---|---|---|
string | field |
Returns
Type | Description |
---|---|
string |