Class SearchIndexDefinitionWithFields
- Namespace
- MongoDB.EntityFrameworkCore.Metadata.Search.Definitions
- Assembly
- MongoDB.EntityFrameworkCore.dll
Defines a MongoDB search index part that contains field mappings. This could be for the top level document, or for embedded (nested) documents.
public abstract class SearchIndexDefinitionWithFields : SearchIndexDefinitionBase, ISearchIndexDefinition
- Inheritance
-
SearchIndexDefinitionWithFields
- Implements
- Derived
- 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.
Properties
- ContainingElementName
The containing element name resolved from EntityType at build time. Used at runtime to avoid holding onto a build-time IMutableEntityType reference across model finalization.
- EntityType
The entity type for which the search index is being defined. May be an owned entity type when defining indexes on properties of embedded (nested) entity types.
- ExcludedFieldNames
The fields to exclude storing source for. Not used if IncludeAll is set.
- FieldDefinitions
Definitions for each field included in the index.
- IncludeAll
Indicates whether to include source for all fields. If this property is set, then IncludedFieldNames and ExcludedFieldNames are not used.
- IncludedFieldNames
The fields to store source for. Not used if IncludeAll is set.
- IsDynamic
Marks this definition as dynamic or static.
- TypeSetName
The type set name to use for dynamic mappings. If this is not set and IsDynamic is true, then the default type set is used.
Methods
- AddFieldsToDocument(BsonDocument)
Goes through each field definition and adds an entry for it to the given document.
- GetOrAddFieldDefinition<TDefinition>(IMutablePropertyBase)
Finds the definition for the field mapped to a given property of the given type. If none is found, then a new instance is created and returned.
- GetOrAddFieldDefinition<TDefinition>(string)
Finds the definition for the field with the given name If none is found, then a new instance is created and returned.
- ToDynamicBson()
Creates a BSON fragment for the "dynamic: " element in a top-level or nested definition.
- ToStoredSource()
Creates a BSON fragment for the "storedSource: " element in a top-level or nested definition.