Interface OpenSearchIndexManager

All Superinterfaces:
org.springframework.beans.factory.DisposableBean
All Known Implementing Classes:
OpenSearchIndexManagerImpl

public interface OpenSearchIndexManager extends org.springframework.beans.factory.DisposableBean
Provides operations to manage an OpenSearch index and its settings.
Since:
8.8
  • Method Details

    • getIndex

      Index getIndex()
      Returns:
      the index managed by this instance
    • getAlias

      String getAlias()
      Gets the alias for accessing the OpenSearch index. Note: each index is created behind an alias to improve resiliency during reindexing. On system indexes, it allows green/blue reindexing to avoid downtime (see OpenSearchIndexManager.StagingIndex). On custom index, it tolerates failures when deleting the old index (e.g. because snapshotting is taking place).
      Returns:
      the alias
    • getFieldMappings

      FieldMappings getFieldMappings()
      Get or add field mappings on this index.
      Returns:
      field mappings
    • exists

      boolean exists() throws IOException
      Returns:
      true if the index exists, or false if it does not exist
      Throws:
      IOException
    • ensureExists

      void ensureExists() throws IOException
      Create an index on OpenSearch based on the provided settings
      Throws:
      IOException
    • createStagingIndex

      Create a new staging index, i.e. an index that's not pointed to by the alias.
      Returns:
      the new staging index
      Throws:
      IOException
    • recreate

      void recreate() throws IOException
      Create a new index on OpenSearch based on the provided settings. If it already exists, it will be deleted first.
      Throws:
      IOException