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 Details

    • createIndex

      String createIndex(SearchIndexDefinition indexDefinition)
      Create the index for the given SearchIndexDefinition in the collection indicated by the entity class.
      Parameters:
      indexDefinition - must not be null.
      Returns:
      the index name.
    • updateIndex

      void updateIndex(SearchIndexDefinition indexDefinition)
      Alters the search index matching the index name.

      Atlas Search might not support updating indices which raises a DataAccessException.

      Parameters:
      indexDefinition - the index definition.
    • exists

      boolean exists(String indexName)
      Check whether an index with the given indexName exists for the collection indicated by the entity class. To ensure an existing index is queryable it is recommended to check its status.
      Parameters:
      indexName - name of index to check for presence.
      Returns:
      true if the index exists; false otherwise.
    • status

      SearchIndexStatus status(String indexName)
      Check the actual status 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

      void dropIndex(String indexName)
      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.