Module spring.data.mongodb
Interface SearchIndexDefinition
- All Known Implementing Classes:
VectorIndex
public interface SearchIndexDefinition
Definition for an Atlas Search Index (Search Index or Vector Index).
- Since:
- 4.5
- Author:
- Marcin Grzejszczak, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionorg.bson.DocumentgetDefinition(TypeInformation<?> entity, MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext) Returns the actual index definition for this index in the context of a potential entity to resolve field name mappings.default org.bson.DocumentgetIndexDocument(TypeInformation<?> entity, MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext) Returns the index document for this index in the context of a potential entity to resolve field name mappings.getName()default org.bson.DocumentReturns the index document for this index without any potential entity context resolving field name mappings.getType()
-
Method Details
-
getName
String getName()- Returns:
- the name of the index.
-
getType
String getType()- Returns:
- the type of the index. Typically,
searchorvectorSearch.
-
getRawIndexDocument
default org.bson.Document getRawIndexDocument()Returns the index document for this index without any potential entity context resolving field name mappings. The resulting document contains the index name, type anddefinition.- Returns:
- never null.
-
getIndexDocument
default org.bson.Document getIndexDocument(@Nullable TypeInformation<?> entity, @Nullable MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext) Returns the index document for this index in the context of a potential entity to resolve field name mappings. The resulting document contains the index name, type anddefinition.- Parameters:
entity- can be null.mappingContext-- Returns:
- never null.
-
getDefinition
org.bson.Document getDefinition(@Nullable TypeInformation<?> entity, @Nullable MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext) Returns the actual index definition for this index in the context of a potential entity to resolve field name mappings. Entity and context can be null to create a generic index definition without applying field name mapping.- Parameters:
entity- can be null.mappingContext- can be null.- Returns:
- never null.
-