Package org.nuxeo.elasticsearch.api
Interface ElasticSearchAdmin
- All Known Implementing Classes:
ElasticSearchAdminImpl,ElasticSearchComponent
public interface ElasticSearchAdmin
Administration interface for Elasticsearch service
- Since:
- 5.9.3
-
Method Summary
Modifier and TypeMethodDescriptionvoiddropAndInitIndex(String indexName) Reinitialize an index.default voiddropAndInitRepositoryIndex(String repositoryName) Reinitialize the index of a repository.voiddropAndInitRepositoryIndex(String repositoryName, boolean syncAlias) Reinitialize the index of a repository.voidflush()Elasticsearch flush on all document indexes, triggers a lucene commit, empties the transaction log.voidflushRepositoryIndex(String repositoryName) Elasticsearch flush on document index for a specific repository, triggers a lucene commit, empties the transaction log.Retrieves theClientthat can be used to access Elasticsearch APIgetIndexNameForRepository(String repositoryName) Get the search index name associated with the repository name.getIndexNameForType(String type) Get the first search index name with the given type.getIndexNamesForType(String type) Get the index names with the given type.getRepositoryForIndex(String indexName) Gets the repository name associated with the index.List repository names that have Elasticsearch support.getSecondaryWriteIndexName(String searchIndexName) Returns the secondary write index used during re-indexing with aliases.getWriteIndexName(String searchIndexName) Returns the index to use for any write operations.voidinitIndexes(boolean dropIfExists) Initialize Elasticsearch indexes.voidinitRepositoryIndexWithAliases(String repositoryName) Creates a new index for the repository applying the mapping and settings.voidoptimize()Elasticsearch runoptimizeRepositoryIndex(java.lang.String)on all document indexes,voidoptimizeIndex(String indexName) Elasticsearch optimize operation allows to reduce the number of segments to one, Note that this can potentially be a very heavy operation.voidoptimizeRepositoryIndex(String repositoryName) Elasticsearch optimize operation allows to reduce the number of segments to one, Note that this can potentially be a very heavy operation.com.google.common.util.concurrent.ListenableFuture<Boolean> AFuturethat accepts callback on completion when all the indexing worker are done.voidrefresh()Refresh all document indexes, immediately after the operation occurs, so that the updated document appears in search results immediately.voidrefreshRepositoryIndex(String repositoryName) Refresh document index for the specific repository, immediately after the operation occurs, so that the updated document appears in search results immediately.voidsyncSearchAndWriteAlias(String searchIndexName) Make sure that the search alias point to the same index as the write alias.booleanWhen true use an external version for Elasticsearch document, this enable an optimistic concurrency control ensuring that an older version of a document never overwrites a newer version.
-
Method Details
-
getClient
OpenSearchClient getClient()Retrieves theClientthat can be used to access Elasticsearch API- Since:
- 5.9.3
-
initIndexes
void initIndexes(boolean dropIfExists) Initialize Elasticsearch indexes. Setup the index settings and mapping for each index that has been registered.- Parameters:
dropIfExists- if {true} remove an existing index- Since:
- 5.9.3
-
dropAndInitIndex
Reinitialize an index. This will drop the existing index, recreate it with its settings and mapping, the index will be empty.- Since:
- 7.3
-
dropAndInitRepositoryIndex
Reinitialize the index of a repository. This will drop the existing index, recreate it with its settings and mapping, the index will be empty.- Since:
- 7.1
-
dropAndInitRepositoryIndex
Reinitialize the index of a repository. This will drop the existing index, recreate it with its settings and mapping, the index will be empty. When syncAlias is false then search alias is not updated with the new index, you need to explicitly callsyncSearchAndWriteAlias(String)- Since:
- 9.3
-
initRepositoryIndexWithAliases
Creates a new index for the repository applying the mapping and settings. Update the write alias to point to this new index. The search alias is updated to the new index only for the initial creation. Otherwise, there are two write indexes until an explicit call tosyncSearchAndWriteAlias(String).- Since:
- 2021.12
-
getRepositoryNames
List repository names that have Elasticsearch support.- Since:
- 7.1
-
getIndexNameForRepository
Get the search index name associated with the repository name.- Throws:
NoSuchElementException- if there is no Elasticsearch index associated with the requested repository.- Since:
- 7.2
-
getRepositoryForIndex
Gets the repository name associated with the index.- Since:
- 9.10
-
getIndexNamesForType
Get the index names with the given type.- Since:
- 7.10
-
getIndexNameForType
Get the first search index name with the given type.- Throws:
NoSuchElementException- if there is no Elasticsearch index with the given type.- Since:
- 7.10
-
getWriteIndexName
Returns the index to use for any write operations.- Since:
- 9.3
-
getSecondaryWriteIndexName
Returns the secondary write index used during re-indexing with aliases.- Returns:
- an index name or null if there is no re-indexing in progress.
- Since:
- 2021.12
-
syncSearchAndWriteAlias
Make sure that the search alias point to the same index as the write alias.- Since:
- 9.3
-
prepareWaitForIndexing
com.google.common.util.concurrent.ListenableFuture<Boolean> prepareWaitForIndexing()AFuturethat accepts callback on completion when all the indexing worker are done.- Since:
- 7.2
-
refresh
void refresh()Refresh all document indexes, immediately after the operation occurs, so that the updated document appears in search results immediately. There is no fsync thus doesn't guarantee durability.- Since:
- 5.9.3
-
refreshRepositoryIndex
Refresh document index for the specific repository, immediately after the operation occurs, so that the updated document appears in search results immediately. There is no fsync thus doesn't guarantee durability.- Since:
- 5.9.4
-
flush
void flush()Elasticsearch flush on all document indexes, triggers a lucene commit, empties the transaction log. Data is flushed to disk.- Since:
- 5.9.3
-
flushRepositoryIndex
Elasticsearch flush on document index for a specific repository, triggers a lucene commit, empties the transaction log. Data is flushed to disk.- Since:
- 5.9.4
-
optimize
void optimize()Elasticsearch runoptimizeRepositoryIndex(java.lang.String)on all document indexes,- Since:
- 7.2
-
optimizeRepositoryIndex
Elasticsearch optimize operation allows to reduce the number of segments to one, Note that this can potentially be a very heavy operation.- Since:
- 7.2
-
optimizeIndex
Elasticsearch optimize operation allows to reduce the number of segments to one, Note that this can potentially be a very heavy operation.- Since:
- 7.3
-
useExternalVersion
boolean useExternalVersion()When true use an external version for Elasticsearch document, this enable an optimistic concurrency control ensuring that an older version of a document never overwrites a newer version.- Since:
- 8.3
-