Class IndexationHelper
java.lang.Object
fr.gouv.vitam.common.database.server.elasticsearch.IndexationHelper
IndexationHelper useful method for indexation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFullKOResult
(IndexParameters indexParameters, String message) Get KO Result for reindexation ordersstatic IndexationHelper
getKOResult
(SwitchIndexParameters switchIndexParameters, String message) Get KO Result for switching orderreindex
(com.mongodb.client.MongoCollection<org.bson.Document> collection, ElasticsearchAccess esClient, ElasticsearchIndexAlias indexAlias, ElasticsearchIndexSettings indexSettings, ElasticsearchCollections elasticsearchCollection, List<Integer> tenantIds, String tenantGroupName, String elasticsearchConfigurationFilePath) reindex a collection on a tenant list with a esmapping fileswitchIndex
(ElasticsearchIndexAlias indexAlias, ElasticsearchIndexAlias newIndex, ElasticsearchAccess esClient) switch index, attach a new index to an existing alias
-
Constructor Details
-
IndexationHelper
public IndexationHelper()
-
-
Method Details
-
getInstance
-
reindex
public ReindexationOK reindex(com.mongodb.client.MongoCollection<org.bson.Document> collection, ElasticsearchAccess esClient, ElasticsearchIndexAlias indexAlias, ElasticsearchIndexSettings indexSettings, ElasticsearchCollections elasticsearchCollection, List<Integer> tenantIds, String tenantGroupName, String elasticsearchConfigurationFilePath) throws DatabaseException reindex a collection on a tenant list with a esmapping file- Parameters:
collection
- the collection to be reindexedesClient
- the elastic client to be used to reindexindexAlias
- the elastic index alias information- Returns:
- the result of the reindexation as a IndexationResult object
- Throws:
DatabaseException
-
switchIndex
public SwitchIndexResult switchIndex(ElasticsearchIndexAlias indexAlias, ElasticsearchIndexAlias newIndex, ElasticsearchAccess esClient) throws DatabaseException switch index, attach a new index to an existing alias- Parameters:
indexAlias
- the alias informationnewIndex
- the new index name to switch onesClient
- the elastic client- Throws:
DatabaseException
- if an error occurs
-
getFullKOResult
Get KO Result for reindexation orders- Parameters:
indexParameters
- the index parametermessage
- the message to be added- Returns:
- the final result as an IndexationResult object
-
getKOResult
Get KO Result for switching order- Parameters:
switchIndexParameters
- the switch index parametermessage
- the message to be added- Returns:
- the final result as an IndexationResult object
-