Table of Contents

Method ScoreFusion

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

ScoreFusion<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, Dictionary<string, PipelineDefinition<TIntermediate, TOutput>>, ScoreFusionNormalization, Dictionary<string, double>, ScoreFusionOptions<TOutput>)

Appends a $scoreFusion stage to the pipeline.

public static PipelineDefinition<TInput, TOutput> ScoreFusion<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Dictionary<string, PipelineDefinition<TIntermediate, TOutput>> pipelines, ScoreFusionNormalization normalization, Dictionary<string, double> weights = null, ScoreFusionOptions<TOutput> options = null)

Parameters

pipeline PipelineDefinition<TInput, TIntermediate>

The pipeline.

pipelines Dictionary<string, PipelineDefinition<TIntermediate, TOutput>>

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<TOutput>

The scoreFusion options.

Returns

PipelineDefinition<TInput, TOutput>

A new pipeline with an additional stage.

Type Parameters

TInput

The type of the documents.

TIntermediate

The type of the intermediate documents.

TOutput

The type of the output documents.

ScoreFusion<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, PipelineDefinition<TIntermediate, TOutput>[], ScoreFusionNormalization, ScoreFusionOptions<TOutput>)

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

public static PipelineDefinition<TInput, TOutput> ScoreFusion<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, PipelineDefinition<TIntermediate, TOutput>[] pipelines, ScoreFusionNormalization normalization, ScoreFusionOptions<TOutput> options = null)

Parameters

pipeline PipelineDefinition<TInput, TIntermediate>

The pipeline.

pipelines PipelineDefinition<TIntermediate, TOutput>[]

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<TOutput>

The scoreFusion options.

Returns

PipelineDefinition<TInput, TOutput>

A new pipeline with an additional stage.

Type Parameters

TInput

The type of the documents.

TIntermediate

The type of the intermediate documents.

TOutput

The type of the output documents.

ScoreFusion<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, (PipelineDefinition<TIntermediate, TOutput>, double?)[], ScoreFusionNormalization, ScoreFusionOptions<TOutput>)

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

public static PipelineDefinition<TInput, TOutput> ScoreFusion<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, (PipelineDefinition<TIntermediate, TOutput>, double?)[] pipelinesWithWeights, ScoreFusionNormalization normalization, ScoreFusionOptions<TOutput> options = null)

Parameters

pipeline PipelineDefinition<TInput, TIntermediate>

The pipeline.

pipelinesWithWeights (PipelineDefinition<TIntermediate, TOutput>, 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<TOutput>

The scoreFusion options.

Returns

PipelineDefinition<TInput, TOutput>

A new pipeline with an additional stage.

Type Parameters

TInput

The type of the documents.

TIntermediate

The type of the intermediate documents.

TOutput

The type of the output documents.