Class 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 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 name
        nodes - elasticsearch node
        Throws:
        VitamException - if elasticsearch nodes list is empty/null
        java.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 index
        tenantId - 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 index
        tenantId - tenant Id
        query - as in DSL mode "{ "fieldname" : "value" }" "{ "match" : { "fieldname" : "value" } }" "{ "ids" : { " values" : [list of id] } }"
        filter - the filter
        sorts - the list of sort
        offset - the offset
        limit - the limit
        Returns:
        a structure as SearchResponse
        Throws:
        LogbookException - thrown of an error occurred while executing the request