Table of Contents

Method ScoreFusion

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

ScoreFusion<TResult, TNewResult>(IAggregateFluent<TResult>, Dictionary<string, PipelineDefinition<TResult, TNewResult>>, ScoreFusionNormalization, Dictionary<string, double>, ScoreFusionOptions<TNewResult>)

Appends a $scoreFusion stage to the pipeline.

public static IAggregateFluent<TNewResult> ScoreFusion<TResult, TNewResult>(this IAggregateFluent<TResult> aggregate, Dictionary<string, PipelineDefinition<TResult, TNewResult>> pipelines, ScoreFusionNormalization normalization, Dictionary<string, double> weights = null, ScoreFusionOptions<TNewResult> options = null)

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

pipelines Dictionary<string, PipelineDefinition<TResult, TNewResult>>

The map of named pipelines whose results will be combined. The pipelines must operate on the same collection.

normalization ScoreFusionNormalization

The normalization applied to per-pipeline scores before combination.

weights Dictionary<string, double>

The map of pipeline names to non-negative numerical weights determining result importance during combination. Default weight is 1 when unspecified.

options ScoreFusionOptions<TNewResult>

The scoreFusion options.

Returns

IAggregateFluent<TNewResult>

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

TNewResult

The type of the new result.

ScoreFusion<TResult, TNewResult>(IAggregateFluent<TResult>, PipelineDefinition<TResult, TNewResult>[], ScoreFusionNormalization, ScoreFusionOptions<TNewResult>)

Appends a $scoreFusion stage to the pipeline. Pipelines will be automatically named as "pipeline1", "pipeline2", etc.

public static IAggregateFluent<TNewResult> ScoreFusion<TResult, TNewResult>(this IAggregateFluent<TResult> aggregate, PipelineDefinition<TResult, TNewResult>[] pipelines, ScoreFusionNormalization normalization, ScoreFusionOptions<TNewResult> options = null)

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

pipelines PipelineDefinition<TResult, TNewResult>[]

The collection of pipelines whose results will be combined. The pipelines must operate on the same collection.

normalization ScoreFusionNormalization

The normalization applied to per-pipeline scores before combination.

options ScoreFusionOptions<TNewResult>

The scoreFusion options.

Returns

IAggregateFluent<TNewResult>

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

TNewResult

The type of the new result.

ScoreFusion<TResult, TNewResult>(IAggregateFluent<TResult>, (PipelineDefinition<TResult, TNewResult>, double?)[], ScoreFusionNormalization, ScoreFusionOptions<TNewResult>)

Appends a $scoreFusion stage to the pipeline. Pipelines will be automatically named as "pipeline1", "pipeline2", etc.

public static IAggregateFluent<TNewResult> ScoreFusion<TResult, TNewResult>(this IAggregateFluent<TResult> aggregate, (PipelineDefinition<TResult, TNewResult>, double?)[] pipelinesWithWeights, ScoreFusionNormalization normalization, ScoreFusionOptions<TNewResult> options = null)

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

pipelinesWithWeights (PipelineDefinition<TResult, TNewResult>, double?)[]

The collection of tuples containing (pipeline, weight) pairs. The pipelines must operate on the same collection.

normalization ScoreFusionNormalization

The normalization applied to per-pipeline scores before combination.

options ScoreFusionOptions<TNewResult>

The scoreFusion options.

Returns

IAggregateFluent<TNewResult>

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

TNewResult

The type of the new result.