Table of Contents

Method Search

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Search<TInput>(SearchDefinition<TInput>, SearchHighlightOptions<TInput>, string, SearchCountOptions, bool, bool)

Creates a $search stage.

public static PipelineStageDefinition<TInput, TInput> Search<TInput>(SearchDefinition<TInput> searchDefinition, SearchHighlightOptions<TInput> highlight = null, string indexName = null, SearchCountOptions count = null, bool returnStoredSource = false, bool scoreDetails = false)

Parameters

searchDefinition SearchDefinition<TInput>

The search definition.

highlight SearchHighlightOptions<TInput>

The highlight options.

indexName string

The index name.

count SearchCountOptions

The count options.

returnStoredSource bool

Flag that specifies whether to perform a full document lookup on the backend database or return only stored source fields directly from Atlas Search.

scoreDetails bool

Flag that specifies whether to return a detailed breakdown of the score for each document in the result.

Returns

PipelineStageDefinition<TInput, TInput>

The stage.

Type Parameters

TInput

The type of the input documents.

Search<TInput>(SearchDefinition<TInput>, SearchOptions<TInput>)

Creates a $search stage.

public static PipelineStageDefinition<TInput, TInput> Search<TInput>(SearchDefinition<TInput> searchDefinition, SearchOptions<TInput> searchOptions)

Parameters

searchDefinition SearchDefinition<TInput>

The search definition.

searchOptions SearchOptions<TInput>

The search options.

Returns

PipelineStageDefinition<TInput, TInput>

The stage.

Type Parameters

TInput

The type of the input documents.