Table of Contents

Method Search

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

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

Appends a $search stage to the pipeline.

IAggregateFluent<TResult> Search(SearchDefinition<TResult> searchDefinition, SearchHighlightOptions<TResult> highlight = null, string indexName = null, SearchCountOptions count = null, bool returnStoredSource = false, bool scoreDetails = false)

Parameters

searchDefinition SearchDefinition<TResult>

The search definition.

highlight SearchHighlightOptions<TResult>

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

IAggregateFluent<TResult>

The fluent aggregate interface.

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

Appends a $search stage to the pipeline.

IAggregateFluent<TResult> Search(SearchDefinition<TResult> searchDefinition, SearchOptions<TResult> searchOptions)

Parameters

searchDefinition SearchDefinition<TResult>

The search definition.

searchOptions SearchOptions<TResult>

The search options.

Returns

IAggregateFluent<TResult>

The fluent aggregate interface.