import _ from "lodash"; import { Client, RequestParams } from "sdk-es7"; import { TypeMapping } from "sdk-es7/api/types"; import { InfoResult, JSONObject, KRequestBody, KRequestParams } from "../../../types/storage/7/Elasticsearch"; import { storeScopeEnum } from "../../../core/storage/storeScopeEnum"; import { QueryTranslator } from "../commons/queryTranslator"; import ESWrapper from "./esWrapper"; /** * @param {Kuzzle} kuzzle kuzzle instance * @param {Object} config Service configuration * @param {storeScopeEnum} scope * @constructor */ export declare class ES7 { _client: Client; _scope: storeScopeEnum; _indexPrefix: string; _esWrapper: ESWrapper; _esVersion: any; _translator: QueryTranslator; searchBodyKeys: string[]; scriptKeys: string[]; scriptAllowedArgs: string[]; maxScrollDuration: number; scrollTTL: number; _config: any; private readonly logger; constructor(config: any, scope?: storeScopeEnum); get scope(): storeScopeEnum; /** * Initializes the elasticsearch client * * @override * @returns {Promise} */ _initSequence(): Promise; /** * Translate Koncorde filters to Elasticsearch query * * @param {Object} filters - Set of valid Koncorde filters * @returns {Object} Equivalent Elasticsearch query */ translateKoncordeFilters(filters: any): any; /** * Returns some basic information about this service * @override * * @returns {Promise.} service informations */ info(): Promise; /** * Returns detailed multi-level storage stats data * * @returns {Promise.} */ stats(): Promise<{ indexes: unknown[]; size: number; }>; /** * Scrolls results from previous elasticsearch query. * Automatically clears the scroll context after the last result page has * been fetched. * * @param {String} scrollId - Scroll identifier * @param {Object} options - scrollTTL (default scrollTTL) * * @returns {Promise.<{ scrollId, hits, aggregations, total }>} */ scroll(scrollId: string, { scrollTTL }?: { scrollTTL?: string; }): Promise<{ aggregations: any; hits: { _id: any; _score: any; _source: any; collection: any; highlight: any; index: any; inner_hits: {}; }[]; remaining: any; scrollId: any; suggest: any; total: any; }>; /** * Searches documents from elasticsearch with a query * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object} searchBody - Search request body (query, sort, etc.) * @param {Object} options - from (undefined), size (undefined), scroll (undefined) * * @returns {Promise.<{ scrollId, hits, aggregations, suggest, total }>} */ search({ index, collection, searchBody, targets, }?: { index?: string; collection?: string; searchBody?: JSONObject; targets?: any[]; }, { from, size, scroll, }?: { from?: number; size?: number; scroll?: string; }): Promise<{ aggregations: any; hits: { _id: any; _score: any; _source: any; collection: any; highlight: any; index: any; inner_hits: {}; }[]; remaining: any; scrollId: any; suggest: any; total: any; }>; /** * Generate a map that associate an alias to a pair of index and collection * * @param {*} targets * @returns */ _mapTargetsToAlias(targets: any): {}; _formatSearchResult(body: any, searchInfo?: any): Promise<{ aggregations: any; hits: { _id: any; _score: any; _source: any; collection: any; highlight: any; index: any; inner_hits: {}; }[]; remaining: any; scrollId: any; suggest: any; total: any; }>; /** * Gets the document with given ID * * @param {String} index - Index name * @param {String} collection - Collection name * @param {String} id - Document ID * * @returns {Promise.<{ _id, _version, _source }>} */ get(index: any, collection: any, id: any): Promise; /** * Returns the list of documents matching the ids given in the body param * NB: Due to internal Kuzzle mechanism, can only be called on a single * index/collection, using the body { ids: [.. } syntax. * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Array.} ids - Document IDs * * @returns {Promise.<{ items: Array<{ _id, _source, _version }>, errors }>} */ mGet(index: string, collection: string, ids: string[]): Promise<{ errors: any[]; item: any[]; items?: undefined; } | { errors: any[]; items: any[]; item?: undefined; }>; /** * Counts how many documents match the filter given in body * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object} searchBody - Search request body (query, sort, etc.) * * @returns {Promise.} count */ count(index: string, collection: string, searchBody?: {}): Promise; /** * Sends the new document to elasticsearch * Cleans data to match elasticsearch specifications * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object} content - Document content * @param {Object} options - id (undefined), refresh (undefined), userId (null) * * @returns {Promise.} { _id, _version, _source } */ create(index: string, collection: string, content: JSONObject, { id, refresh, userId, injectKuzzleMeta, }?: { id?: string; refresh?: boolean | "wait_for"; userId?: string; injectKuzzleMeta?: boolean; }): Promise<{ _id: any; _source: KRequestBody; _version: any; }>; /** * Creates a new document to Elasticsearch, or replace it if it already exist * * @param {String} index - Index name * @param {String} collection - Collection name * @param {String} id - Document id * @param {Object} content - Document content * @param {Object} options - refresh (undefined), userId (null), injectKuzzleMeta (true) * * @returns {Promise.} { _id, _version, _source, created } */ createOrReplace(index: any, collection: any, id: any, content: any, { refresh, userId, injectKuzzleMeta, }?: { refresh?: boolean | "wait_for"; userId?: string; injectKuzzleMeta?: boolean; }): Promise<{ _id: any; _source: any; _version: any; created: boolean; }>; /** * Sends the partial document to elasticsearch with the id to update * * @param {String} index - Index name * @param {String} collection - Collection name * @param {String} id - Document id * @param {Object} content - Updated content * @param {Object} options - refresh (undefined), userId (null), retryOnConflict (0) * * @returns {Promise.<{ _id, _version }>} */ update(index: string, collection: string, id: string, content: JSONObject, { refresh, userId, retryOnConflict, injectKuzzleMeta, }?: { refresh?: boolean | "wait_for"; userId?: string; retryOnConflict?: number; injectKuzzleMeta?: boolean; }): Promise<{ _id: any; _source: any; _version: any; }>; /** * Sends the partial document to elasticsearch with the id to update * Creates the document if it doesn't already exist * * @param {String} index - Index name * @param {String} collection - Collection name * @param {String} id - Document id * @param {Object} content - Updated content * @param {Object} options - defaultValues ({}), refresh (undefined), userId (null), retryOnConflict (0) * * @returns {Promise.<{ _id, _version }>} */ upsert(index: string, collection: string, id: string, content: JSONObject, { defaultValues, refresh, userId, retryOnConflict, injectKuzzleMeta, }?: { defaultValues?: JSONObject; refresh?: boolean | "wait_for"; userId?: string; retryOnConflict?: number; injectKuzzleMeta?: boolean; }): Promise<{ _id: any; _source: any; _version: any; created: boolean; }>; /** * Replaces a document to Elasticsearch * * @param {String} index - Index name * @param {String} collection - Collection name * @param {String} id - Document id * @param {Object} content - Document content * @param {Object} options - refresh (undefined), userId (null) * * @returns {Promise.<{ _id, _version, _source }>} */ replace(index: string, collection: string, id: string, content: JSONObject, { refresh, userId, injectKuzzleMeta, }?: { refresh?: boolean | "wait_for"; userId?: string; injectKuzzleMeta?: boolean; }): Promise<{ _id: string; _source: JSONObject; _version: any; }>; /** * Sends to elasticsearch the document id to delete * * @param {String} index - Index name * @param {String} collection - Collection name * @param {String} id - Document id * @param {Object} options - refresh (undefined) * * @returns {Promise} */ delete(index: string, collection: string, id: string, { refresh, }?: { refresh?: boolean | "wait_for"; }): Promise; /** * Deletes all documents matching the provided filters. * If fetch=false, the max documents write limit is not applied. * * Options: * - size: size of the batch to retrieve documents (no-op if fetch=false) * - refresh: refresh option for ES * - fetch: if true, will fetch the documents before delete them * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object} query - Query to match documents * @param {Object} options - size (undefined), refresh (undefined), fetch (true) * * @returns {Promise.<{ documents, total, deleted, failures: Array<{ _shardId, reason }> }>} */ deleteByQuery(index: string, collection: string, query: JSONObject, { refresh, size, fetch, }?: { refresh?: boolean | "wait_for"; size?: number; fetch?: boolean; }): Promise<{ deleted: any; documents: any[]; failures: any; total: any; }>; /** * Delete fields of a document and replace it * * @param {String} index - Index name * @param {String} collection - Collection name * @param {String} id - Document id * @param {Array} fields - Document fields to be removed * @param {Object} options - refresh (undefined), userId (null) * * @returns {Promise.<{ _id, _version, _source }>} */ deleteFields(index: string, collection: string, id: string, fields: string, { refresh, userId, }?: { refresh?: boolean | "wait_for"; userId?: string; }): Promise<{ _id: string; _source: any; _version: any; }>; /** * Updates all documents matching the provided filters * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object} query - Query to match documents * @param {Object} changes - Changes wanted on documents * @param {Object} options - refresh (undefined), size (undefined) * * @returns {Promise.<{ successes: [_id, _source, _status], errors: [ document, status, reason ] }>} */ updateByQuery(index: string, collection: string, query: JSONObject, changes: JSONObject, { refresh, size, userId, }?: { refresh?: boolean | "wait_for"; size?: number; userId?: string; }): Promise<{ errors: any; successes: any; }>; /** * Updates all documents matching the provided filters * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object} query - Query to match documents * @param {Object} changes - Changes wanted on documents * @param {Object} options - refresh (undefined) * * @returns {Promise.<{ successes: [_id, _source, _status], errors: [ document, status, reason ] }>} */ bulkUpdateByQuery(index: string, collection: string, query: JSONObject, changes: JSONObject, { refresh, }?: { refresh?: boolean; }): Promise<{ updated: any; }>; /** * Execute the callback with a batch of documents of specified size until all * documents matched by the query have been processed. * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object} query - Query to match documents * @param {Function} callback - callback that will be called with the "hits" array * @param {Object} options - size (10), scrollTTL ('5s') * * @returns {Promise.} Array of results returned by the callback */ mExecute(index: string, collection: string, query: JSONObject, callback: any, { size, scrollTTl, }?: { size?: number; scrollTTl?: string; }): Promise; /** * Creates a new index. * * This methods creates an hidden collection in the provided index to be * able to list it. * This methods resolves if the index name does not already exists either as * private or public index. * * @param {String} index - Index name * * @returns {Promise} */ createIndex(index: string): Promise; /** * Creates an empty collection. * Mappings and settings will be applied if supplied. * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object} config - mappings ({}), settings ({}) * * @returns {Promise} */ createCollection(index: string, collection: string, { mappings, settings, }?: { mappings?: TypeMapping; settings?: Record; }): Promise; /** * Retrieves settings definition for index/type * * @param {String} index - Index name * @param {String} collection - Collection name * * @returns {Promise.<{ settings }>} */ getSettings(index: string, collection: string): Promise; /** * Retrieves mapping definition for index/type * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object} options - includeKuzzleMeta (false) * * @returns {Promise.<{ dynamic, _meta, properties }>} */ getMapping(index: string, collection: string, { includeKuzzleMeta, }?: { includeKuzzleMeta?: boolean; }): Promise<{ _meta: any; dynamic: any; properties: any; }>; /** * Updates a collection mappings and settings * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object} config - mappings ({}), settings ({}) * * @returns {Promise} */ updateCollection(index: string, collection: string, { mappings, reindexCollection, settings, }?: { mappings?: TypeMapping; reindexCollection?: boolean; settings?: Record; }): Promise; /** * Given index settings we return a new version of index settings * only with allowed settings that can be set (during update or create index). * @param indexSettings the index settings * @returns {{index: *}} a new index settings with only allowed settings. */ getAllowedIndexSettings(indexSettings: any): { index: _.Omit; }; /** * Sends an empty UpdateByQuery request to update the search index * * @param {String} index - Index name * @param {String} collection - Collection name * @returns {Promise.} {} */ updateSearchIndex(index: string, collection: string): Promise; /** * Update a collection mappings * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object} mappings - Collection mappings in ES format * * @returns {Promise.<{ dynamic, _meta, properties }>} */ updateMapping(index: string, collection: string, mappings?: TypeMapping): Promise<{ dynamic: string; _meta: JSONObject; properties: JSONObject; }>; /** * Updates a collection settings (eg: analyzers) * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object} settings - Collection settings in ES format * * @returns {Promise} */ updateSettings(index: any, collection: any, settings?: {}): Promise; /** * Empties the content of a collection. Keep the existing mapping and settings. * * @param {String} index - Index name * @param {String} collection - Collection name * * @returns {Promise} */ truncateCollection(index: string, collection: string): Promise; /** * Runs several action and document * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object[]} documents - Documents to import * @param {Object} options - timeout (undefined), refresh (undefined), userId (null) * * @returns {Promise.<{ items, errors }> */ import(index: string, collection: string, documents: JSONObject[], { refresh, timeout, userId, }?: { refresh?: boolean | "wait_for"; timeout?: string; userId?: string; }): Promise<{ errors: any[]; items: any[]; }>; /** * Retrieves the complete list of existing collections in the current index * * @param {String} index - Index name * @param {Object.Boolean} includeHidden - Optional: include HIDDEN_COLLECTION in results * * @returns {Promise.} Collection names */ listCollections(index: any, { includeHidden }?: { includeHidden?: boolean; }): Promise; /** * Retrieves the complete list of indexes * * @returns {Promise.} Index names */ listIndexes(): Promise; /** * Returns an object containing the list of indexes and collections * * @returns {Object.} Object */ getSchema(): Promise<{}>; /** * Retrieves the complete list of aliases * * @returns {Promise.} [ { alias, index, collection, indice } ] */ listAliases(): Promise; /** * Deletes a collection * * @param {String} index - Index name * @param {String} collection - Collection name * * @returns {Promise} */ deleteCollection(index: string, collection: string): Promise; /** * Deletes multiple indexes * * @param {String[]} indexes - Index names * * @returns {Promise.} */ deleteIndexes(indexes?: string[]): Promise; /** * Deletes an index * * @param {String} index - Index name * * @returns {Promise} */ deleteIndex(index: string): Promise; /** * Forces a refresh on the collection. * * /!\ Can lead to some performance issues. * cf https://www.elastic.co/guide/en/elasticsearch/guide/current/near-real-time.html for more details * * @param {String} index - Index name * @param {String} collection - Collection name * * @returns {Promise.} { _shards } */ refreshCollection(index: string, collection: string): Promise<{ _shards: any; }>; /** * Returns true if the document exists * * @param {String} index - Index name * @param {String} collection - Collection name * @param {String} id - Document ID * * @returns {Promise.} */ exists(index: string, collection: string, id: string): Promise; /** * Returns the list of documents existing with the ids given in the body param * NB: Due to internal Kuzzle mechanism, can only be called on a single * index/collection, using the body { ids: [.. } syntax. * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Array.} ids - Document IDs * * @returns {Promise.<{ items: Array<{ _id, _source, _version }>, errors }>} */ mExists(index: string, collection: string, ids: string[]): Promise<{ errors: any[]; item: any[]; items?: undefined; } | { errors: any[]; items: any[]; item?: undefined; }>; /** * Returns true if the index exists * * @param {String} index - Index name * * @returns {Promise.} */ hasIndex(index: string): Promise; /** * Returns true if the collection exists * * @param {String} index - Index name * @param {String} collection - Collection name * * @returns {Promise.} */ hasCollection(index: string, collection: string): Promise; /** * Returns true if the index has the hidden collection * * @param {String} index - Index name * * @returns {Promise.} */ _hasHiddenCollection(index: any): Promise; /** * Creates multiple documents at once. * If a content has no id, one is automatically generated and assigned to it. * If a content has a specified identifier, it is rejected if it already exists * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object[]} documents - Documents * @param {Object} options - timeout (undefined), refresh (undefined), userId (null) * * @returns {Promise.} { items, errors } */ mCreate(index: string, collection: string, documents: JSON[], { refresh, timeout, userId, }?: { refresh?: boolean | "wait_for"; timeout?: string; userId?: string; }): Promise; /** * Creates or replaces multiple documents at once. * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object[]} documents - Documents * @param {Object} options - timeout (undefined), refresh (undefined), userId (null), injectKuzzleMeta (false), limits (true) * * @returns {Promise.<{ items, errors }> */ mCreateOrReplace(index: string, collection: string, documents: JSONObject[], { refresh, timeout, userId, injectKuzzleMeta, limits, source, }?: KRequestParams): Promise; /** * Updates multiple documents with one request * Replacements are rejected if targeted documents do not exist * (like with the normal "update" method) * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object[]} documents - Documents * @param {Object} options - timeout (undefined), refresh (undefined), retryOnConflict (0), userId (null) * * @returns {Promise.} { items, errors } */ mUpdate(index: string, collection: string, documents: JSONObject[], { refresh, retryOnConflict, timeout, userId, }?: { refresh?: any; retryOnConflict?: number; timeout?: any; userId?: any; }): Promise; /** * Creates or replaces multiple documents at once. * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object[]} documents - Documents * @param {Object} options - refresh (undefined), retryOnConflict (0), timeout (undefined), userId (null) * * @returns {Promise.<{ items, errors }> */ mUpsert(index: string, collection: string, documents: JSONObject[], { refresh, retryOnConflict, timeout, userId, }?: { refresh?: boolean | "wait_for"; retryOnConflict?: number; timeout?: string; userId?: string; }): Promise; /** * Replaces multiple documents at once. * Replacements are rejected if targeted documents do not exist * (like with the normal "replace" method) * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Object[]} documents - Documents * @param {Object} options - timeout (undefined), refresh (undefined), userId (null) * * @returns {Promise.} { items, errors } */ mReplace(index: string, collection: string, documents: JSONObject[], { refresh, timeout, userId, }?: { refresh?: boolean | "wait_for"; timeout?: string; userId?: string; }): Promise; /** * Deletes multiple documents with one request * * @param {String} index - Index name * @param {String} collection - Collection name * @param {Array.} ids - Documents IDs * @param {Object} options - timeout (undefined), refresh (undefined) * * @returns {Promise.<{ documents, errors }> */ mDelete(index: string, collection: string, ids: string[], { refresh, }?: { refresh?: boolean | "wait_for"; timeout?: number; }): Promise<{ documents: any[]; errors: any[]; }>; /** * Executes an ES request prepared by mcreate, mupdate, mreplace, mdelete or mwriteDocuments * Returns a standardized ES response object, containing the list of * successfully performed operations, and the rejected ones * * @param {Object} esRequest - Elasticsearch request * @param {Object[]} documents - Document sources (format: {_id, _source}) * @param {Object[]} partialErrors - pre-rejected documents * @param {Object} options - limits (true) * * @returns {Promise.} results */ _mExecute(esRequest: RequestParams.Bulk, documents: JSONObject[], partialErrors?: JSONObject[], { limits, source }?: { limits?: boolean; source?: boolean; }): Promise; /** * Extracts, injects metadata and validates documents contained * in a Request * * Used by mCreate, mUpdate, mUpsert, mReplace and mCreateOrReplace * * @param {Object[]} documents - Documents * @param {Object} metadata - Kuzzle metadata * @param {Object} options - prepareMGet (false), requireId (false) * * @returns {Object} { rejected, extractedDocuments, documentsToGet } */ _extractMDocuments(documents: JSONObject[], metadata: JSONObject, { prepareMGet, requireId, prepareMUpsert }?: { prepareMGet?: boolean; requireId?: boolean; prepareMUpsert?: boolean; }): { documentsToGet: any[]; extractedDocuments: any[]; rejected: any[]; }; private _hasExceededLimit; private _processExtract; /** * Throws an error if the provided mapping is invalid * * @param {Object} mapping * @throws */ _checkMappings(mapping: JSONObject, path?: any[], check?: boolean): void; /** * Given index + collection, returns the associated alias name. * Prefer this function to `_getIndice` and `_getAvailableIndice` whenever it is possible. * * @param {String} index * @param {String} collection * * @returns {String} Alias name (eg: '@&nepali.liia') */ _getAlias(index: any, collection: any): string; /** * Given an alias name, returns the associated index name. */ _checkIfAliasExists(aliasName: any): Promise; /** * Given index + collection, returns the associated indice name. * Use this function if ES does not accept aliases in the request. Otherwise use `_getAlias`. * * @param {String} index * @param {String} collection * * @returns {String} Indice name (eg: '&nepali.liia') * @throws If there is not exactly one indice associated */ _getIndice(index: string, collection: string): Promise; /** * Given an ES Request returns the settings of the corresponding indice. * * @param esRequest the ES Request with wanted settings. * @return {Promise<*>} the settings of the indice. * @private */ _getSettings(esRequest: RequestParams.IndicesGetSettings): Promise; /** * Given index + collection, returns an available indice name. * Use this function when creating the associated indice. Otherwise use `_getAlias`. * * @param {String} index * @param {String} collection * * @returns {String} Available indice name (eg: '&nepali.liia2') */ _getAvailableIndice(index: string, collection: string): Promise; /** * Given an indice, returns the associated alias name. * * @param {String} indice * * @returns {String} Alias name (eg: '@&nepali.liia') * @throws If there is not exactly one alias associated that is prefixed with @ */ _getAliasFromIndice(indice: string): Promise; /** * Check for each indice whether it has an alias or not. * When the latter is missing, create one based on the indice name. * * This check avoids a breaking change for those who were using Kuzzle before * alias attribution for each indice turned into a standard (appear in 2.14.0). */ generateMissingAliases(): Promise; /** * Throws if index or collection includes forbidden characters * * @param {String} index * @param {String} collection */ _assertValidIndexAndCollection(index: any, collection?: any): void; /** * Given an alias, extract the associated index. * * @param {String} alias * * @returns {String} Index name */ _extractIndex(alias: any): any; /** * Given an alias, extract the associated collection. * * @param {String} alias * * @returns {String} Collection name */ _extractCollection(alias: any): any; /** * Given aliases, extract indexes and collections. * * @param {Array.} aliases * @param {Object.Boolean} includeHidden Only refers to `HIDDEN_COLLECTION` occurences. An empty index will still be listed. Default to `false`. * * @returns {Object.} Indexes as key and an array of their collections as value */ _extractSchema(aliases: string[], { includeHidden }?: { includeHidden?: boolean; }): {}; /** * Creates the hidden collection on the provided index if it does not already * exists * * @param {String} index Index name */ _createHiddenCollection(index: any): Promise; /** * We need to always wait for a minimal number of shards to be available * before answering to the client. This is to avoid Elasticsearch node * to return a 404 Not Found error when the client tries to index a * document in the index. * To find the best value for this setting, we need to take into account * the number of nodes in the cluster and the number of shards per index. */ _getWaitForActiveShards(): Promise; /** * Scroll indice in elasticsearch and return all document that match the filter * /!\ throws a write_limit_exceed error: this method is intended to be used * by deleteByQuery and updateByQuery * * @param {Object} esRequest - Search request body * * @returns {Promise.} resolve to an array of documents */ _getAllDocumentsFromQuery(esRequest: RequestParams.Search>): Promise; /** * Clean and normalize the searchBody * Ensure only allowed parameters are passed to ES * * @param {Object} searchBody - ES search body (with query, aggregations, sort, etc) */ _sanitizeSearchBody(searchBody: any): any; /** * Throw if a script is used in the query. * * Only Stored Scripts are accepted * * @param {Object} object */ _scriptCheck(object: any): void; /** * Checks if a collection name is valid * @param {string} name * @returns {Boolean} */ isCollectionNameValid(name: any): boolean; /** * Checks if a collection name is valid * @param {string} name * @returns {Boolean} */ isIndexNameValid(name: any): boolean; /** * Clears an allocated scroll * @param {[type]} id [description] * @returns {[type]} [description] */ clearScroll(id?: string): Promise; /** * Loads a configuration value from services.storageEngine and assert a valid * ms format. * * @param {String} key - relative path to the key in configuration * * @returns {Number} milliseconds */ _loadMsConfig(key: any): number; /** * Returns true if one of the mappings dynamic property changes value from * false to true */ _dynamicChanges(previousMappings: any, newMappings: any): boolean; waitForElasticsearch(): Promise; /** * Checks if the dynamic properties are correct */ _checkDynamicProperty(mappings: any): void; _setLastActionToKuzzleMeta(esRequest: JSONObject, alias: string, kuzzleMeta: JSONObject): void; _setLastActionToKuzzleMetaUpdate(item: JSONObject, kuzzleMeta: JSONObject): void; _getRandomNumber(number: number): number; }