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
public class LogbookElasticsearchAccess extends ElasticsearchAccess
ElasticSearch model with MongoDB as main database with management of index and index entries
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMAPPING_LOGBOOK_OPERATION_FILE-
Fields inherited from class fr.gouv.vitam.common.database.server.elasticsearch.ElasticsearchAccess
clusterName, DEFAULT_LIMIT_SCROLL, DEFAULT_SCROLL_TIMEOUT, nodes, SCROLL_ACTIVATE_KEYWORD
-
-
Constructor Summary
Constructors Constructor Description LogbookElasticsearchAccess(java.lang.String clusterName, java.util.List<ElasticsearchNode> nodes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>addIndex(LogbookCollections collection, java.lang.Integer tenantId)Add a type to an indexorg.elasticsearch.action.search.SearchResponsesearch(LogbookCollections collection, java.lang.Integer tenantId, org.elasticsearch.index.query.QueryBuilder query, org.elasticsearch.index.query.QueryBuilder filter, java.util.List<org.elasticsearch.search.sort.SortBuilder> sorts, int offset, int limit)Search entries in the ElasticSearch index.-
Methods inherited from class fr.gouv.vitam.common.database.server.elasticsearch.ElasticsearchAccess
checkConnection, clearScroll, close, createIndex, createIndex, createIndexAndAliasIfAliasNotExists, createIndexAndAliasIfAliasNotExists, createIndexWithoutAlias, delete, deleteIndex, deleteIndexByAlias, existsAlias, existsIndex, getAlias, getClient, getClusterName, getInfo, getNodes, indexEntries, indexEntry, purgeIndex, purgeIndex, refreshIndex, search, search, search, search, switchAliasIndex, switchIndex, updateEntry
-
-
-
-
Field Detail
-
MAPPING_LOGBOOK_OPERATION_FILE
public static final java.lang.String MAPPING_LOGBOOK_OPERATION_FILE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LogbookElasticsearchAccess
public LogbookElasticsearchAccess(java.lang.String clusterName, java.util.List<ElasticsearchNode> nodes) throws VitamException, java.io.IOException- Parameters:
clusterName- cluster namenodes- elasticsearch node- Throws:
VitamException- if elasticsearch nodes list is empty/nulljava.io.IOException
-
-
Method Detail
-
addIndex
public final java.util.Map<java.lang.String,java.lang.String> addIndex(LogbookCollections collection, java.lang.Integer tenantId)
Add a type to an index- Parameters:
collection- collection of indextenantId- tenant Id- Returns:
- key aliasName value indexName or empty
-
search
public final org.elasticsearch.action.search.SearchResponse search(LogbookCollections collection, java.lang.Integer tenantId, org.elasticsearch.index.query.QueryBuilder query, org.elasticsearch.index.query.QueryBuilder filter, java.util.List<org.elasticsearch.search.sort.SortBuilder> 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] } }"filter- the filtersorts- the list of sortoffset- the offsetlimit- the limit- Returns:
- a structure as SearchResponse
- Throws:
LogbookException- thrown of an error occurred while executing the request
-
-