Table of Contents

Class SearchIndexDefinition

Namespace
MongoDB.EntityFrameworkCore.Metadata.Search.Definitions
Assembly
MongoDB.EntityFrameworkCore.dll

The top-level definition for a MongoDB search index.

public class SearchIndexDefinition : SearchIndexDefinitionWithFields, ISearchIndexDefinition
Inheritance
SearchIndexDefinition
Implements
Inherited Members

Remarks

This type is typically used by the database provider. It is only needed by applications when reading metadata from EF Core. Use HasSearchIndex(EntityTypeBuilder, string?) or one of its overloads to configure a MongoDB search index.

Constructors

SearchIndexDefinition(IMutableEntityType, string)

Creates a top-level SearchIndexDefinition for the given entity type with the given name.

Properties

AnalyzerName

The name of the analyzer to use by default for this index.

NumPartitions

Specifies the number of sub-indexes to create if the document count exceeds two billion.

SearchAnalyzerName

The name of the analyzer to use by default for searches with this index.

Methods

GetOrAddTopLevelDefinition<TDefinition>(string)

Finds the top-level definition for the given name and type. If none is found, then a new instance is created and returned.

ToBson()

Generates the BSON for this part of the index definition.