public class ElasticsearchAccessMetadata extends ElasticsearchAccess
Modifier and Type | Field and Description |
---|---|
static String |
MAPPING_OBJECT_GROUP_FILE |
static String |
MAPPING_UNIT_FILE |
client, clusterName, default_builder, nodes
Constructor and Description |
---|
ElasticsearchAccessMetadata(String clusterName,
List<ElasticsearchNode> nodes) |
Modifier and Type | Method and Description |
---|---|
int |
addBulkEntryIndex(Map<String,String> indexes,
Integer tenantId,
MetadataDocument<?> document)
Used for iterative reload in restore operation (using bulk).
|
boolean |
addEntryIndex(MetadataDocument<?> document,
Integer tenantId)
Add one VitamDocument to indexation immediately
|
boolean |
addIndex(MetadataCollections collection,
Integer tenantId)
Add a type to an index
|
org.elasticsearch.action.search.SearchResponse |
basicSearch(MetadataCollections collection,
Integer tenantId,
List<org.elasticsearch.search.aggregations.AggregationBuilder> aggregations,
org.elasticsearch.index.query.QueryBuilder query)
Makes a search request on elasticsearch on a collection with aggregations and a query
|
boolean |
deleteBulkOGEntriesIndexes(List<String> ids,
Integer tenantId)
deleteBulkOGEntriesIndexes
|
void |
deleteBulkUnitsEntriesIndexes(List<String> ids,
Integer tenantId)
deleteBulkUnitEntriesIndexes
|
void |
deleteEntryIndex(MetadataCollections collections,
Integer tenantId,
String type,
String id) |
boolean |
deleteIndex(MetadataCollections collection,
Integer tenantId)
Delete one index
|
void |
insertFullDocument(MetadataCollections collection,
Integer tenantId,
String id,
MetadataDocument doc)
Insert one element
|
void |
insertFullDocuments(MetadataCollections collection,
Integer tenantId,
List<? extends MetadataDocument> documents) |
void |
refreshIndex(MetadataCollections collection,
Integer tenantId)
refresh an index
|
protected Result |
search(MetadataCollections collection,
Integer tenantId,
String type,
org.elasticsearch.index.query.QueryBuilder query,
List<org.elasticsearch.search.sort.SortBuilder> sorts,
int offset,
Integer limit,
List<org.elasticsearch.search.aggregations.AggregationBuilder> facets,
String scrollId,
Integer scrollTimeout) |
void |
updateFullDocument(MetadataCollections collection,
Integer tenantId,
String id,
MetadataDocument doc)
Update one element fully
|
checkConnection, close, createIndexAndAliasIfAliasNotExists, createIndexWithoutAlias, getClient, getClusterName, getInfo, getNodes, getSettings, settings, switchIndex
public static final String MAPPING_UNIT_FILE
public static final String MAPPING_OBJECT_GROUP_FILE
public ElasticsearchAccessMetadata(String clusterName, List<ElasticsearchNode> nodes) throws VitamException, IOException
clusterName
- cluster namenodes
- list of elasticsearch nodeVitamException
- if nodes list is emptyIOException
public final boolean deleteIndex(MetadataCollections collection, Integer tenantId)
collection
- the working metadata collectiontenantId
- the tenant for operationpublic final boolean addIndex(MetadataCollections collection, Integer tenantId)
collection
- the working metadata collectiontenantId
- the tenant for operationpublic final void refreshIndex(MetadataCollections collection, Integer tenantId)
collection
- the workking metadata collectiontenantId
- the tenant for operationpublic final boolean addEntryIndex(MetadataDocument<?> document, Integer tenantId)
document
- the MetadataDocument
for indexingtenantId
- the tenant for operationpublic final int addBulkEntryIndex(Map<String,String> indexes, Integer tenantId, MetadataDocument<?> document)
indexes
- set of operation indextenantId
- the tenant for operationdocument
- the MetadataDocument
for indexingprotected final Result search(MetadataCollections collection, Integer tenantId, String type, org.elasticsearch.index.query.QueryBuilder query, List<org.elasticsearch.search.sort.SortBuilder> sorts, int offset, Integer limit, List<org.elasticsearch.search.aggregations.AggregationBuilder> facets, String scrollId, Integer scrollTimeout) throws MetaDataExecutionException, BadRequestException
collection
- tenantId
- type
- query
- as in DSL mode "{ "fieldname" : "value" }" "{ "match" : { "fieldname" : "value" } }" "{ "ids" : { "
values" : [list of id] } }"sorts
- the list of sortfacets
- the list of facetMetaDataExecutionException
BadRequestException
public org.elasticsearch.action.search.SearchResponse basicSearch(MetadataCollections collection, Integer tenantId, List<org.elasticsearch.search.aggregations.AggregationBuilder> aggregations, org.elasticsearch.index.query.QueryBuilder query)
collection
- on which the request is madetenantId
- on which the request is madeaggregations
- elasticsearchquery
- elasticsearchpublic final void deleteEntryIndex(MetadataCollections collections, Integer tenantId, String type, String id) throws MetaDataExecutionException, MetaDataNotFoundException
collections
- the working collectiontenantId
- the tenant for operationtype
- the type of document to deleteid
- the id of document to deleteMetaDataExecutionException
- if query operation exception occurredMetaDataNotFoundException
- if item not found when deletingpublic void insertFullDocument(MetadataCollections collection, Integer tenantId, String id, MetadataDocument doc) throws MetaDataExecutionException
collection
- tenantId
- id
- doc
- full document to insertMetaDataExecutionException
public void insertFullDocuments(MetadataCollections collection, Integer tenantId, List<? extends MetadataDocument> documents) throws MetaDataExecutionException
MetaDataExecutionException
public void updateFullDocument(MetadataCollections collection, Integer tenantId, String id, MetadataDocument doc) throws MetaDataExecutionException
collection
- tenantId
- id
- doc
- full document to updateMetaDataExecutionException
public boolean deleteBulkOGEntriesIndexes(List<String> ids, Integer tenantId) throws MetaDataExecutionException
Bulk to delete entry indexes
ids
- list of ids of OGtenantId
- the tenant for operationMetaDataExecutionException
- when delete index exception occurredpublic void deleteBulkUnitsEntriesIndexes(List<String> ids, Integer tenantId) throws MetaDataExecutionException
Bulk to delete entry indexes
ids
- containing all Unit to be deletetenantId
- the tenant of operationMetaDataExecutionException
- when delete exception occurredCopyright © 2018 Vitam. All rights reserved.