Module spring.data.mongodb
Interface SearchIndexOperations
- All Known Implementing Classes:
DefaultSearchIndexOperations
public interface SearchIndexOperations
Search Index operations on a collection for Atlas Search.
- Since:
- 4.5
- Author:
- Christoph Strobl, Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateIndex(SearchIndexDefinition indexDefinition) Create the index for the givenSearchIndexDefinitionin the collection indicated by the entity class.voidDrops all search indices from the collection indicated by the entity class.voidDrops an index from the collection indicated by the entity class.booleanCheck whether an index with the givenindexNameexists for the collection indicated by the entity class.Check the actualstatusof an index.voidupdateIndex(SearchIndexDefinition indexDefinition) Alters the search index matching the indexname.
-
Method Details
-
createIndex
Create the index for the givenSearchIndexDefinitionin the collection indicated by the entity class.- Parameters:
indexDefinition- must not be null.- Returns:
- the index name.
-
updateIndex
Alters the search index matching the indexname.Atlas Search might not support updating indices which raises a
DataAccessException.- Parameters:
indexDefinition- the index definition.
-
exists
Check whether an index with the givenindexNameexists for the collection indicated by the entity class. To ensure an existing index is queryable it is recommended to check itsstatus.- Parameters:
indexName- name of index to check for presence.- Returns:
- true if the index exists; false otherwise.
-
status
Check the actualstatusof an index.- Parameters:
indexName- name of index to get the status for.- Returns:
- the current status of the index or
SearchIndexStatus.DOES_NOT_EXISTif the index cannot be found.
-
dropIndex
Drops an index from the collection indicated by the entity class.- Parameters:
indexName- name of index to drop.
-
dropAllIndexes
void dropAllIndexes()Drops all search indices from the collection indicated by the entity class.
-