Table of Contents

Method Gauss

Namespace
MongoDB.Driver.Search
Assembly
MongoDB.Driver.dll

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

path SearchPathDefinition<TDocument>

The path to the numeric field.

origin double

The point of origin from which to calculate the distance.

scale double

The distance from origin plus or minus offset at which scores must be multiplied.

decay double

The rate at which to multiply score values, which must be a positive number between 0 and 1 exclusive.

offset double

The 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

path Expression<Func<TDocument, double>>

The path to the numeric field.

origin double

The point of origin from which to calculate the distance.

scale double

The distance from origin plus or minus offset at which scores must be multiplied.

decay double

The rate at which to multiply score values, which must be a positive number between 0 and 1 exclusive.

offset double

The number of use to determine the distance from origin.

Returns

SearchScoreFunction<TDocument>

A Guassian score function.