Table of Contents

Method Text

Namespace
MongoDB.Driver.Search
Assembly
MongoDB.Driver.dll

Text(SearchPathDefinition<TDocument>, SearchQueryDefinition, SearchFuzzyOptions, SearchScoreDefinition<TDocument>)

Creates a search definition that performs full-text search using the analyzer specified in the index configuration.

public SearchDefinition<TDocument> Text(SearchPathDefinition<TDocument> path, SearchQueryDefinition query, SearchFuzzyOptions fuzzy = null, SearchScoreDefinition<TDocument> score = null)

Parameters

path SearchPathDefinition<TDocument>

The indexed field or fields to search.

query SearchQueryDefinition

The string or strings to search for.

fuzzy SearchFuzzyOptions

The options for fuzzy search.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A text search definition.

Text(SearchPathDefinition<TDocument>, SearchQueryDefinition, string, SearchScoreDefinition<TDocument>)

Creates a search definition that performs full-text search with synonyms using the analyzer specified in the index configuration.

public SearchDefinition<TDocument> Text(SearchPathDefinition<TDocument> path, SearchQueryDefinition query, string synonyms, SearchScoreDefinition<TDocument> score = null)

Parameters

path SearchPathDefinition<TDocument>

The indexed field or fields to search.

query SearchQueryDefinition

The string or strings to search for.

synonyms string

The name of the synonym mapping definition in the index definition

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A text search definition.

Text<TField>(Expression<Func<TDocument, TField>>, SearchQueryDefinition, SearchFuzzyOptions, SearchScoreDefinition<TDocument>)

Creates a search definition that performs full-text search using the analyzer specified in the index configuration.

public SearchDefinition<TDocument> Text<TField>(Expression<Func<TDocument, TField>> path, SearchQueryDefinition query, SearchFuzzyOptions fuzzy = null, SearchScoreDefinition<TDocument> score = null)

Parameters

path Expression<Func<TDocument, TField>>

The indexed field or field to search.

query SearchQueryDefinition

The string or strings to search for.

fuzzy SearchFuzzyOptions

The options for fuzzy search.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A text search definition.

Type Parameters

TField

The type of the field.

Text<TField>(Expression<Func<TDocument, TField>>, SearchQueryDefinition, string, SearchScoreDefinition<TDocument>)

Creates a search definition that performs full-text search with synonyms using the analyzer specified in the index configuration.

public SearchDefinition<TDocument> Text<TField>(Expression<Func<TDocument, TField>> path, SearchQueryDefinition query, string synonyms, SearchScoreDefinition<TDocument> score = null)

Parameters

path Expression<Func<TDocument, TField>>

The indexed field or field to search.

query SearchQueryDefinition

The string or strings to search for.

synonyms string

The name of the synonym mapping definition in the index definition

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A text search definition.

Type Parameters

TField

The type of the field.