Class SearchScoreFunctionBuilder<TDocument>
A builder for a score function.
public sealed class SearchScoreFunctionBuilder<TDocument>
Type Parameters
TDocumentThe type of the document.
- Inheritance
-
SearchScoreFunctionBuilder<TDocument>
- Inherited Members
Methods
Add(params SearchScoreFunction<TDocument>[])
Creates a function that adds a series of numbers.
public SearchScoreFunction<TDocument> Add(params SearchScoreFunction<TDocument>[] operands)
Parameters
operandsSearchScoreFunction<TDocument>[]An array of expressions, which can have negative values.
Returns
- SearchScoreFunction<TDocument>
An addition score function.
Add(IEnumerable<SearchScoreFunction<TDocument>>)
Creates a function that adds a series of numbers.
public SearchScoreFunction<TDocument> Add(IEnumerable<SearchScoreFunction<TDocument>> operands)
Parameters
operandsIEnumerable<SearchScoreFunction<TDocument>>An array of expressions, which can have negative values.
Returns
- SearchScoreFunction<TDocument>
An addition score function.
Constant(double)
Creates a function that represents a constant number.
public SearchScoreFunction<TDocument> Constant(double value)
Parameters
valuedoubleNumber that indicates a fixed value.
Returns
- SearchScoreFunction<TDocument>
A constant score function.
Gauss(SearchPathDefinition<TDocument>, double, double, double, double)
Creates a function that decays, or reduces by multiplying, the final scores of the documents based on the distance of a numeric field from a specified origin point.
public SearchScoreFunction<TDocument> Gauss(SearchPathDefinition<TDocument> path, double origin, double scale, double decay = 0.5, double offset = 0)
Parameters
pathSearchPathDefinition<TDocument>The path to the numeric field.
origindoubleThe point of origin from which to calculate the distance.
scaledoubleThe distance from
originplus or minusoffsetat which scores must be multiplied.decaydoubleThe rate at which to multiply score values, which must be a positive number between 0 and 1 exclusive.
offsetdoubleThe number of use to determine the distance from
origin.
Returns
- SearchScoreFunction<TDocument>
A Guassian score function.
Gauss(Expression<Func<TDocument, double>>, double, double, double, double)
Creates a function that decays, or reduces by multiplying, the final scores of the documents based on the distance of a numeric field from a specified origin point.
public SearchScoreFunction<TDocument> Gauss(Expression<Func<TDocument, double>> path, double origin, double scale, double decay = 0.5, double offset = 0)
Parameters
pathExpression<Func<TDocument, double>>The path to the numeric field.
origindoubleThe point of origin from which to calculate the distance.
scaledoubleThe distance from
originplus or minusoffsetat which scores must be multiplied.decaydoubleThe rate at which to multiply score values, which must be a positive number between 0 and 1 exclusive.
offsetdoubleThe number of use to determine the distance from
origin.
Returns
- SearchScoreFunction<TDocument>
A Guassian score function.
Log(SearchScoreFunction<TDocument>)
Creates a function that calculates the base-10 logarithm of a number.
public SearchScoreFunction<TDocument> Log(SearchScoreFunction<TDocument> operand)
Parameters
operandSearchScoreFunction<TDocument>The number.
Returns
- SearchScoreFunction<TDocument>
A logarithmic score function.
Log1p(SearchScoreFunction<TDocument>)
Creates a function that adds 1 to a number and then calculates its base-10 logarithm.
public SearchScoreFunction<TDocument> Log1p(SearchScoreFunction<TDocument> operand)
Parameters
operandSearchScoreFunction<TDocument>The number.
Returns
- SearchScoreFunction<TDocument>
A logarithmic score function.
Multiply(params SearchScoreFunction<TDocument>[])
Creates a function that multiplies a series of numbers.
public SearchScoreFunction<TDocument> Multiply(params SearchScoreFunction<TDocument>[] operands)
Parameters
operandsSearchScoreFunction<TDocument>[]An array of expressions, which can have negative values.
Returns
- SearchScoreFunction<TDocument>
A mulitplication score function.
Multiply(IEnumerable<SearchScoreFunction<TDocument>>)
Creates a function that multiplies a series of numbers.
public SearchScoreFunction<TDocument> Multiply(IEnumerable<SearchScoreFunction<TDocument>> operands)
Parameters
operandsIEnumerable<SearchScoreFunction<TDocument>>An array of expressions, which can have negative values.
Returns
- SearchScoreFunction<TDocument>
A multiplication score function.
Path(SearchPathDefinition<TDocument>, double)
Creates a function that incorporates an indexed numeric field value into the score.
public SearchScoreFunction<TDocument> Path(SearchPathDefinition<TDocument> path, double undefined = 0)
Parameters
pathSearchPathDefinition<TDocument>The path to the numeric field.
undefineddoubleThe value to use if the numeric field specified using
pathis missing in the document.
Returns
- SearchScoreFunction<TDocument>
A path score function.
Path(Expression<Func<TDocument, double>>, double)
Creates a function that incorporates an indexed numeric field value into the score.
public SearchScoreFunction<TDocument> Path(Expression<Func<TDocument, double>> path, double undefined = 0)
Parameters
pathExpression<Func<TDocument, double>>The path to the numeric field.
undefineddoubleThe value to use if the numeric field specified using
pathis missing in the document.
Returns
- SearchScoreFunction<TDocument>
A path score function.
Relevance()
Creates a function that represents the relevance score, which is the score Atlas Search assigns documents based on relevance.
public SearchScoreFunction<TDocument> Relevance()
Returns
- SearchScoreFunction<TDocument>
A relevance score function.