Method Search

| MongoDB CSharp Driver API Reference (original) (raw)

Namespace

MongoDB.Driver

Assembly

MongoDB.Driver.dll

Search(SearchDefinition, SearchHighlightOptions, 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

The search definition.

highlight SearchHighlightOptions

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(SearchDefinition, SearchOptions)

Creates a $search stage.

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

Parameters

searchDefinition SearchDefinition

The search definition.

searchOptions SearchOptions

The search options.

Returns

PipelineStageDefinition<TInput, TInput>

The stage.

Type Parameters

TInput

The type of the input documents.