Table of Contents

Method RankFusion

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

RankFusion<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, Dictionary<string, PipelineDefinition<TIntermediate, TOutput>>, Dictionary<string, double>, RankFusionOptions<TOutput>)

Appends a $rankFusion stage to the pipeline.

public static PipelineDefinition<TInput, TOutput> RankFusion<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Dictionary<string, PipelineDefinition<TIntermediate, TOutput>> pipelines, Dictionary<string, double> weights = null, RankFusionOptions<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.

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

The rankFusion 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.

RankFusion<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, PipelineDefinition<TIntermediate, TOutput>[], RankFusionOptions<TOutput>)

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

public static PipelineDefinition<TInput, TOutput> RankFusion<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, PipelineDefinition<TIntermediate, TOutput>[] pipelines, RankFusionOptions<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.

options RankFusionOptions<TOutput>

The rankFusion 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.

RankFusion<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, (PipelineDefinition<TIntermediate, TOutput>, double?)[], RankFusionOptions<TOutput>)

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

public static PipelineDefinition<TInput, TOutput> RankFusion<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, (PipelineDefinition<TIntermediate, TOutput>, double?)[] pipelinesWithWeights, RankFusionOptions<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.

options RankFusionOptions<TOutput>

The rankFusion 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.