Class VitamElasticsearchRepository
java.lang.Object
fr.gouv.vitam.common.database.api.impl.VitamElasticsearchRepository
Implementation for Elasticsearch
-
Field Summary
-
Constructor Summary
ConstructorDescriptionVitamElasticsearchRepository
(co.elastic.clients.elasticsearch.ElasticsearchClient client, ElasticsearchIndexAliasResolver elasticsearchIndexAliasResolver) VitamElasticsearchRepository Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
Optional<org.bson.Document>
findByIdentifier
(String identifier) Optional<org.bson.Document>
findByIdentifierAndTenant
(String identifier, Integer tenant) Optional<org.bson.Document>
Optional<org.bson.Document>
WARNING: Query all indices.long
purge()
long
void
void
save
(ElasticsearchCollections elasticsearchCollections, List<org.bson.Document> documents) void
save
(org.bson.Document document) co.elastic.clients.elasticsearch.core.SearchResponse<org.bson.Document>
-
Field Details
-
IDENTIFIER
Identifier- See Also:
-
ID
- See Also:
-
-
Constructor Details
-
VitamElasticsearchRepository
public VitamElasticsearchRepository(co.elastic.clients.elasticsearch.ElasticsearchClient client, ElasticsearchIndexAliasResolver elasticsearchIndexAliasResolver) VitamElasticsearchRepository Constructor- Parameters:
client
- the es clientelasticsearchIndexAliasResolver
- the name of the index
-
-
Method Details
-
save
- Throws:
DatabaseException
-
save
- Throws:
DatabaseException
-
save
public void save(ElasticsearchCollections elasticsearchCollections, List<org.bson.Document> documents) throws DatabaseException - Throws:
DatabaseException
-
remove
- Throws:
DatabaseException
-
purge
- Throws:
DatabaseException
-
purge
- Throws:
DatabaseException
-
getByID
- Throws:
DatabaseException
-
getDocumentByIdCrossIndices
WARNING: Query all indices. Use with caution!- Throws:
DatabaseException
-
findByIdentifierAndTenant
public Optional<org.bson.Document> findByIdentifierAndTenant(String identifier, Integer tenant) throws DatabaseException - Throws:
DatabaseException
-
search
public co.elastic.clients.elasticsearch.core.SearchResponse<org.bson.Document> search(String index, co.elastic.clients.elasticsearch._types.query_dsl.Query qb) throws DatabaseException - Throws:
DatabaseException
-
findByIdentifier
- Throws:
DatabaseException
-
delete
- Throws:
DatabaseException
-