Class LogbookElasticsearchAccess
java.lang.Object
fr.gouv.vitam.common.database.server.elasticsearch.ElasticsearchAccess
fr.gouv.vitam.logbook.common.server.database.collections.LogbookElasticsearchAccess
- All Implemented Interfaces:
DatabaseConnection
ElasticSearch model with MongoDB as main database with management of index and index entries
-
Field Summary
FieldsFields inherited from class fr.gouv.vitam.common.database.server.elasticsearch.ElasticsearchAccess
clusterName, DEFAULT_LIMIT_SCROLL, DEFAULT_SCROLL_TIMEOUT, nodes, SCROLL_ACTIVATE_KEYWORD -
Constructor Summary
ConstructorsConstructorDescriptionLogbookElasticsearchAccess(String clusterName, List<ElasticsearchNode> nodes, ElasticsearchLogbookIndexManager indexManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddeleteIndexByAliasForTesting(LogbookCollections collection, int tenantId) <T> voidindexEntry(LogbookCollections collection, Integer tenantId, String id, VitamDocument<T> vitamDocument) voidpurgeIndexForTesting(LogbookCollections collection, Integer tenantId) voidrefreshIndex(LogbookCollections collection, int tenantId) final co.elastic.clients.elasticsearch.core.search.ResponseBody<com.fasterxml.jackson.databind.node.ObjectNode>search(LogbookCollections collection, Integer tenantId, co.elastic.clients.elasticsearch._types.query_dsl.Query query, List<co.elastic.clients.elasticsearch._types.SortOptions> sorts, int offset, int limit) Search entries in the ElasticSearch index.final co.elastic.clients.elasticsearch.core.search.ResponseBody<com.fasterxml.jackson.databind.node.ObjectNode>searchCrossIndices(LogbookCollections collection, Integer tenantId, co.elastic.clients.elasticsearch._types.query_dsl.Query query, List<co.elastic.clients.elasticsearch._types.SortOptions> sorts, int offset, int limit) Methods inherited from class fr.gouv.vitam.common.database.server.elasticsearch.ElasticsearchAccess
checkConnection, clearScroll, close, createIndexAndAliasIfAliasNotExists, createIndexWithoutAlias, delete, deleteIndexByAliasForTesting, deleteIndexForTesting, existsAlias, existsIndex, getAlias, getClient, getClusterName, getInfo, getNodes, indexEntries, indexEntry, purgeIndexForTesting, purgeIndexForTesting, refreshIndex, search, search, searchCrossIndices, switchIndex, updateEntry
-
Field Details
-
MAPPING_LOGBOOK_OPERATION_FILE
- See Also:
-
-
Constructor Details
-
LogbookElasticsearchAccess
public LogbookElasticsearchAccess(String clusterName, List<ElasticsearchNode> nodes, ElasticsearchLogbookIndexManager indexManager) throws VitamException - Parameters:
clusterName- cluster namenodes- elasticsearch nodeindexManager-- Throws:
VitamException- if elasticsearch nodes list is empty/null
-
-
Method Details
-
createIndexesAndAliases
public void createIndexesAndAliases() -
search
public final co.elastic.clients.elasticsearch.core.search.ResponseBody<com.fasterxml.jackson.databind.node.ObjectNode> search(LogbookCollections collection, Integer tenantId, co.elastic.clients.elasticsearch._types.query_dsl.Query query, List<co.elastic.clients.elasticsearch._types.SortOptions> sorts, int offset, int limit) throws LogbookException Search entries in the ElasticSearch index.- Parameters:
collection- collection of indextenantId- tenant Idquery- as in DSL mode "{ "fieldname" : "value" }" "{ "match" : { "fieldname" : "value" } }" "{ "ids" : { " values" : [list of id] } }"sorts- the list of sortoffset- the offsetlimit- the limit- Returns:
- a structure as SearchResponse
- Throws:
LogbookException- thrown of an error occurred while executing the request
-
searchCrossIndices
public final co.elastic.clients.elasticsearch.core.search.ResponseBody<com.fasterxml.jackson.databind.node.ObjectNode> searchCrossIndices(LogbookCollections collection, Integer tenantId, co.elastic.clients.elasticsearch._types.query_dsl.Query query, List<co.elastic.clients.elasticsearch._types.SortOptions> sorts, int offset, int limit) throws LogbookException - Throws:
LogbookException
-
deleteIndexByAliasForTesting
public void deleteIndexByAliasForTesting(LogbookCollections collection, int tenantId) throws LogbookExecutionException - Throws:
LogbookExecutionException
-
indexEntry
public <T> void indexEntry(LogbookCollections collection, Integer tenantId, String id, VitamDocument<T> vitamDocument) throws LogbookExecutionException - Throws:
LogbookExecutionException
-
refreshIndex
public void refreshIndex(LogbookCollections collection, int tenantId) throws LogbookExecutionException - Throws:
LogbookExecutionException
-
purgeIndexForTesting
public void purgeIndexForTesting(LogbookCollections collection, Integer tenantId) throws LogbookExecutionException - Throws:
LogbookExecutionException
-