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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceManages staging index, i.e. -
Method Summary
Modifier and TypeMethodDescriptionCreate a new staging index, i.e.voidCreate an index on OpenSearch based on the provided settingsbooleanexists()getAlias()Gets the alias for accessing the OpenSearch index.Get or add field mappings on this index.getIndex()voidrecreate()Create a new index on OpenSearch based on the provided settings.Methods inherited from interface org.springframework.beans.factory.DisposableBean
destroy
-
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 (seeOpenSearchIndexManager.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
- Returns:
- true if the index exists, or false if it does not exist
- Throws:
IOException
-
ensureExists
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
Create a new index on OpenSearch based on the provided settings. If it already exists, it will be deleted first.- Throws:
IOException
-