registerDocumentEvents() {
    /**
     * Execute actions on documents in bulk
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object[]} bulk data, in ES format
     * @param {Object} [opts] -- see Elasticsearch "import" options
     * @returns {Promise.<{ items, errors }>
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:bulk`,
      (index, collection, bulk, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.import(index, collection, bulk, opts);
      },
    );

    /**
     * Count how many documents match the provided query
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object} query -- search query
     * @return {Promise.<Number>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:count`,
      (index, collection, query) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.count(index, collection, query);
      },
    );

    /**
     * Create a document
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object} content
     * @param {Object} [opts] -- see Elasticsearch "create" options
     * @returns {Promise.<{ _id, _version, _source }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:create`,
      (index, collection, content, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.create(index, collection, content, opts);
      },
    );

    /**
     * Create or replace a document
     *
     * @param {string} index
     * @param {string} collection
     * @param {string} id -- document unique identifier
     * @param {Object} content
     * @param {Object} [opts] -- see Elasticsearch "createOrReplace" options
     * @returns {Promise.<{ _id, _version, _source, created }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:createOrReplace`,
      (index, collection, id, content, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.createOrReplace(
          index,
          collection,
          id,
          content,
          opts,
        );
      },
    );

    /**
     * Delete a document
     *
     * @param {string} index
     * @param {string} collection
     * @param {string} id
     * @param {Object} [opts] -- see Elasticsearch "delete" options
     * @returns {Promise}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:delete`,
      (index, collection, id, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.delete(index, collection, id, opts);
      },
    );

    /**
     * Delete all documents matching the provided search query
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object} query
     * @param {Object} [opts] -- see Elasticsearch "deleteByQuery" options
     * @returns {Promise.<{ documents, total, deleted, failures: [ id, reason ] }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:deleteByQuery`,
      (index, collection, query, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.deleteByQuery(index, collection, query, opts);
      },
    );

    /**
     * Delete fields of a document
     *
     * @param {string} index
     * @param {string} collection
     * @param {string} id
     * @param {Array}  fields -- fields to delete
     * @param {Object} [opts] -- see Elasticsearch "deleteFields" options
     * @returns {Promise.<{ _id, _version, _source }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:deleteFields`,
      (index, collection, id, fields, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.deleteFields(index, collection, id, fields, opts);
      },
    );

    /**
     * Check if a document exists
     *
     * @param {string} index
     * @param {string} collection
     * @param {string} id -- document unique identifier
     * @returns {Promise.<boolean>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:exist`,
      (index, collection, id) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.exists(index, collection, id);
      },
    );

    /**
     * Check if a document multiple document Exists
     *
     * @param {string} index
     * @param {string} collection
     * @param {string} id -- document unique identifier
     * @returns {Promise.<boolean>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:mExists`,
      (index, collection, ids) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.mExists(index, collection, ids);
      },
    );

    /**
     * Get a document using its unique id
     *
     * @param {string} index
     * @param {string} collection
     * @param {string} id -- document unique identifier
     * @returns {Promise.<{ _id, _version, _source }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:get`,
      (index, collection, id) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.get(index, collection, id);
      },
    );

    /**
     * Import documents as fixtures
     * @param  {Objects} fixtures
     * @return {Promise}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:import`,
      (fixtures, options) => this.loadFixtures(fixtures, options),
    );

    /**
     * Create multiple documents
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object[]} documents
     * @param {Object} [opts] -- see Elasticsearch "mCreate" options
     * @returns {Promise.<{ items, errors }>
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:mCreate`,
      (index, collection, documents, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.mCreate(index, collection, documents, opts);
      },
    );

    /**
     * Create or replace multiple documents
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object[]} documents
     * @param {Object} [opts] -- see Elasticsearch "mCreateOrReplace" options
     * @returns {Promise.<{ items, errors }>
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:mCreateOrReplace`,
      (index, collection, documents, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.mCreateOrReplace(index, collection, documents, opts);
      },
    );

    /**
     * Delete multiple documents
     *
     * @param {string} index
     * @param {string} collection
     * @param {string[]} ids
     * @param {Object} [opts] -- see Elasticsearch "mDelete" options
     * @returns {Promise.<{ documents, errors }>
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:mDelete`,
      (index, collection, ids, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.mDelete(index, collection, ids, opts);
      },
    );

    /**
     * Replace multiple documents
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object[]} documents
     * @param {Object} [opts] -- see Elasticsearch "mReplace" options
     * @returns {Promise.<{ items, errors }>
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:mReplace`,
      (index, collection, documents, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.mReplace(index, collection, documents, opts);
      },
    );

    /**
     * Update multiple documents
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object[]} documents
     * @param {Object} [opts] -- see Elasticsearch "mUpdate" options
     * @returns {Promise.<{ items, errors }>
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:mUpdate`,
      (index, collection, documents, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.mUpdate(index, collection, documents, opts);
      },
    );

    /**
     * Applies a partial update to documents provided in the body.
     * If some of the documents don't already exist, they will be created.
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object[]} documents
     * @param {Object} [opts] -- see Elasticsearch "mUpsert" options
     * @returns {Promise.<{ items, errors }>
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:mUpsert`,
      (index, collection, documents, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.mUpsert(index, collection, documents, opts);
      },
    );

    /**
     * Apply the provided callback to all documents matching a search query
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object} query -- search query (ES format)
     * @param {Function} callback -- callback applied to matched documents
     * @param {Object} [opts] -- see Elasticsearch "mExecute" options
     * @returns {Promise.<any[]>} Array of results returned by the callback
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:mExecute`,
      (index, collection, query, callback, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.mExecute(index, collection, query, callback, opts);
      },
    );

    /**
     * Get multiple documents using their ids
     *
     * @param {string} index
     * @param {string} collection
     * @param {string[]} ids
     * @returns {Promise.<{ items: [ _id, _source, _version ], errors }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:mGet`,
      (index, collection, ids) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.mGet(index, collection, ids);
      },
    );

    /**
     * Replace the content of a document
     *
     * @param {string} index
     * @param {string} collection
     * @param {string} id
     * @param {Object} content -- new document content
     * @param {Object} [opts] -- see Elasticsearch "replace" options
     * @returns {Promise.<{ _id, _version, _source }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:replace`,
      (index, collection, id, content, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.replace(index, collection, id, content, opts);
      },
    );

    /**
     * Fetch the next page of results of a search query
     *
     * @param {string} scrollId
     * @param {Object} [opts] -- see Elasticsearch "scroll" options
     * @returns {Promise.<{ scrollId, hits, aggregations, total }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:scroll`,
      (scrollId, opts) => this.client.scroll(scrollId, opts),
    );

    /**
     * Search for documents
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object} searchBody -- search query, in ES format
     * @param {Object} [opts] -- see Elasticsearch "search" options
     * @returns {Promise.<{ scrollId, hits, aggregations, total }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:search`,
      (index, collection, searchBody, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.search({ collection, index, searchBody }, opts);
      },
    );

    /**
     * Search for multiples documents
     *
     * @param {Object[]} targets
     * @param {Object} searchBody -- search query, in ES format
     * @param {Object} [opts] -- see Elasticsearch "search" options
     * @returns {Promise.<{ scrollId, hits, aggregations, total }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:multiSearch`,
      (targets, searchBody, opts) => {
        for (const target of targets) {
          for (const collection of target.collections) {
            this.cache.assertCollectionExists(target.index, collection);
          }
        }

        return this.client.search({ searchBody, targets }, opts);
      },
    );

    /**
     * Update a document
     *
     * @param {string} index
     * @param {string} collection
     * @param {string} id -- document unique identifier
     * @param {Object} content -- partial content to update
     * @param {Object} [opts] -- see Elasticsearch "update" options
     * @returns {Promise.<{ _id, _version }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:update`,
      (index, collection, id, content, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.update(index, collection, id, content, opts);
      },
    );

    /**
     * Update all documents matching the search query, by applying the same
     * changes to all of them.
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object} query -- search query, in ES format
     * @param {Object} changes -- partial changes to apply to matched documents
     * @param {Object} [opts] -- see Elasticsearch "updateByQuery" options
     * @returns {Promise.<{ successes: [_id, _source, _status], errors: [ document, status, reason ] }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:updateByQuery`,
      (index, collection, query, changes, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.updateByQuery(
          index,
          collection,
          query,
          changes,
          opts,
        );
      },
    );

    /**
     * Directly Update all documents matching the search query (without regards
     * to max documents write limit), by applying the same changes to all of them.
     *
     * @param {string} index
     * @param {string} collection
     * @param {Object} query -- search query, in ES format
     * @param {Object} changes -- partial changes to apply to matched documents
     * @param {Object} [opts] -- see Elasticsearch "updateByQuery" options
     * @returns {Promise.<{ successes: [_id, _source, _status], errors: [ document, status, reason ] }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:bulk:updateByQuery`,
      (index, collection, query, changes, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.bulkUpdateByQuery(
          index,
          collection,
          query,
          changes,
          opts,
        );
      },
    );

    /**
     * Applies a partial update to an existing document.
     * If the document doesn't already exist, a new document is created.
     *
     * @param {string} index
     * @param {string} collection
     * @param {string} id -- document unique identifier
     * @param {Object} content -- partial content to update
     * @param {Object} [opts] -- see Elasticsearch "upsert" options
     * @returns {Promise.<{ _id, _version }>}
     */
    global.kuzzle.onAsk(
      `core:storage:${this.scope}:document:upsert`,
      (index, collection, id, content, opts) => {
        this.cache.assertCollectionExists(index, collection);
        return this.client.upsert(index, collection, id, content, opts);
      },
    );
  }
Return detailed storage stats within this adapter's scope
@returns {Promise.<Object>}