Package org.craftercms.search.opensearch
Interface OpenSearchAdminService
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
MultiOpenSearchAdminServiceImpl
,OpenSearchAdminServiceImpl
Provides operations to manage indices in OpenSearch
- Since:
- 3.1.0
- Author:
- joseross
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createIndex
(String aliasName) Creates an indexvoid
createIndex
(String aliasName, Locale locale) Creates an index for the given localevoid
deleteIndexes
(String aliasName) Deletes all indexes assigned to the given aliasvoid
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 aliasvoid
recreateIndex
(String aliasName) Recreates an existing indexvoid
Checks if the OpenSearch cluster is ready to receive requestsMethods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
createIndex
Creates an index- Parameters:
aliasName
- the name of the alias- Throws:
OpenSearchException
- if there is any error during the operation
-
indexExists
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
Creates an index for the given locale- Parameters:
aliasName
- the name of the aliaslocale
- the locale for the index
-
deleteIndexes
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
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
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 indexdestIndex
- the new index to be created- Throws:
OpenSearchException
- if there is any error during the operation
-