Table of Contents

Interface IMongoSearchIndexManager

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

An interface representing methods used to create, delete and modify search indexes.

public interface IMongoSearchIndexManager

Methods

CreateMany(IEnumerable<CreateSearchIndexModel>, CancellationToken)

Creates multiple indexes.

IEnumerable<string> CreateMany(IEnumerable<CreateSearchIndexModel> models, CancellationToken cancellationToken = default)

Parameters

models IEnumerable<CreateSearchIndexModel>

The models defining each of the indexes.

cancellationToken CancellationToken

The cancellation token.

Returns

IEnumerable<string>

An IEnumerable<T> of the names of the indexes that were created.

CreateManyAsync(IEnumerable<CreateSearchIndexModel>, CancellationToken)

Creates multiple indexes.

Task<IEnumerable<string>> CreateManyAsync(IEnumerable<CreateSearchIndexModel> models, CancellationToken cancellationToken = default)

Parameters

models IEnumerable<CreateSearchIndexModel>

The models defining each of the indexes.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IEnumerable<string>>

A Task whose result is an IEnumerable<T> of the names of the indexes that were created.

CreateOne(BsonDocument, string, CancellationToken)

Creates a search index.

string CreateOne(BsonDocument definition, string name = null, CancellationToken cancellationToken = default)

Parameters

definition BsonDocument

The index definition.

name string

The index name.

cancellationToken CancellationToken

The cancellation token.

Returns

string

The name of the index that was created.

CreateOne(CreateSearchIndexModel, CancellationToken)

Creates a search index.

string CreateOne(CreateSearchIndexModel model, CancellationToken cancellationToken = default)

Parameters

model CreateSearchIndexModel

The model defining the index.

cancellationToken CancellationToken

The cancellation token.

Returns

string

The name of the index that was created.

CreateOneAsync(BsonDocument, string, CancellationToken)

Creates a search index.

Task<string> CreateOneAsync(BsonDocument definition, string name = null, CancellationToken cancellationToken = default)

Parameters

definition BsonDocument

The index definition.

name string

The index name.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<string>

The name of the index that was created.

CreateOneAsync(CreateSearchIndexModel, CancellationToken)

Creates a search index.

Task<string> CreateOneAsync(CreateSearchIndexModel model, CancellationToken cancellationToken = default)

Parameters

model CreateSearchIndexModel

The model defining the index.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<string>

A Task whose result is the name of the index that was created.

DropOne(string, CancellationToken)

Drops an index by its name.

void DropOne(string name, CancellationToken cancellationToken = default)

Parameters

name string

The index name.

cancellationToken CancellationToken

The cancellation token.

DropOneAsync(string, CancellationToken)

Drops an index by its name.

Task DropOneAsync(string name, CancellationToken cancellationToken = default)

Parameters

name string

The index name.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A Task.

List(string, AggregateOptions, CancellationToken)

Lists the search indexes.

IAsyncCursor<BsonDocument> List(string name = null, AggregateOptions aggregateOptions = null, CancellationToken cancellationToken = default)

Parameters

name string

Name of the index.

aggregateOptions AggregateOptions

The aggregate options.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncCursor<BsonDocument>

A cursor.

ListAsync(string, AggregateOptions, CancellationToken)

Lists the search indexes.

Task<IAsyncCursor<BsonDocument>> ListAsync(string name = null, AggregateOptions aggregateOptions = null, CancellationToken cancellationToken = default)

Parameters

name string

Name of the index.

aggregateOptions AggregateOptions

The aggregate options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<BsonDocument>>

A Task whose result is a cursor.

Update(string, BsonDocument, CancellationToken)

Update the search index.

void Update(string name, BsonDocument definition, CancellationToken cancellationToken = default)

Parameters

name string

Name of the index.

definition BsonDocument

The definition.

cancellationToken CancellationToken

The cancellation token.

UpdateAsync(string, BsonDocument, CancellationToken)

Update the search index.

Task UpdateAsync(string name, BsonDocument definition, CancellationToken cancellationToken = default)

Parameters

name string

Name of the index.

definition BsonDocument

The definition.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A Task.