Table of Contents

Method Autocomplete

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

Autocomplete(SearchPathDefinition<TDocument>, SearchQueryDefinition, SearchAutocompleteTokenOrder, SearchFuzzyOptions, SearchScoreDefinition<TDocument>)

Creates a search definition that performs a search for a word or phrase that contains a sequence of characters from an incomplete input string.

public SearchDefinition<TDocument> Autocomplete(SearchPathDefinition<TDocument> path, SearchQueryDefinition query, SearchAutocompleteTokenOrder tokenOrder = SearchAutocompleteTokenOrder.Any, SearchFuzzyOptions fuzzy = null, SearchScoreDefinition<TDocument> score = null)

Parameters

path SearchPathDefinition<TDocument>

The indexed field to search.

query SearchQueryDefinition

The query definition specifying the string or strings to search for.

tokenOrder SearchAutocompleteTokenOrder

The order in which to search for tokens.

fuzzy SearchFuzzyOptions

The options for fuzzy search.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

An autocomplete search definition.

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

Creates a search definition that performs a search for a word or phrase that contains a sequence of characters from an incomplete search string.

public SearchDefinition<TDocument> Autocomplete<TField>(Expression<Func<TDocument, TField>> path, SearchQueryDefinition query, SearchAutocompleteTokenOrder tokenOrder = SearchAutocompleteTokenOrder.Any, SearchFuzzyOptions fuzzy = null, SearchScoreDefinition<TDocument> score = null)

Parameters

path Expression<Func<TDocument, TField>>

The indexed field to search.

query SearchQueryDefinition

The query definition specifying the string or strings to search for.

tokenOrder SearchAutocompleteTokenOrder

The order in which to search for tokens.

fuzzy SearchFuzzyOptions

The options for fuzzy search.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

An autocomplete search definition.

Type Parameters

TField

The type of the field.