Interface OpenSearchAdminService

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
MultiOpenSearchAdminServiceImpl, OpenSearchAdminServiceImpl

public interface OpenSearchAdminService extends AutoCloseable
Provides operations to manage indices in OpenSearch
Since:
3.1.0
Author:
joseross
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    createIndex(String aliasName)
    Creates an index
    void
    createIndex(String aliasName, Locale locale)
    Creates an index for the given locale
    void
    deleteIndexes(String aliasName)
    Deletes all indexes assigned to the given alias
    void
    duplicateIndex(String srcIndex, String destIndex)
    Create a new index with the same settings and mappings as the source index, then reindex all data to the newly created index.
    boolean
    indexExists(String aliasName)
    Indicates if an index exists for the given alias
    void
    recreateIndex(String aliasName)
    Recreates an existing index
    void
    Checks if the OpenSearch cluster is ready to receive requests

    Methods inherited from interface java.lang.AutoCloseable

    close
  • Method Details

    • createIndex

      void createIndex(String aliasName) throws OpenSearchException
      Creates an index
      Parameters:
      aliasName - the name of the alias
      Throws:
      OpenSearchException - if there is any error during the operation
    • indexExists

      boolean indexExists(String aliasName) throws OpenSearchException
      Indicates if an index exists for the given alias
      Parameters:
      aliasName - the index alias
      Returns:
      true if the index exists, false otherwise
      Throws:
      OpenSearchException - if there is any error while checking the index
    • createIndex

      void createIndex(String aliasName, Locale locale)
      Creates an index for the given locale
      Parameters:
      aliasName - the name of the alias
      locale - the locale for the index
    • deleteIndexes

      void deleteIndexes(String aliasName) throws OpenSearchException
      Deletes all indexes assigned to the given alias
      Parameters:
      aliasName - the name of the alias
      Throws:
      OpenSearchException - if there is any error during the operation
    • recreateIndex

      void recreateIndex(String aliasName) throws OpenSearchException
      Recreates an existing index
      Parameters:
      aliasName - the name of the alias
      Throws:
      OpenSearchException - if there is any error during the operation
    • waitUntilReady

      void waitUntilReady()
      Checks if the OpenSearch cluster is ready to receive requests
    • duplicateIndex

      void duplicateIndex(String srcIndex, String destIndex) throws OpenSearchException
      Create a new index with the same settings and mappings as the source index, then reindex all data to the newly created index.
      Parameters:
      srcIndex - the existing source index
      destIndex - the new index to be created
      Throws:
      OpenSearchException - if there is any error during the operation