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 givenSearchIndexDefinition
in the collection indicated by the entity class.void
Drops all search indices from the collection indicated by the entity class.void
Drops an index from the collection indicated by the entity class.boolean
Check whether an index with the givenindexName
exists for the collection indicated by the entity class.Check the actualstatus
of an index.void
updateIndex
(SearchIndexDefinition indexDefinition) Alters the search index matching the indexname
.
-
Method Details
-
createIndex
Create the index for the givenSearchIndexDefinition
in 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 givenindexName
exists 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 actualstatus
of an index.- Parameters:
indexName
- name of index to get the status for.- Returns:
- the current status of the index or
SearchIndexStatus.DOES_NOT_EXIST
if 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.
-