Class SearchScoreDefinitionBuilder<TDocument>
A builder for a score modifier.
public sealed class SearchScoreDefinitionBuilder<TDocument>
Type Parameters
TDocumentThe type of the document.
- Inheritance
-
SearchScoreDefinitionBuilder<TDocument>
- Inherited Members
Methods
Boost(SearchPathDefinition<TDocument>, double)
Creates a score modifier that multiples a result's base score by the value of a numeric field in the documents.
public SearchScoreDefinition<TDocument> Boost(SearchPathDefinition<TDocument> path, double undefined = 0)
Parameters
pathSearchPathDefinition<TDocument>The path to the numeric field whose value to multiply the default base score by.
undefineddoubleThe numeric value to substitute if the numeric field is not found in the documents.
Returns
- SearchScoreDefinition<TDocument>
A boost score modifier.
Boost(double)
Creates a score modifier that multiplies a result's base score by a given number.
public SearchScoreDefinition<TDocument> Boost(double value)
Parameters
valuedoubleThe number to multiply the default base score by.
Returns
- SearchScoreDefinition<TDocument>
A boost score modifier.
Boost(Expression<Func<TDocument, double>>, double)
Creates a score modifier that multiplies a result's base score by the value of a numeric field in the documents.
public SearchScoreDefinition<TDocument> Boost(Expression<Func<TDocument, double>> path, double undefined = 0)
Parameters
pathExpression<Func<TDocument, double>>The path to the numeric field whose value to multiply the default base score by.
undefineddoubleThe numeric value to substitute if the numeric field is not found in the documents.
Returns
- SearchScoreDefinition<TDocument>
A boost score modifier.
Constant(double)
Creates a score modifier that replaces the base score with a given number.
public SearchScoreDefinition<TDocument> Constant(double value)
Parameters
valuedoubleThe number to replace the base score with.
Returns
- SearchScoreDefinition<TDocument>
A constant score modifier.
Function(SearchScoreFunction<TDocument>)
Creates a score modifier that computes the final score through an expression.
public SearchScoreDefinition<TDocument> Function(SearchScoreFunction<TDocument> function)
Parameters
functionSearchScoreFunction<TDocument>The expression used to compute the score.
Returns
- SearchScoreDefinition<TDocument>
A function score modifier.