public class LogbookElasticsearchAccess extends ElasticsearchAccess
Modifier and Type | Field and Description |
---|---|
static String |
MAPPING_LOGBOOK_OPERATION_FILE |
client, clusterName, default_builder, nodes
Constructor and Description |
---|
LogbookElasticsearchAccess(String clusterName,
List<ElasticsearchNode> nodes) |
Modifier and Type | Method and Description |
---|---|
boolean |
addIndex(LogbookCollections collection,
Integer tenantId)
Add a type to an index
|
boolean |
deleteIndex(LogbookCollections collection,
Integer tenantId)
Delete an index
|
void |
refreshIndex(LogbookCollections collection,
Integer tenantId)
Refresh an index
|
org.elasticsearch.action.search.SearchResponse |
search(LogbookCollections collection,
Integer tenantId,
org.elasticsearch.index.query.QueryBuilder query,
org.elasticsearch.index.query.QueryBuilder filter,
List<org.elasticsearch.search.sort.SortBuilder> sorts,
int offset,
int limit)
Search entries in the ElasticSearch index.
|
checkConnection, close, createIndexAndAliasIfAliasNotExists, createIndexWithoutAlias, getClient, getClusterName, getInfo, getNodes, getSettings, settings, switchIndex
public static final String MAPPING_LOGBOOK_OPERATION_FILE
public LogbookElasticsearchAccess(String clusterName, List<ElasticsearchNode> nodes) throws VitamException, IOException
clusterName
- cluster namenodes
- elasticsearch nodeVitamException
- if elasticsearch nodes list is empty/nullIOException
public final boolean deleteIndex(LogbookCollections collection, Integer tenantId)
collection
- collection of indextenantId
- tenant Idpublic final boolean addIndex(LogbookCollections collection, Integer tenantId)
collection
- collection of indextenantId
- tenant Idpublic final void refreshIndex(LogbookCollections collection, Integer tenantId)
collection
- collection of indextenantId
- tenant Idpublic final org.elasticsearch.action.search.SearchResponse search(LogbookCollections collection, Integer tenantId, org.elasticsearch.index.query.QueryBuilder query, org.elasticsearch.index.query.QueryBuilder filter, List<org.elasticsearch.search.sort.SortBuilder> sorts, int offset, int limit) throws LogbookException
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 limitLogbookException
- thrown of an error occurred while executing the requestCopyright © 2018 Vitam. All rights reserved.