Interface IMongoSearchIndexManager
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
CancellationTokenThe 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
CancellationTokenThe 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
BsonDocumentThe index definition.
name
stringThe index name.
cancellationToken
CancellationTokenThe 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
CreateSearchIndexModelThe model defining the index.
cancellationToken
CancellationTokenThe 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
BsonDocumentThe index definition.
name
stringThe index name.
cancellationToken
CancellationTokenThe cancellation token.
Returns
CreateOneAsync(CreateSearchIndexModel, CancellationToken)
Creates a search index.
Task<string> CreateOneAsync(CreateSearchIndexModel model, CancellationToken cancellationToken = default)
Parameters
model
CreateSearchIndexModelThe model defining the index.
cancellationToken
CancellationTokenThe cancellation token.
Returns
DropOne(string, CancellationToken)
Drops an index by its name.
void DropOne(string name, CancellationToken cancellationToken = default)
Parameters
name
stringThe index name.
cancellationToken
CancellationTokenThe cancellation token.
DropOneAsync(string, CancellationToken)
Drops an index by its name.
Task DropOneAsync(string name, CancellationToken cancellationToken = default)
Parameters
name
stringThe index name.
cancellationToken
CancellationTokenThe 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
stringName of the index.
aggregateOptions
AggregateOptionsThe aggregate options.
cancellationToken
CancellationTokenThe 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
stringName of the index.
aggregateOptions
AggregateOptionsThe aggregate options.
cancellationToken
CancellationTokenThe 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
stringName of the index.
definition
BsonDocumentThe definition.
cancellationToken
CancellationTokenThe cancellation token.
UpdateAsync(string, BsonDocument, CancellationToken)
Update the search index.
Task UpdateAsync(string name, BsonDocument definition, CancellationToken cancellationToken = default)
Parameters
name
stringName of the index.
definition
BsonDocumentThe definition.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task
A Task.