public class IndexationHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
TYPEUNIQUE |
| Constructor and Description |
|---|
IndexationHelper() |
| Modifier and Type | Method and Description |
|---|---|
static IndexationResult |
getFullKOResult(IndexParameters indexParameters,
String message)
Get KO Result for reindexation orders
|
static IndexationResult |
getKOResult(SwitchIndexParameters switchIndexParameters,
String message)
Get KO Result for switching order
|
static IndexationResult |
reindex(com.mongodb.client.MongoCollection<org.bson.Document> collection,
ElasticsearchAccess esClient,
List<Integer> tenants,
InputStream mapping)
reindex a collection on a tenant list with a esmapping file
|
static void |
switchIndex(String aliasName,
String newIndex,
ElasticsearchAccess esClient)
switch index, attach a new index to an existing alias
|
public static final String TYPEUNIQUE
public static IndexationResult reindex(com.mongodb.client.MongoCollection<org.bson.Document> collection, ElasticsearchAccess esClient, List<Integer> tenants, InputStream mapping) throws IOException
collection - the collection to be reindexedesClient - the elastic client to be used to reindextenants - the tenant list on which to reindexmapping - the es mapping as a stringIOExceptionpublic static void switchIndex(String aliasName, String newIndex, ElasticsearchAccess esClient) throws DatabaseException
aliasName - the name of the aliasnewIndex - the new index name to switch onesClient - the elastic clientDatabaseException - if an error occurspublic static IndexationResult getFullKOResult(IndexParameters indexParameters, String message)
indexParameters - the index parametermessage - the message to be addedpublic static IndexationResult getKOResult(SwitchIndexParameters switchIndexParameters, String message)
switchIndexParameters - the switch index parametermessage - the message to be addedCopyright © 2018 Vitam. All rights reserved.