Class ElasticsearchAccessMetadata

    • Field Detail

      • MAPPING_UNIT_FILE

        public static final java.lang.String MAPPING_UNIT_FILE
        See Also:
        Constant Field Values
      • MAPPING_OBJECT_GROUP_FILE

        public static final java.lang.String MAPPING_OBJECT_GROUP_FILE
        See Also:
        Constant Field Values
    • Constructor Detail

      • ElasticsearchAccessMetadata

        public ElasticsearchAccessMetadata​(java.lang.String clusterName,
                                           java.util.List<ElasticsearchNode> nodes)
                                    throws VitamException,
                                           java.io.IOException
        Parameters:
        clusterName - cluster name
        nodes - list of elasticsearch node
        Throws:
        VitamException - if nodes list is empty
        java.io.IOException
    • Method Detail

      • addIndex

        public final java.util.Map<java.lang.String,​java.lang.String> addIndex​(MetadataCollections collection,
                                                                                     java.lang.Integer tenantId)
        Add a type to an index
        Parameters:
        collection - the working metadata collection
        tenantId - the tenant for operation
        Returns:
        key aliasName value indexName or empty
      • search

        protected final Result search​(MetadataCollections collection,
                                      java.lang.Integer tenantId,
                                      org.elasticsearch.index.query.QueryBuilder query,
                                      java.util.List<org.elasticsearch.search.sort.SortBuilder> sorts,
                                      int offset,
                                      java.lang.Integer limit,
                                      java.util.List<org.elasticsearch.search.aggregations.AggregationBuilder> facets,
                                      java.lang.String scrollId,
                                      java.lang.Integer scrollTimeout)
                               throws MetaDataExecutionException,
                                      BadRequestException
        Parameters:
        collection -
        tenantId -
        query - as in DSL mode "{ "fieldname" : "value" }" "{ "match" : { "fieldname" : "value" } }" "{ "ids" : { " values" : [list of id] } }"
        sorts - the list of sort
        facets - the list of facet
        Returns:
        a structure as ResultInterface
        Throws:
        MetaDataExecutionException
        BadRequestException
      • basicSearch

        public org.elasticsearch.action.search.SearchResponse basicSearch​(MetadataCollections collection,
                                                                          java.lang.Integer tenantId,
                                                                          java.util.List<org.elasticsearch.search.aggregations.AggregationBuilder> aggregations,
                                                                          org.elasticsearch.index.query.QueryBuilder query)
                                                                   throws MetaDataExecutionException
        Makes a search request on elasticsearch on a collection with aggregations and a query
        Parameters:
        collection - on which the request is made
        tenantId - on which the request is made
        aggregations - elasticsearch
        query - elasticsearch
        Returns:
        the elasticsearch SearchResponse
        Throws:
        MetaDataExecutionException