diff --git a/api/api/async_search.js b/api/api/async_search.js index d7e4ee8e7..0a16b39da 100644 --- a/api/api/async_search.js +++ b/api/api/async_search.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion_timeout', 'keep_alive', 'typed_keys', 'keep_on_completion', 'batched_reduce_size', 'request_cache', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'search_type', 'size', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'version', 'seq_no_primary_term', 'max_concurrent_shard_requests'] -const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletionTimeout: 'wait_for_completion_timeout', keepAlive: 'keep_alive', typedKeys: 'typed_keys', keepOnCompletion: 'keep_on_completion', batchedReduceSize: 'batched_reduce_size', requestCache: 'request_cache', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', docvalueFields: 'docvalue_fields', ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', suggestSize: 'suggest_size', suggestText: 'suggest_text', trackScores: 'track_scores', trackTotalHits: 'track_total_hits', allowPartialSearchResults: 'allow_partial_search_results', seqNoPrimaryTerm: 'seq_no_primary_term', maxConcurrentShardRequests: 'max_concurrent_shard_requests' } +const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion_timeout', 'keep_alive', 'typed_keys', 'keep_on_completion', 'batched_reduce_size', 'request_cache', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'search_type', 'size', 'sort', '_source', '_source_excludes', '_source_includes', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'version', 'seq_no_primary_term', 'max_concurrent_shard_requests'] +const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletionTimeout: 'wait_for_completion_timeout', keepAlive: 'keep_alive', typedKeys: 'typed_keys', keepOnCompletion: 'keep_on_completion', batchedReduceSize: 'batched_reduce_size', requestCache: 'request_cache', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', docvalueFields: 'docvalue_fields', ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', suggestSize: 'suggest_size', suggestText: 'suggest_text', trackScores: 'track_scores', trackTotalHits: 'track_total_hits', allowPartialSearchResults: 'allow_partial_search_results', seqNoPrimaryTerm: 'seq_no_primary_term', maxConcurrentShardRequests: 'max_concurrent_shard_requests' } function AsyncSearchApi (transport, ConfigurationError) { this.transport = transport diff --git a/api/api/async_search.submit.js b/api/api/async_search.submit.js deleted file mode 100644 index 99df278ef..000000000 --- a/api/api/async_search.submit.js +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildAsyncSearchSubmit (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'wait_for_completion_timeout', - 'keep_on_completion', - 'keep_alive', - 'batched_reduce_size', - 'request_cache', - 'analyzer', - 'analyze_wildcard', - 'default_operator', - 'df', - 'explain', - 'stored_fields', - 'docvalue_fields', - 'from', - 'ignore_unavailable', - 'ignore_throttled', - 'allow_no_indices', - 'expand_wildcards', - 'lenient', - 'preference', - 'q', - 'routing', - 'search_type', - 'size', - 'sort', - '_source', - '_source_excludes', - '_source_includes', - 'terminate_after', - 'stats', - 'suggest_field', - 'suggest_mode', - 'suggest_size', - 'suggest_text', - 'timeout', - 'track_scores', - 'track_total_hits', - 'allow_partial_search_results', - 'typed_keys', - 'version', - 'seq_no_primary_term', - 'max_concurrent_shard_requests' - ] - - const snakeCase = { - waitForCompletionTimeout: 'wait_for_completion_timeout', - keepOnCompletion: 'keep_on_completion', - keepAlive: 'keep_alive', - batchedReduceSize: 'batched_reduce_size', - requestCache: 'request_cache', - analyzeWildcard: 'analyze_wildcard', - defaultOperator: 'default_operator', - storedFields: 'stored_fields', - docvalueFields: 'docvalue_fields', - ignoreUnavailable: 'ignore_unavailable', - ignoreThrottled: 'ignore_throttled', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - searchType: 'search_type', - _sourceExcludes: '_source_excludes', - _sourceIncludes: '_source_includes', - terminateAfter: 'terminate_after', - suggestField: 'suggest_field', - suggestMode: 'suggest_mode', - suggestSize: 'suggest_size', - suggestText: 'suggest_text', - trackScores: 'track_scores', - trackTotalHits: 'track_total_hits', - allowPartialSearchResults: 'allow_partial_search_results', - typedKeys: 'typed_keys', - seqNoPrimaryTerm: 'seq_no_primary_term', - maxConcurrentShardRequests: 'max_concurrent_shard_requests' - } - - /** - * Perform a async_search.submit request - * Executes a search request asynchronously. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html - */ - return function asyncSearchSubmit (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_async_search' - } else { - if (method == null) method = 'POST' - path = '/' + '_async_search' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildAsyncSearchSubmit diff --git a/api/api/bulk.js b/api/api/bulk.js index c6dcdcc5d..5dfaeba94 100644 --- a/api/api/bulk.js +++ b/api/api/bulk.js @@ -23,36 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['wait_for_active_shards', 'refresh', 'routing', 'timeout', 'type', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pipeline', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['wait_for_active_shards', 'refresh', 'routing', 'timeout', 'type', '_source', '_source_excludes', '_source_includes', 'pipeline', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'wait_for_active_shards', - 'refresh', - 'routing', - 'timeout', - 'type', - '_source', - '_source_excludes', - '_source_includes', - 'pipeline', - 'require_alias', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - waitForActiveShards: 'wait_for_active_shards', - _sourceExcludes: '_source_excludes', - _sourceIncludes: '_source_includes', - requireAlias: 'require_alias', - errorTrace: 'error_trace', - filterPath: 'filter_path' -======= function bulkApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -60,7 +33,6 @@ function bulkApi (params, options, callback) { if (params['body'] == null) { const err = new this[kConfigurationError]('Missing required parameter: body') return handleError(err, callback) ->>>>>>> a064f0f3... Improve child performances (#1314) } // check required url components diff --git a/api/api/cat.js b/api/api/cat.js index 5958aa02b..71ff1d922 100644 --- a/api/api/cat.js +++ b/api/api/cat.js @@ -23,7 +23,7 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'full_id', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'node_id', 'actions', 'parent_task', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from', 'size'] +const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'full_id', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'node_id', 'actions', 'parent_task', 'size', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from'] const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', fullId: 'full_id', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', nodeId: 'node_id', parentTask: 'parent_task', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs' } function CatApi (transport, ConfigurationError) { diff --git a/api/api/cat.nodes.js b/api/api/cat.nodes.js deleted file mode 100644 index 12f67096f..000000000 --- a/api/api/cat.nodes.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatNodes (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'bytes', - 'format', - 'full_id', - 'local', - 'master_timeout', - 'h', - 'help', - 's', - 'time', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - fullId: 'full_id', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.nodes request - * Returns basic statistics about performance of cluster nodes. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html - */ - return function catNodes (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'nodes' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatNodes diff --git a/api/api/cat.thread_pool.js b/api/api/cat.thread_pool.js deleted file mode 100644 index 9016ee1ff..000000000 --- a/api/api/cat.thread_pool.js +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatThreadPool (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'size', - 'local', - 'master_timeout', - 'h', - 'help', - 's', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.thread_pool request - * Returns cluster-wide thread pool statistics per node. -By default the active, queue and rejected statistics are returned for all thread pools. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html - */ - return function catThreadPool (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((thread_pool_patterns || threadPoolPatterns) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'thread_pool' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatThreadPool diff --git a/api/api/close_point_in_time.js b/api/api/close_point_in_time.js index c66305b11..8bee84329 100644 --- a/api/api/close_point_in_time.js +++ b/api/api/close_point_in_time.js @@ -44,58 +44,7 @@ function closePointInTimeApi (params, options, callback) { querystring } -<<<<<<< HEAD - /** - * Perform a close_point_in_time request - * Close a point in time - * https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time.html - */ - return function closePointInTime (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_pit' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -======= return this.transport.request(request, options, callback) ->>>>>>> a064f0f3... Improve child performances (#1314) } module.exports = closePointInTimeApi diff --git a/api/api/count.js b/api/api/count.js index c6a1f75b1..5d788bbd1 100644 --- a/api/api/count.js +++ b/api/api/count.js @@ -29,11 +29,20 @@ const snakeCase = { ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'i function countApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_count' } else { @@ -41,76 +50,12 @@ function countApi (params, options, callback) { path = '/' + '_count' } -<<<<<<< HEAD - /** - * Perform a count request - * Returns number of documents matching a query. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html - */ - return function count (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_count' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_count' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) -======= // build request object const request = { method, path, body: body || '', querystring ->>>>>>> a064f0f3... Improve child performances (#1314) } return this.transport.request(request, options, callback) diff --git a/api/api/delete_by_query.js b/api/api/delete_by_query.js index 4fc588483..3a6a9a3d9 100644 --- a/api/api/delete_by_query.js +++ b/api/api/delete_by_query.js @@ -23,130 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'max_docs', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'version', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'size', 'max_docs', 'sort', '_source', '_source_excludes', '_source_includes', 'terminate_after', 'stats', 'version', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', terminateAfter: 'terminate_after', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'analyzer', - 'analyze_wildcard', - 'default_operator', - 'df', - 'from', - 'ignore_unavailable', - 'allow_no_indices', - 'conflicts', - 'expand_wildcards', - 'lenient', - 'preference', - 'q', - 'routing', - 'scroll', - 'search_type', - 'search_timeout', - 'size', - 'max_docs', - 'sort', - '_source', - '_source_excludes', - '_source_includes', - 'terminate_after', - 'stats', - 'version', - 'request_cache', - 'refresh', - 'timeout', - 'wait_for_active_shards', - 'scroll_size', - 'wait_for_completion', - 'requests_per_second', - 'slices', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - analyzeWildcard: 'analyze_wildcard', - defaultOperator: 'default_operator', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - searchType: 'search_type', - searchTimeout: 'search_timeout', - maxDocs: 'max_docs', - _sourceExcludes: '_source_excludes', - _sourceIncludes: '_source_includes', - terminateAfter: 'terminate_after', - requestCache: 'request_cache', - waitForActiveShards: 'wait_for_active_shards', - scrollSize: 'scroll_size', - waitForCompletion: 'wait_for_completion', - requestsPerSecond: 'requests_per_second', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a delete_by_query request - * Deletes documents matching the provided query. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html - */ - return function deleteByQuery (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query' - } else { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query' - } -======= function deleteByQueryApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -160,13 +39,23 @@ function deleteByQueryApi (params, options, callback) { return handleError(err, callback) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) ->>>>>>> a064f0f3... Improve child performances (#1314) var path = '' - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query' + if ((index) != null && (type) != null) { + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query' + } else { + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query' + } // build request object const request = { diff --git a/api/api/exists.js b/api/api/exists.js index 5963b6997..5e907fd96 100644 --- a/api/api/exists.js +++ b/api/api/exists.js @@ -23,89 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'stored_fields', - 'preference', - 'realtime', - 'refresh', - 'routing', - '_source', - '_source_excludes', - '_source_includes', - 'version', - 'version_type', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - storedFields: 'stored_fields', - _sourceExcludes: '_source_excludes', - _sourceIncludes: '_source_includes', - versionType: 'version_type', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a exists request - * Returns information about whether a document exists in an index. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html - */ - return function exists (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = 'HEAD' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) - } else { - if (method == null) method = 'HEAD' - path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) - } -======= function existsApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -119,13 +39,17 @@ function existsApi (params, options, callback) { return handleError(err, callback) } - var { method, body, id, index, ...querystring } = params + var { method, body, id, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) ->>>>>>> a064f0f3... Improve child performances (#1314) var path = '' - if (method == null) method = 'HEAD' - path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) + if ((index) != null && (type) != null && (id) != null) { + if (method == null) method = 'HEAD' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + } else { + if (method == null) method = 'HEAD' + path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) + } // build request object const request = { diff --git a/api/api/exists_source.js b/api/api/exists_source.js index 6b03b96ef..930bc72ab 100644 --- a/api/api/exists_source.js +++ b/api/api/exists_source.js @@ -23,34 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'preference', - 'realtime', - 'refresh', - 'routing', - '_source', - '_source_excludes', - '_source_includes', - 'version', - 'version_type', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - _sourceExcludes: '_source_excludes', - _sourceIncludes: '_source_includes', - versionType: 'version_type', - errorTrace: 'error_trace', - filterPath: 'filter_path' -======= function existsSourceApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -62,7 +37,6 @@ function existsSourceApi (params, options, callback) { if (params['index'] == null) { const err = new this[kConfigurationError]('Missing required parameter: index') return handleError(err, callback) ->>>>>>> a064f0f3... Improve child performances (#1314) } // check required url components diff --git a/api/api/explain.js b/api/api/explain.js index 95ddcd7b9..da6ed2d9e 100644 --- a/api/api/explain.js +++ b/api/api/explain.js @@ -23,92 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['analyze_wildcard', 'analyzer', 'default_operator', 'df', 'stored_fields', 'lenient', 'preference', 'q', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['analyze_wildcard', 'analyzer', 'default_operator', 'df', 'stored_fields', 'lenient', 'preference', 'q', 'routing', '_source', '_source_excludes', '_source_includes', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'analyze_wildcard', - 'analyzer', - 'default_operator', - 'df', - 'stored_fields', - 'lenient', - 'preference', - 'q', - 'routing', - '_source', - '_source_excludes', - '_source_includes', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - analyzeWildcard: 'analyze_wildcard', - defaultOperator: 'default_operator', - storedFields: 'stored_fields', - _sourceExcludes: '_source_excludes', - _sourceIncludes: '_source_includes', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a explain request - * Returns information about why a specific matches (or doesn't match) a query. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html - */ - return function explain (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id) - } -======= function explainApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -122,13 +39,17 @@ function explainApi (params, options, callback) { return handleError(err, callback) } - var { method, body, id, index, ...querystring } = params + var { method, body, id, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) ->>>>>>> a064f0f3... Improve child performances (#1314) var path = '' - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id) + if ((index) != null && (type) != null && (id) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain' + } else { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id) + } // build request object const request = { diff --git a/api/api/get.js b/api/api/get.js index 3535febd3..a45848470 100644 --- a/api/api/get.js +++ b/api/api/get.js @@ -23,89 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'stored_fields', - 'preference', - 'realtime', - 'refresh', - 'routing', - '_source', - '_source_excludes', - '_source_includes', - 'version', - 'version_type', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - storedFields: 'stored_fields', - _sourceExcludes: '_source_excludes', - _sourceIncludes: '_source_includes', - versionType: 'version_type', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a get request - * Returns a document. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html - */ - return function get (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) - } else { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) - } -======= function getApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -119,13 +39,17 @@ function getApi (params, options, callback) { return handleError(err, callback) } - var { method, body, id, index, ...querystring } = params + var { method, body, id, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) ->>>>>>> a064f0f3... Improve child performances (#1314) var path = '' - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) + if ((index) != null && (type) != null && (id) != null) { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + } else { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) + } // build request object const request = { diff --git a/api/api/get_source.js b/api/api/get_source.js index 32ab264bd..a0d716dab 100644 --- a/api/api/get_source.js +++ b/api/api/get_source.js @@ -23,87 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'preference', - 'realtime', - 'refresh', - 'routing', - '_source', - '_source_excludes', - '_source_includes', - 'version', - 'version_type', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - _sourceExcludes: '_source_excludes', - _sourceIncludes: '_source_includes', - versionType: 'version_type', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a get_source request - * Returns the source of a document. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html - */ - return function getSource (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source' - } else { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id) - } -======= function getSourceApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -117,13 +39,17 @@ function getSourceApi (params, options, callback) { return handleError(err, callback) } - var { method, body, id, index, ...querystring } = params + var { method, body, id, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) ->>>>>>> a064f0f3... Improve child performances (#1314) var path = '' - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id) + if ((index) != null && (type) != null && (id) != null) { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source' + } else { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id) + } // build request object const request = { diff --git a/api/api/graph.explore.js b/api/api/graph.explore.js deleted file mode 100644 index 57860d84d..000000000 --- a/api/api/graph.explore.js +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildGraphExplore (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'routing', - 'timeout' - ] - - const snakeCase = { - - } - - /** - * Perform a graph.explore request - * Explore extracted and summarized information about the documents and terms in an index. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html - */ - return function graphExplore (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildGraphExplore diff --git a/api/api/graph.js b/api/api/graph.js index bfbd967cc..5f6ac9420 100644 --- a/api/api/graph.js +++ b/api/api/graph.js @@ -40,12 +40,23 @@ GraphApi.prototype.explore = function graphExploreApi (params, options, callback return handleError(err, callback) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore' + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore' + } else { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore' + } // build request object const request = { diff --git a/api/api/index.js b/api/api/index.js index e93a7c559..c02874e6a 100644 --- a/api/api/index.js +++ b/api/api/index.js @@ -39,73 +39,19 @@ function indexApi (params, options, callback) { return handleError(err, callback) } -<<<<<<< HEAD - /** - * Perform a index request - * Creates or updates a document in an index. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html - */ - return function _index (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) - } else if ((index) != null && (id) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) - } else if ((index) != null && (type) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) - } else { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_doc' - } -======= - var { method, body, id, index, ...querystring } = params + var { method, body, id, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) ->>>>>>> a064f0f3... Improve child performances (#1314) var path = '' - if ((index) != null && (id) != null) { + if ((index) != null && (type) != null && (id) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + } else if ((index) != null && (id) != null) { if (method == null) method = 'PUT' path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) + } else if ((index) != null && (type) != null) { + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) } else { if (method == null) method = 'POST' path = '/' + encodeURIComponent(index) + '/' + '_doc' diff --git a/api/api/indices.create.js b/api/api/indices.create.js deleted file mode 100644 index b234a3055..000000000 --- a/api/api/indices.create.js +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesCreate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'wait_for_active_shards', - 'timeout', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - waitForActiveShards: 'wait_for_active_shards', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.create request - * Creates an index with optional settings and mappings. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html - */ - return function indicesCreate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesCreate diff --git a/api/api/indices.flush_synced.js b/api/api/indices.flush_synced.js deleted file mode 100644 index e3240f387..000000000 --- a/api/api/indices.flush_synced.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesFlushSynced (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.flush_synced request - * Performs a synced flush operation on one or more indices. Synced flush is deprecated and will be removed in 8.0. Use flush instead - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush-api.html - */ - return function indicesFlushSynced (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_flush' + '/' + 'synced' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesFlushSynced diff --git a/api/api/indices.get.js b/api/api/indices.get.js deleted file mode 100644 index 4aef826c6..000000000 --- a/api/api/indices.get.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGet (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'local', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'flat_settings', - 'include_defaults', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - flatSettings: 'flat_settings', - includeDefaults: 'include_defaults', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get request - * Returns information about one or more indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html - */ - return function indicesGet (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGet diff --git a/api/api/indices.get_field_mapping.js b/api/api/indices.get_field_mapping.js deleted file mode 100644 index 362d9e10f..000000000 --- a/api/api/indices.get_field_mapping.js +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGetFieldMapping (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'include_defaults', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - includeDefaults: 'include_defaults', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get_field_mapping request - * Returns mapping for one or more fields. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html - */ - return function indicesGetFieldMapping (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['fields'] == null) { - const err = new ConfigurationError('Missing required parameter: fields') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, fields, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (fields) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields) - } else if ((index) != null && (fields) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields) - } else if ((type) != null && (fields) != null) { - if (method == null) method = 'GET' - path = '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields) - } else { - if (method == null) method = 'GET' - path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields) - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGetFieldMapping diff --git a/api/api/indices.get_mapping.js b/api/api/indices.get_mapping.js deleted file mode 100644 index 746b000cb..000000000 --- a/api/api/indices.get_mapping.js +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGetMapping (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'master_timeout', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get_mapping request - * Returns mappings for one or more indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html - */ - return function indicesGetMapping (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) - } else if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' - } else if ((type) != null) { - if (method == null) method = 'GET' - path = '/' + '_mapping' + '/' + encodeURIComponent(type) - } else { - if (method == null) method = 'GET' - path = '/' + '_mapping' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGetMapping diff --git a/api/api/indices.get_template.js b/api/api/indices.get_template.js deleted file mode 100644 index a6977181c..000000000 --- a/api/api/indices.get_template.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGetTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'flat_settings', - 'master_timeout', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - flatSettings: 'flat_settings', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get_template request - * Returns an index template. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html - */ - return function indicesGetTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_template' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'GET' - path = '/' + '_template' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGetTemplate diff --git a/api/api/indices.get_upgrade.js b/api/api/indices.get_upgrade.js deleted file mode 100644 index 2615c86b6..000000000 --- a/api/api/indices.get_upgrade.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGetUpgrade (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get_upgrade request - * The _upgrade API is no longer useful and will be removed. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html - */ - return function indicesGetUpgrade (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_upgrade' - } else { - if (method == null) method = 'GET' - path = '/' + '_upgrade' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGetUpgrade diff --git a/api/api/indices.js b/api/api/indices.js index 05ba8d352..9436f6708 100644 --- a/api/api/indices.js +++ b/api/api/indices.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'index', 'fielddata', 'fields', 'query', 'request', 'wait_for_active_shards', 'local', 'flat_settings', 'include_defaults', 'force', 'wait_if_ongoing', 'flush', 'max_num_segments', 'only_expunge_deletes', 'create', 'cause', 'write_index_only', 'preserve_existing', 'order', 'detailed', 'active_only', 'dry_run', 'verbose', 'status', 'completion_fields', 'fielddata_fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments', 'forbid_closed_indices', 'wait_for_completion', 'only_ancient_segments', 'explain', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards'] -const snakeCase = { masterTimeout: 'master_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', waitIfOngoing: 'wait_if_ongoing', maxNumSegments: 'max_num_segments', onlyExpungeDeletes: 'only_expunge_deletes', writeIndexOnly: 'write_index_only', preserveExisting: 'preserve_existing', activeOnly: 'active_only', dryRun: 'dry_run', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments', forbidClosedIndices: 'forbid_closed_indices', waitForCompletion: 'wait_for_completion', onlyAncientSegments: 'only_ancient_segments', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', allShards: 'all_shards' } +const acceptedQuerystring = ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'index', 'fielddata', 'fields', 'query', 'request', 'wait_for_active_shards', 'include_type_name', 'local', 'flat_settings', 'include_defaults', 'force', 'wait_if_ongoing', 'flush', 'max_num_segments', 'only_expunge_deletes', 'create', 'cause', 'write_index_only', 'preserve_existing', 'order', 'detailed', 'active_only', 'dry_run', 'verbose', 'status', 'copy_settings', 'completion_fields', 'fielddata_fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments', 'forbid_closed_indices', 'wait_for_completion', 'only_ancient_segments', 'explain', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards'] +const snakeCase = { masterTimeout: 'master_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards', includeTypeName: 'include_type_name', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', waitIfOngoing: 'wait_if_ongoing', maxNumSegments: 'max_num_segments', onlyExpungeDeletes: 'only_expunge_deletes', writeIndexOnly: 'write_index_only', preserveExisting: 'preserve_existing', activeOnly: 'active_only', dryRun: 'dry_run', copySettings: 'copy_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments', forbidClosedIndices: 'forbid_closed_indices', waitForCompletion: 'wait_for_completion', onlyAncientSegments: 'only_ancient_segments', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', allShards: 'all_shards' } function IndicesApi (transport, ConfigurationError) { this.transport = transport @@ -510,6 +510,27 @@ IndicesApi.prototype.flush = function indicesFlushApi (params, options, callback return this.transport.request(request, options, callback) } +IndicesApi.prototype.flushSynced = function indicesFlushSyncedApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + var { method, body, index, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + var path = '' + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_flush' + '/' + 'synced' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + IndicesApi.prototype.forcemerge = function indicesForcemergeApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -604,13 +625,19 @@ IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi (param return handleError(err, callback) } - var { method, body, fields, index, ...querystring } = params + var { method, body, fields, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if ((index) != null && (fields) != null) { + if ((index) != null && (type) != null && (fields) != null) { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields) + } else if ((index) != null && (fields) != null) { if (method == null) method = 'GET' path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields) + } else if ((type) != null && (fields) != null) { + if (method == null) method = 'GET' + path = '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields) } else { if (method == null) method = 'GET' path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields) @@ -656,13 +683,19 @@ IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi (par IndicesApi.prototype.getMapping = function indicesGetMappingApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) - var { method, body, index, ...querystring } = params + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + } else if ((index) != null) { if (method == null) method = 'GET' path = '/' + encodeURIComponent(index) + '/' + '_mapping' + } else if ((type) != null) { + if (method == null) method = 'GET' + path = '/' + '_mapping' + '/' + encodeURIComponent(type) } else { if (method == null) method = 'GET' path = '/' + '_mapping' @@ -744,8 +777,13 @@ IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi (params, options querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_upgrade' + if ((index) != null) { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_upgrade' + } else { + if (method == null) method = 'GET' + path = '/' + '_upgrade' + } // build request object const request = { @@ -862,21 +900,40 @@ IndicesApi.prototype.putMapping = function indicesPutMappingApi (params, options ;[params, options, callback] = normalizeArguments(params, options, callback) // check required parameters - if (params['index'] == null) { - const err = new this[kConfigurationError]('Missing required parameter: index') - return handleError(err, callback) - } if (params['body'] == null) { const err = new this[kConfigurationError]('Missing required parameter: body') return handleError(err, callback) } - var { method, body, index, ...querystring } = params + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + if ((index) != null && (type) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping' + } else if ((index) != null && (type) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + } else if ((index) != null && (type) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mappings' + } else if ((index) != null && (type) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + '_mappings' + '/' + encodeURIComponent(type) + } else if ((index) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + '_mapping' + } else if ((type) != null) { + if (method == null) method = 'PUT' + path = '/' + '_mappings' + '/' + encodeURIComponent(type) + } else if ((index) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + '_mappings' + } else { + if (method == null) method = 'PUT' + path = '/' + '_mapping' + '/' + encodeURIComponent(type) + } // build request object const request = { @@ -1314,8 +1371,13 @@ IndicesApi.prototype.upgrade = function indicesUpgradeApi (params, options, call querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_upgrade' + if ((index) != null) { + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_upgrade' + } else { + if (method == null) method = 'POST' + path = '/' + '_upgrade' + } // build request object const request = { @@ -1560,6 +1622,7 @@ Object.defineProperties(IndicesApi.prototype, { exists_index_template: { get () { return this.existsIndexTemplate } }, exists_template: { get () { return this.existsTemplate } }, exists_type: { get () { return this.existsType } }, + flush_synced: { get () { return this.flushSynced } }, get_alias: { get () { return this.getAlias } }, get_field_mapping: { get () { return this.getFieldMapping } }, get_index_template: { get () { return this.getIndexTemplate } }, diff --git a/api/api/indices.put_mapping.js b/api/api/indices.put_mapping.js deleted file mode 100644 index 34d365dcf..000000000 --- a/api/api/indices.put_mapping.js +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesPutMapping (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'timeout', - 'master_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'write_index_only', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - masterTimeout: 'master_timeout', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - writeIndexOnly: 'write_index_only', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.put_mapping request - * Updates the index mappings. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html - */ - return function indicesPutMapping (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping' - } else if ((index) != null && (type) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) - } else if ((index) != null && (type) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mappings' - } else if ((index) != null && (type) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mappings' + '/' + encodeURIComponent(type) - } else if ((index) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' - } else if ((type) != null) { - if (method == null) method = 'PUT' - path = '/' + '_mappings' + '/' + encodeURIComponent(type) - } else if ((index) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mappings' - } else { - if (method == null) method = 'PUT' - path = '/' + '_mapping' + '/' + encodeURIComponent(type) - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesPutMapping diff --git a/api/api/indices.put_template.js b/api/api/indices.put_template.js deleted file mode 100644 index f6d2d8873..000000000 --- a/api/api/indices.put_template.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesPutTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'order', - 'create', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.put_template request - * Creates or updates an index template. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html - */ - return function indicesPutTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_template' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesPutTemplate diff --git a/api/api/indices.rollover.js b/api/api/indices.rollover.js deleted file mode 100644 index fe1da99ce..000000000 --- a/api/api/indices.rollover.js +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesRollover (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'timeout', - 'dry_run', - 'master_timeout', - 'wait_for_active_shards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - dryRun: 'dry_run', - masterTimeout: 'master_timeout', - waitForActiveShards: 'wait_for_active_shards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.rollover request - * Updates an alias to point to a new index when the existing index -is considered to be too large or too old. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html - */ - return function indicesRollover (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['alias'] == null) { - const err = new ConfigurationError('Missing required parameter: alias') - return handleError(err, callback) - } - - // check required url components - if ((params['new_index'] != null || params['newIndex'] != null) && (params['alias'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: alias') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, alias, newIndex, new_index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((alias) != null && (new_index || newIndex) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(alias) + '/' + '_rollover' + '/' + encodeURIComponent(new_index || newIndex) - } else { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(alias) + '/' + '_rollover' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesRollover diff --git a/api/api/indices.shrink.js b/api/api/indices.shrink.js deleted file mode 100644 index 328805359..000000000 --- a/api/api/indices.shrink.js +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesShrink (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'copy_settings', - 'timeout', - 'master_timeout', - 'wait_for_active_shards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - copySettings: 'copy_settings', - masterTimeout: 'master_timeout', - waitForActiveShards: 'wait_for_active_shards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.shrink request - * Allow to shrink an existing index into a new index with fewer primary shards. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html - */ - return function indicesShrink (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['target'] == null) { - const err = new ConfigurationError('Missing required parameter: target') - return handleError(err, callback) - } - - // check required url components - if (params['target'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, target, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_shrink' + '/' + encodeURIComponent(target) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesShrink diff --git a/api/api/indices.split.js b/api/api/indices.split.js deleted file mode 100644 index 65a721177..000000000 --- a/api/api/indices.split.js +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesSplit (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'copy_settings', - 'timeout', - 'master_timeout', - 'wait_for_active_shards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - copySettings: 'copy_settings', - masterTimeout: 'master_timeout', - waitForActiveShards: 'wait_for_active_shards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.split request - * Allows you to split an existing index into a new index with more primary shards. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html - */ - return function indicesSplit (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['target'] == null) { - const err = new ConfigurationError('Missing required parameter: target') - return handleError(err, callback) - } - - // check required url components - if (params['target'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, target, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_split' + '/' + encodeURIComponent(target) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesSplit diff --git a/api/api/indices.upgrade.js b/api/api/indices.upgrade.js deleted file mode 100644 index 9501e0cfa..000000000 --- a/api/api/indices.upgrade.js +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesUpgrade (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_indices', - 'expand_wildcards', - 'ignore_unavailable', - 'wait_for_completion', - 'only_ancient_segments', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - ignoreUnavailable: 'ignore_unavailable', - waitForCompletion: 'wait_for_completion', - onlyAncientSegments: 'only_ancient_segments', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.upgrade request - * The _upgrade API is no longer useful and will be removed. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html - */ - return function indicesUpgrade (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_upgrade' - } else { - if (method == null) method = 'POST' - path = '/' + '_upgrade' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesUpgrade diff --git a/api/api/mget.js b/api/api/mget.js index 2490e0978..2ff5d404e 100644 --- a/api/api/mget.js +++ b/api/api/mget.js @@ -23,33 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'stored_fields', - 'preference', - 'realtime', - 'refresh', - 'routing', - '_source', - '_source_excludes', - '_source_includes', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - storedFields: 'stored_fields', - _sourceExcludes: '_source_excludes', - _sourceIncludes: '_source_includes', - errorTrace: 'error_trace', - filterPath: 'filter_path' -======= function mgetApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -57,70 +33,28 @@ function mgetApi (params, options, callback) { if (params['body'] == null) { const err = new this[kConfigurationError]('Missing required parameter: body') return handleError(err, callback) ->>>>>>> a064f0f3... Improve child performances (#1314) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) -<<<<<<< HEAD - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mget' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_mget' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_mget' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } -======= var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mget' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_mget' } else { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + '_mget' } ->>>>>>> a064f0f3... Improve child performances (#1314) // build request object const request = { diff --git a/api/api/msearch.js b/api/api/msearch.js index b3b6ee13c..23aeaa617 100644 --- a/api/api/msearch.js +++ b/api/api/msearch.js @@ -35,67 +35,26 @@ function msearchApi (params, options, callback) { return handleError(err, callback) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) -<<<<<<< HEAD - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_msearch' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_msearch' - } - - // build request object - const request = { - method, - path, - bulkBody: body, - querystring - } -======= var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_msearch' } else { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + '_msearch' } ->>>>>>> a064f0f3... Improve child performances (#1314) // build request object const request = { diff --git a/api/api/msearch_template.js b/api/api/msearch_template.js index 54dda4c77..2fe9a63bc 100644 --- a/api/api/msearch_template.js +++ b/api/api/msearch_template.js @@ -35,67 +35,26 @@ function msearchTemplateApi (params, options, callback) { return handleError(err, callback) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) -<<<<<<< HEAD - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' + '/' + 'template' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_msearch' + '/' + 'template' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_msearch' + '/' + 'template' - } - - // build request object - const request = { - method, - path, - bulkBody: body, - querystring - } -======= var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' + '/' + 'template' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_msearch' + '/' + 'template' } else { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + '_msearch' + '/' + 'template' } ->>>>>>> a064f0f3... Improve child performances (#1314) // build request object const request = { diff --git a/api/api/mtermvectors.js b/api/api/mtermvectors.js index 369672a52..aff633db5 100644 --- a/api/api/mtermvectors.js +++ b/api/api/mtermvectors.js @@ -29,11 +29,20 @@ const snakeCase = { termStatistics: 'term_statistics', fieldStatistics: 'field_s function mtermvectorsApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mtermvectors' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_mtermvectors' } else { @@ -41,76 +50,12 @@ function mtermvectorsApi (params, options, callback) { path = '/' + '_mtermvectors' } -<<<<<<< HEAD - /** - * Perform a mtermvectors request - * Returns multiple termvectors in one request. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html - */ - return function mtermvectors (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mtermvectors' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_mtermvectors' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_mtermvectors' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) -======= // build request object const request = { method, path, body: body || '', querystring ->>>>>>> a064f0f3... Improve child performances (#1314) } return this.transport.request(request, options, callback) diff --git a/api/api/nodes.hot_threads.js b/api/api/nodes.hot_threads.js deleted file mode 100644 index 0a2173c86..000000000 --- a/api/api/nodes.hot_threads.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildNodesHotThreads (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'interval', - 'snapshots', - 'threads', - 'ignore_idle_threads', - 'type', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreIdleThreads: 'ignore_idle_threads', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a nodes.hot_threads request - * Returns information about hot threads on each node in the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html - */ - return function nodesHotThreads (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, nodeId, node_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' - } else if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' - } else if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' - } else if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' - } else { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + 'hot_threads' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildNodesHotThreads diff --git a/api/api/nodes.js b/api/api/nodes.js index 4fb496114..aba848bed 100644 --- a/api/api/nodes.js +++ b/api/api/nodes.js @@ -41,6 +41,15 @@ NodesApi.prototype.hotThreads = function nodesHotThreadsApi (params, options, ca if ((node_id || nodeId) != null) { if (method == null) method = 'GET' path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' + } else if ((node_id || nodeId) != null) { + if (method == null) method = 'GET' + path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' + } else if ((node_id || nodeId) != null) { + if (method == null) method = 'GET' + path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' + } else if ((node_id || nodeId) != null) { + if (method == null) method = 'GET' + path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' } else { if (method == null) method = 'GET' path = '/' + '_nodes' + '/' + 'hot_threads' diff --git a/api/api/open_point_in_time.js b/api/api/open_point_in_time.js index b45581834..61a5fb34c 100644 --- a/api/api/open_point_in_time.js +++ b/api/api/open_point_in_time.js @@ -41,67 +41,12 @@ function openPointInTimeApi (params, options, callback) { path = '/' + '_pit' } -<<<<<<< HEAD - /** - * Perform a open_point_in_time request - * Open a point in time that can be used in subsequent searches - * https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time.html - */ - return function openPointInTime (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_pit' - } else { - if (method == null) method = 'POST' - path = '/' + '_pit' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) -======= // build request object const request = { method, path, body: body || '', querystring ->>>>>>> a064f0f3... Improve child performances (#1314) } return this.transport.request(request, options, callback) diff --git a/api/api/search.js b/api/api/search.js index 331119fe8..d9e144246 100644 --- a/api/api/search.js +++ b/api/api/search.js @@ -22,167 +22,27 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -<<<<<<< HEAD -function buildSearch (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'analyzer', - 'analyze_wildcard', - 'ccs_minimize_roundtrips', - 'default_operator', - 'df', - 'explain', - 'stored_fields', - 'docvalue_fields', - 'from', - 'ignore_unavailable', - 'ignore_throttled', - 'allow_no_indices', - 'expand_wildcards', - 'lenient', - 'preference', - 'q', - 'routing', - 'scroll', - 'search_type', - 'size', - 'sort', - '_source', - '_source_excludes', - '_source_includes', - 'terminate_after', - 'stats', - 'suggest_field', - 'suggest_mode', - 'suggest_size', - 'suggest_text', - 'timeout', - 'track_scores', - 'track_total_hits', - 'allow_partial_search_results', - 'typed_keys', - 'version', - 'seq_no_primary_term', - 'request_cache', - 'batched_reduce_size', - 'max_concurrent_shard_requests', - 'pre_filter_shard_size', - 'rest_total_hits_as_int', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - analyzeWildcard: 'analyze_wildcard', - ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips', - defaultOperator: 'default_operator', - storedFields: 'stored_fields', - docvalueFields: 'docvalue_fields', - ignoreUnavailable: 'ignore_unavailable', - ignoreThrottled: 'ignore_throttled', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - searchType: 'search_type', - _sourceExcludes: '_source_excludes', - _sourceIncludes: '_source_includes', - terminateAfter: 'terminate_after', - suggestField: 'suggest_field', - suggestMode: 'suggest_mode', - suggestSize: 'suggest_size', - suggestText: 'suggest_text', - trackScores: 'track_scores', - trackTotalHits: 'track_total_hits', - allowPartialSearchResults: 'allow_partial_search_results', - typedKeys: 'typed_keys', - seqNoPrimaryTerm: 'seq_no_primary_term', - requestCache: 'request_cache', - batchedReduceSize: 'batched_reduce_size', - maxConcurrentShardRequests: 'max_concurrent_shard_requests', - preFilterShardSize: 'pre_filter_shard_size', - restTotalHitsAsInt: 'rest_total_hits_as_int', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a search request - * Returns results matching a query. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html - */ - return function search (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_search' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_search' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) -======= const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'ccs_minimize_roundtrips', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'size', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'typed_keys', 'version', 'seq_no_primary_term', 'request_cache', 'batched_reduce_size', 'max_concurrent_shard_requests', 'pre_filter_shard_size', 'rest_total_hits_as_int', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { analyzeWildcard: 'analyze_wildcard', ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips', defaultOperator: 'default_operator', storedFields: 'stored_fields', docvalueFields: 'docvalue_fields', ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', suggestSize: 'suggest_size', suggestText: 'suggest_text', trackScores: 'track_scores', trackTotalHits: 'track_total_hits', allowPartialSearchResults: 'allow_partial_search_results', typedKeys: 'typed_keys', seqNoPrimaryTerm: 'seq_no_primary_term', requestCache: 'request_cache', batchedReduceSize: 'batched_reduce_size', maxConcurrentShardRequests: 'max_concurrent_shard_requests', preFilterShardSize: 'pre_filter_shard_size', restTotalHitsAsInt: 'rest_total_hits_as_int', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'ccs_minimize_roundtrips', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'size', 'sort', '_source', '_source_excludes', '_source_includes', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'typed_keys', 'version', 'seq_no_primary_term', 'request_cache', 'batched_reduce_size', 'max_concurrent_shard_requests', 'pre_filter_shard_size', 'rest_total_hits_as_int', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { analyzeWildcard: 'analyze_wildcard', ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips', defaultOperator: 'default_operator', storedFields: 'stored_fields', docvalueFields: 'docvalue_fields', ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', suggestSize: 'suggest_size', suggestText: 'suggest_text', trackScores: 'track_scores', trackTotalHits: 'track_total_hits', allowPartialSearchResults: 'allow_partial_search_results', typedKeys: 'typed_keys', seqNoPrimaryTerm: 'seq_no_primary_term', requestCache: 'request_cache', batchedReduceSize: 'batched_reduce_size', maxConcurrentShardRequests: 'max_concurrent_shard_requests', preFilterShardSize: 'pre_filter_shard_size', restTotalHitsAsInt: 'rest_total_hits_as_int', errorTrace: 'error_trace', filterPath: 'filter_path' } function searchApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_search' } else { @@ -196,7 +56,6 @@ function searchApi (params, options, callback) { path, body: body || '', querystring ->>>>>>> a064f0f3... Improve child performances (#1314) } return this.transport.request(request, options, callback) diff --git a/api/api/search_template.js b/api/api/search_template.js index 801b5d01d..a875c2712 100644 --- a/api/api/search_template.js +++ b/api/api/search_template.js @@ -35,67 +35,26 @@ function searchTemplateApi (params, options, callback) { return handleError(err, callback) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) -<<<<<<< HEAD - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' + '/' + 'template' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'template' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_search' + '/' + 'template' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } -======= var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' + '/' + 'template' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'template' } else { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + '_search' + '/' + 'template' } ->>>>>>> a064f0f3... Improve child performances (#1314) // build request object const request = { diff --git a/api/api/searchable_snapshots.clear_cache.js b/api/api/searchable_snapshots.clear_cache.js deleted file mode 100644 index fbab0fb47..000000000 --- a/api/api/searchable_snapshots.clear_cache.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSearchableSnapshotsClearCache (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'index' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards' - - } - - /** - * Perform a searchable_snapshots.clear_cache request - * Clear the cache of searchable snapshots. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-apis.html - */ - return function searchableSnapshotsClearCache (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_searchable_snapshots' + '/' + 'cache' + '/' + 'clear' - } else { - if (method == null) method = 'POST' - path = '/' + '_searchable_snapshots' + '/' + 'cache' + '/' + 'clear' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSearchableSnapshotsClearCache diff --git a/api/api/searchable_snapshots.mount.js b/api/api/searchable_snapshots.mount.js deleted file mode 100644 index 456b0463c..000000000 --- a/api/api/searchable_snapshots.mount.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSearchableSnapshotsMount (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'wait_for_completion' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - waitForCompletion: 'wait_for_completion' - } - - /** - * Perform a searchable_snapshots.mount request - * Mount a snapshot as a searchable index. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-api-mount-snapshot.html - */ - return function searchableSnapshotsMount (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - if (params['snapshot'] == null) { - const err = new ConfigurationError('Missing required parameter: snapshot') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['snapshot'] != null && (params['repository'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, snapshot, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_mount' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSearchableSnapshotsMount diff --git a/api/api/searchable_snapshots.repository_stats.js b/api/api/searchable_snapshots.repository_stats.js deleted file mode 100644 index ed4be7935..000000000 --- a/api/api/searchable_snapshots.repository_stats.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSearchableSnapshotsRepositoryStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a searchable_snapshots.repository_stats request - * DEPRECATED: This API is replaced by the Repositories Metering API. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-apis.html - */ - return function searchableSnapshotsRepositoryStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_stats' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSearchableSnapshotsRepositoryStats diff --git a/api/api/searchable_snapshots.stats.js b/api/api/searchable_snapshots.stats.js deleted file mode 100644 index 0ac8bcdb3..000000000 --- a/api/api/searchable_snapshots.stats.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSearchableSnapshotsStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a searchable_snapshots.stats request - * Retrieve various statistics about searchable snapshots. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-apis.html - */ - return function searchableSnapshotsStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_searchable_snapshots' + '/' + 'stats' - } else { - if (method == null) method = 'GET' - path = '/' + '_searchable_snapshots' + '/' + 'stats' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSearchableSnapshotsStats diff --git a/api/api/snapshot.delete.js b/api/api/snapshot.delete.js deleted file mode 100644 index c9967cb70..000000000 --- a/api/api/snapshot.delete.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSnapshotDelete (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a snapshot.delete request - * Deletes a snapshot. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html - */ - return function snapshotDelete (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - if (params['snapshot'] == null) { - const err = new ConfigurationError('Missing required parameter: snapshot') - return handleError(err, callback) - } - - // check required url components - if (params['snapshot'] != null && (params['repository'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, snapshot, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSnapshotDelete diff --git a/api/api/termvectors.js b/api/api/termvectors.js index ba50668b3..257c84c82 100644 --- a/api/api/termvectors.js +++ b/api/api/termvectors.js @@ -35,64 +35,23 @@ function termvectorsApi (params, options, callback) { return handleError(err, callback) } - var { method, body, index, id, ...querystring } = params + var { method, body, index, id, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) -<<<<<<< HEAD - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, id, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors' - } else if ((index) != null && (id) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_termvectors' + '/' + encodeURIComponent(id) - } else if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_termvectors' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_termvectors' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } -======= var path = '' - if ((index) != null && (id) != null) { + if ((index) != null && (type) != null && (id) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors' + } else if ((index) != null && (id) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_termvectors' + '/' + encodeURIComponent(id) + } else if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_termvectors' } else { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_termvectors' } ->>>>>>> a064f0f3... Improve child performances (#1314) // build request object const request = { diff --git a/api/api/update.js b/api/api/update.js index cbc827f27..aae88a27a 100644 --- a/api/api/update.js +++ b/api/api/update.js @@ -23,41 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['wait_for_active_shards', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'lang', 'refresh', 'retry_on_conflict', 'routing', 'timeout', 'if_seq_no', 'if_primary_term', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', retryOnConflict: 'retry_on_conflict', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['wait_for_active_shards', '_source', '_source_excludes', '_source_includes', 'lang', 'refresh', 'retry_on_conflict', 'routing', 'timeout', 'if_seq_no', 'if_primary_term', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', retryOnConflict: 'retry_on_conflict', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'wait_for_active_shards', - '_source', - '_source_excludes', - '_source_includes', - 'lang', - 'refresh', - 'retry_on_conflict', - 'routing', - 'timeout', - 'if_seq_no', - 'if_primary_term', - 'require_alias', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - waitForActiveShards: 'wait_for_active_shards', - _sourceExcludes: '_source_excludes', - _sourceIncludes: '_source_includes', - retryOnConflict: 'retry_on_conflict', - ifSeqNo: 'if_seq_no', - ifPrimaryTerm: 'if_primary_term', - requireAlias: 'require_alias', - errorTrace: 'error_trace', - filterPath: 'filter_path' -======= function updateApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -73,7 +41,6 @@ function updateApi (params, options, callback) { if (params['body'] == null) { const err = new this[kConfigurationError]('Missing required parameter: body') return handleError(err, callback) ->>>>>>> a064f0f3... Improve child performances (#1314) } var { method, body, id, index, type, ...querystring } = params diff --git a/api/api/update_by_query.js b/api/api/update_by_query.js index 36caddf2d..afc53845d 100644 --- a/api/api/update_by_query.js +++ b/api/api/update_by_query.js @@ -23,74 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'pipeline', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'max_docs', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'version', 'version_type', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', versionType: 'version_type', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'pipeline', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'size', 'max_docs', 'sort', '_source', '_source_excludes', '_source_includes', 'terminate_after', 'stats', 'version', 'version_type', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', terminateAfter: 'terminate_after', versionType: 'version_type', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'analyzer', - 'analyze_wildcard', - 'default_operator', - 'df', - 'from', - 'ignore_unavailable', - 'allow_no_indices', - 'conflicts', - 'expand_wildcards', - 'lenient', - 'pipeline', - 'preference', - 'q', - 'routing', - 'scroll', - 'search_type', - 'search_timeout', - 'size', - 'max_docs', - 'sort', - '_source', - '_source_excludes', - '_source_includes', - 'terminate_after', - 'stats', - 'version', - 'version_type', - 'request_cache', - 'refresh', - 'timeout', - 'wait_for_active_shards', - 'scroll_size', - 'wait_for_completion', - 'requests_per_second', - 'slices', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - analyzeWildcard: 'analyze_wildcard', - defaultOperator: 'default_operator', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - searchType: 'search_type', - searchTimeout: 'search_timeout', - maxDocs: 'max_docs', - _sourceExcludes: '_source_excludes', - _sourceIncludes: '_source_includes', - terminateAfter: 'terminate_after', - versionType: 'version_type', - requestCache: 'request_cache', - waitForActiveShards: 'wait_for_active_shards', - scrollSize: 'scroll_size', - waitForCompletion: 'wait_for_completion', - requestsPerSecond: 'requests_per_second', - errorTrace: 'error_trace', - filterPath: 'filter_path' -======= function updateByQueryApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -98,66 +33,32 @@ function updateByQueryApi (params, options, callback) { if (params['index'] == null) { const err = new this[kConfigurationError]('Missing required parameter: index') return handleError(err, callback) ->>>>>>> a064f0f3... Improve child performances (#1314) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_update_by_query' + if ((index) != null && (type) != null) { + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_update_by_query' + } else { + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_update_by_query' + } -<<<<<<< HEAD - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_update_by_query' - } else { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_update_by_query' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) -======= // build request object const request = { method, path, body: body || '', querystring ->>>>>>> a064f0f3... Improve child performances (#1314) } return this.transport.request(request, options, callback) diff --git a/api/index.js b/api/index.js index 0ed832562..0822364d7 100644 --- a/api/index.js +++ b/api/index.js @@ -191,655 +191,6 @@ ESAPI.prototype.updateByQueryRethrottle = updateByQueryRethrottleApi ESAPI.prototype.closePointInTime = closePointInTimeApi ESAPI.prototype.openPointInTime = openPointInTimeApi -<<<<<<< HEAD - const apis = { - async_search: { - delete: lazyLoad('async_search.delete', opts), - get: lazyLoad('async_search.get', opts), - submit: lazyLoad('async_search.submit', opts) - }, - asyncSearch: { - delete: lazyLoad('async_search.delete', opts), - get: lazyLoad('async_search.get', opts), - submit: lazyLoad('async_search.submit', opts) - }, - autoscaling: { - delete_autoscaling_policy: lazyLoad('autoscaling.delete_autoscaling_policy', opts), - deleteAutoscalingPolicy: lazyLoad('autoscaling.delete_autoscaling_policy', opts), - get_autoscaling_decision: lazyLoad('autoscaling.get_autoscaling_decision', opts), - getAutoscalingDecision: lazyLoad('autoscaling.get_autoscaling_decision', opts), - get_autoscaling_policy: lazyLoad('autoscaling.get_autoscaling_policy', opts), - getAutoscalingPolicy: lazyLoad('autoscaling.get_autoscaling_policy', opts), - put_autoscaling_policy: lazyLoad('autoscaling.put_autoscaling_policy', opts), - putAutoscalingPolicy: lazyLoad('autoscaling.put_autoscaling_policy', opts) - }, - bulk: lazyLoad('bulk', opts), - cat: { - aliases: lazyLoad('cat.aliases', opts), - allocation: lazyLoad('cat.allocation', opts), - count: lazyLoad('cat.count', opts), - fielddata: lazyLoad('cat.fielddata', opts), - health: lazyLoad('cat.health', opts), - help: lazyLoad('cat.help', opts), - indices: lazyLoad('cat.indices', opts), - master: lazyLoad('cat.master', opts), - ml_data_frame_analytics: lazyLoad('cat.ml_data_frame_analytics', opts), - mlDataFrameAnalytics: lazyLoad('cat.ml_data_frame_analytics', opts), - ml_datafeeds: lazyLoad('cat.ml_datafeeds', opts), - mlDatafeeds: lazyLoad('cat.ml_datafeeds', opts), - ml_jobs: lazyLoad('cat.ml_jobs', opts), - mlJobs: lazyLoad('cat.ml_jobs', opts), - ml_trained_models: lazyLoad('cat.ml_trained_models', opts), - mlTrainedModels: lazyLoad('cat.ml_trained_models', opts), - nodeattrs: lazyLoad('cat.nodeattrs', opts), - nodes: lazyLoad('cat.nodes', opts), - pending_tasks: lazyLoad('cat.pending_tasks', opts), - pendingTasks: lazyLoad('cat.pending_tasks', opts), - plugins: lazyLoad('cat.plugins', opts), - recovery: lazyLoad('cat.recovery', opts), - repositories: lazyLoad('cat.repositories', opts), - segments: lazyLoad('cat.segments', opts), - shards: lazyLoad('cat.shards', opts), - snapshots: lazyLoad('cat.snapshots', opts), - tasks: lazyLoad('cat.tasks', opts), - templates: lazyLoad('cat.templates', opts), - thread_pool: lazyLoad('cat.thread_pool', opts), - threadPool: lazyLoad('cat.thread_pool', opts), - transforms: lazyLoad('cat.transforms', opts) - }, - ccr: { - delete_auto_follow_pattern: lazyLoad('ccr.delete_auto_follow_pattern', opts), - deleteAutoFollowPattern: lazyLoad('ccr.delete_auto_follow_pattern', opts), - follow: lazyLoad('ccr.follow', opts), - follow_info: lazyLoad('ccr.follow_info', opts), - followInfo: lazyLoad('ccr.follow_info', opts), - follow_stats: lazyLoad('ccr.follow_stats', opts), - followStats: lazyLoad('ccr.follow_stats', opts), - forget_follower: lazyLoad('ccr.forget_follower', opts), - forgetFollower: lazyLoad('ccr.forget_follower', opts), - get_auto_follow_pattern: lazyLoad('ccr.get_auto_follow_pattern', opts), - getAutoFollowPattern: lazyLoad('ccr.get_auto_follow_pattern', opts), - pause_auto_follow_pattern: lazyLoad('ccr.pause_auto_follow_pattern', opts), - pauseAutoFollowPattern: lazyLoad('ccr.pause_auto_follow_pattern', opts), - pause_follow: lazyLoad('ccr.pause_follow', opts), - pauseFollow: lazyLoad('ccr.pause_follow', opts), - put_auto_follow_pattern: lazyLoad('ccr.put_auto_follow_pattern', opts), - putAutoFollowPattern: lazyLoad('ccr.put_auto_follow_pattern', opts), - resume_auto_follow_pattern: lazyLoad('ccr.resume_auto_follow_pattern', opts), - resumeAutoFollowPattern: lazyLoad('ccr.resume_auto_follow_pattern', opts), - resume_follow: lazyLoad('ccr.resume_follow', opts), - resumeFollow: lazyLoad('ccr.resume_follow', opts), - stats: lazyLoad('ccr.stats', opts), - unfollow: lazyLoad('ccr.unfollow', opts) - }, - clear_scroll: lazyLoad('clear_scroll', opts), - clearScroll: lazyLoad('clear_scroll', opts), - close_point_in_time: lazyLoad('close_point_in_time', opts), - closePointInTime: lazyLoad('close_point_in_time', opts), - cluster: { - allocation_explain: lazyLoad('cluster.allocation_explain', opts), - allocationExplain: lazyLoad('cluster.allocation_explain', opts), - delete_component_template: lazyLoad('cluster.delete_component_template', opts), - deleteComponentTemplate: lazyLoad('cluster.delete_component_template', opts), - delete_voting_config_exclusions: lazyLoad('cluster.delete_voting_config_exclusions', opts), - deleteVotingConfigExclusions: lazyLoad('cluster.delete_voting_config_exclusions', opts), - exists_component_template: lazyLoad('cluster.exists_component_template', opts), - existsComponentTemplate: lazyLoad('cluster.exists_component_template', opts), - get_component_template: lazyLoad('cluster.get_component_template', opts), - getComponentTemplate: lazyLoad('cluster.get_component_template', opts), - get_settings: lazyLoad('cluster.get_settings', opts), - getSettings: lazyLoad('cluster.get_settings', opts), - health: lazyLoad('cluster.health', opts), - pending_tasks: lazyLoad('cluster.pending_tasks', opts), - pendingTasks: lazyLoad('cluster.pending_tasks', opts), - post_voting_config_exclusions: lazyLoad('cluster.post_voting_config_exclusions', opts), - postVotingConfigExclusions: lazyLoad('cluster.post_voting_config_exclusions', opts), - put_component_template: lazyLoad('cluster.put_component_template', opts), - putComponentTemplate: lazyLoad('cluster.put_component_template', opts), - put_settings: lazyLoad('cluster.put_settings', opts), - putSettings: lazyLoad('cluster.put_settings', opts), - remote_info: lazyLoad('cluster.remote_info', opts), - remoteInfo: lazyLoad('cluster.remote_info', opts), - reroute: lazyLoad('cluster.reroute', opts), - state: lazyLoad('cluster.state', opts), - stats: lazyLoad('cluster.stats', opts) - }, - count: lazyLoad('count', opts), - create: lazyLoad('create', opts), - dangling_indices: { - delete_dangling_index: lazyLoad('dangling_indices.delete_dangling_index', opts), - deleteDanglingIndex: lazyLoad('dangling_indices.delete_dangling_index', opts), - import_dangling_index: lazyLoad('dangling_indices.import_dangling_index', opts), - importDanglingIndex: lazyLoad('dangling_indices.import_dangling_index', opts), - list_dangling_indices: lazyLoad('dangling_indices.list_dangling_indices', opts), - listDanglingIndices: lazyLoad('dangling_indices.list_dangling_indices', opts) - }, - danglingIndices: { - delete_dangling_index: lazyLoad('dangling_indices.delete_dangling_index', opts), - deleteDanglingIndex: lazyLoad('dangling_indices.delete_dangling_index', opts), - import_dangling_index: lazyLoad('dangling_indices.import_dangling_index', opts), - importDanglingIndex: lazyLoad('dangling_indices.import_dangling_index', opts), - list_dangling_indices: lazyLoad('dangling_indices.list_dangling_indices', opts), - listDanglingIndices: lazyLoad('dangling_indices.list_dangling_indices', opts) - }, - delete: lazyLoad('delete', opts), - delete_by_query: lazyLoad('delete_by_query', opts), - deleteByQuery: lazyLoad('delete_by_query', opts), - delete_by_query_rethrottle: lazyLoad('delete_by_query_rethrottle', opts), - deleteByQueryRethrottle: lazyLoad('delete_by_query_rethrottle', opts), - delete_script: lazyLoad('delete_script', opts), - deleteScript: lazyLoad('delete_script', opts), - enrich: { - delete_policy: lazyLoad('enrich.delete_policy', opts), - deletePolicy: lazyLoad('enrich.delete_policy', opts), - execute_policy: lazyLoad('enrich.execute_policy', opts), - executePolicy: lazyLoad('enrich.execute_policy', opts), - get_policy: lazyLoad('enrich.get_policy', opts), - getPolicy: lazyLoad('enrich.get_policy', opts), - put_policy: lazyLoad('enrich.put_policy', opts), - putPolicy: lazyLoad('enrich.put_policy', opts), - stats: lazyLoad('enrich.stats', opts) - }, - eql: { - delete: lazyLoad('eql.delete', opts), - get: lazyLoad('eql.get', opts), - search: lazyLoad('eql.search', opts) - }, - exists: lazyLoad('exists', opts), - exists_source: lazyLoad('exists_source', opts), - existsSource: lazyLoad('exists_source', opts), - explain: lazyLoad('explain', opts), - field_caps: lazyLoad('field_caps', opts), - fieldCaps: lazyLoad('field_caps', opts), - get: lazyLoad('get', opts), - get_script: lazyLoad('get_script', opts), - getScript: lazyLoad('get_script', opts), - get_script_context: lazyLoad('get_script_context', opts), - getScriptContext: lazyLoad('get_script_context', opts), - get_script_languages: lazyLoad('get_script_languages', opts), - getScriptLanguages: lazyLoad('get_script_languages', opts), - get_source: lazyLoad('get_source', opts), - getSource: lazyLoad('get_source', opts), - graph: { - explore: lazyLoad('graph.explore', opts) - }, - ilm: { - delete_lifecycle: lazyLoad('ilm.delete_lifecycle', opts), - deleteLifecycle: lazyLoad('ilm.delete_lifecycle', opts), - explain_lifecycle: lazyLoad('ilm.explain_lifecycle', opts), - explainLifecycle: lazyLoad('ilm.explain_lifecycle', opts), - get_lifecycle: lazyLoad('ilm.get_lifecycle', opts), - getLifecycle: lazyLoad('ilm.get_lifecycle', opts), - get_status: lazyLoad('ilm.get_status', opts), - getStatus: lazyLoad('ilm.get_status', opts), - move_to_step: lazyLoad('ilm.move_to_step', opts), - moveToStep: lazyLoad('ilm.move_to_step', opts), - put_lifecycle: lazyLoad('ilm.put_lifecycle', opts), - putLifecycle: lazyLoad('ilm.put_lifecycle', opts), - remove_policy: lazyLoad('ilm.remove_policy', opts), - removePolicy: lazyLoad('ilm.remove_policy', opts), - retry: lazyLoad('ilm.retry', opts), - start: lazyLoad('ilm.start', opts), - stop: lazyLoad('ilm.stop', opts) - }, - index: lazyLoad('index', opts), - indices: { - add_block: lazyLoad('indices.add_block', opts), - addBlock: lazyLoad('indices.add_block', opts), - analyze: lazyLoad('indices.analyze', opts), - clear_cache: lazyLoad('indices.clear_cache', opts), - clearCache: lazyLoad('indices.clear_cache', opts), - clone: lazyLoad('indices.clone', opts), - close: lazyLoad('indices.close', opts), - create: lazyLoad('indices.create', opts), - create_data_stream: lazyLoad('indices.create_data_stream', opts), - createDataStream: lazyLoad('indices.create_data_stream', opts), - data_streams_stats: lazyLoad('indices.data_streams_stats', opts), - dataStreamsStats: lazyLoad('indices.data_streams_stats', opts), - delete: lazyLoad('indices.delete', opts), - delete_alias: lazyLoad('indices.delete_alias', opts), - deleteAlias: lazyLoad('indices.delete_alias', opts), - delete_data_stream: lazyLoad('indices.delete_data_stream', opts), - deleteDataStream: lazyLoad('indices.delete_data_stream', opts), - delete_index_template: lazyLoad('indices.delete_index_template', opts), - deleteIndexTemplate: lazyLoad('indices.delete_index_template', opts), - delete_template: lazyLoad('indices.delete_template', opts), - deleteTemplate: lazyLoad('indices.delete_template', opts), - exists: lazyLoad('indices.exists', opts), - exists_alias: lazyLoad('indices.exists_alias', opts), - existsAlias: lazyLoad('indices.exists_alias', opts), - exists_index_template: lazyLoad('indices.exists_index_template', opts), - existsIndexTemplate: lazyLoad('indices.exists_index_template', opts), - exists_template: lazyLoad('indices.exists_template', opts), - existsTemplate: lazyLoad('indices.exists_template', opts), - exists_type: lazyLoad('indices.exists_type', opts), - existsType: lazyLoad('indices.exists_type', opts), - flush: lazyLoad('indices.flush', opts), - flush_synced: lazyLoad('indices.flush_synced', opts), - flushSynced: lazyLoad('indices.flush_synced', opts), - forcemerge: lazyLoad('indices.forcemerge', opts), - freeze: lazyLoad('indices.freeze', opts), - get: lazyLoad('indices.get', opts), - get_alias: lazyLoad('indices.get_alias', opts), - getAlias: lazyLoad('indices.get_alias', opts), - get_data_stream: lazyLoad('indices.get_data_stream', opts), - getDataStream: lazyLoad('indices.get_data_stream', opts), - get_field_mapping: lazyLoad('indices.get_field_mapping', opts), - getFieldMapping: lazyLoad('indices.get_field_mapping', opts), - get_index_template: lazyLoad('indices.get_index_template', opts), - getIndexTemplate: lazyLoad('indices.get_index_template', opts), - get_mapping: lazyLoad('indices.get_mapping', opts), - getMapping: lazyLoad('indices.get_mapping', opts), - get_settings: lazyLoad('indices.get_settings', opts), - getSettings: lazyLoad('indices.get_settings', opts), - get_template: lazyLoad('indices.get_template', opts), - getTemplate: lazyLoad('indices.get_template', opts), - get_upgrade: lazyLoad('indices.get_upgrade', opts), - getUpgrade: lazyLoad('indices.get_upgrade', opts), - open: lazyLoad('indices.open', opts), - put_alias: lazyLoad('indices.put_alias', opts), - putAlias: lazyLoad('indices.put_alias', opts), - put_index_template: lazyLoad('indices.put_index_template', opts), - putIndexTemplate: lazyLoad('indices.put_index_template', opts), - put_mapping: lazyLoad('indices.put_mapping', opts), - putMapping: lazyLoad('indices.put_mapping', opts), - put_settings: lazyLoad('indices.put_settings', opts), - putSettings: lazyLoad('indices.put_settings', opts), - put_template: lazyLoad('indices.put_template', opts), - putTemplate: lazyLoad('indices.put_template', opts), - recovery: lazyLoad('indices.recovery', opts), - refresh: lazyLoad('indices.refresh', opts), - reload_search_analyzers: lazyLoad('indices.reload_search_analyzers', opts), - reloadSearchAnalyzers: lazyLoad('indices.reload_search_analyzers', opts), - resolve_index: lazyLoad('indices.resolve_index', opts), - resolveIndex: lazyLoad('indices.resolve_index', opts), - rollover: lazyLoad('indices.rollover', opts), - segments: lazyLoad('indices.segments', opts), - shard_stores: lazyLoad('indices.shard_stores', opts), - shardStores: lazyLoad('indices.shard_stores', opts), - shrink: lazyLoad('indices.shrink', opts), - simulate_index_template: lazyLoad('indices.simulate_index_template', opts), - simulateIndexTemplate: lazyLoad('indices.simulate_index_template', opts), - simulate_template: lazyLoad('indices.simulate_template', opts), - simulateTemplate: lazyLoad('indices.simulate_template', opts), - split: lazyLoad('indices.split', opts), - stats: lazyLoad('indices.stats', opts), - unfreeze: lazyLoad('indices.unfreeze', opts), - update_aliases: lazyLoad('indices.update_aliases', opts), - updateAliases: lazyLoad('indices.update_aliases', opts), - upgrade: lazyLoad('indices.upgrade', opts), - validate_query: lazyLoad('indices.validate_query', opts), - validateQuery: lazyLoad('indices.validate_query', opts) - }, - info: lazyLoad('info', opts), - ingest: { - delete_pipeline: lazyLoad('ingest.delete_pipeline', opts), - deletePipeline: lazyLoad('ingest.delete_pipeline', opts), - get_pipeline: lazyLoad('ingest.get_pipeline', opts), - getPipeline: lazyLoad('ingest.get_pipeline', opts), - processor_grok: lazyLoad('ingest.processor_grok', opts), - processorGrok: lazyLoad('ingest.processor_grok', opts), - put_pipeline: lazyLoad('ingest.put_pipeline', opts), - putPipeline: lazyLoad('ingest.put_pipeline', opts), - simulate: lazyLoad('ingest.simulate', opts) - }, - license: { - delete: lazyLoad('license.delete', opts), - get: lazyLoad('license.get', opts), - get_basic_status: lazyLoad('license.get_basic_status', opts), - getBasicStatus: lazyLoad('license.get_basic_status', opts), - get_trial_status: lazyLoad('license.get_trial_status', opts), - getTrialStatus: lazyLoad('license.get_trial_status', opts), - post: lazyLoad('license.post', opts), - post_start_basic: lazyLoad('license.post_start_basic', opts), - postStartBasic: lazyLoad('license.post_start_basic', opts), - post_start_trial: lazyLoad('license.post_start_trial', opts), - postStartTrial: lazyLoad('license.post_start_trial', opts) - }, - mget: lazyLoad('mget', opts), - migration: { - deprecations: lazyLoad('migration.deprecations', opts) - }, - ml: { - close_job: lazyLoad('ml.close_job', opts), - closeJob: lazyLoad('ml.close_job', opts), - delete_calendar: lazyLoad('ml.delete_calendar', opts), - deleteCalendar: lazyLoad('ml.delete_calendar', opts), - delete_calendar_event: lazyLoad('ml.delete_calendar_event', opts), - deleteCalendarEvent: lazyLoad('ml.delete_calendar_event', opts), - delete_calendar_job: lazyLoad('ml.delete_calendar_job', opts), - deleteCalendarJob: lazyLoad('ml.delete_calendar_job', opts), - delete_data_frame_analytics: lazyLoad('ml.delete_data_frame_analytics', opts), - deleteDataFrameAnalytics: lazyLoad('ml.delete_data_frame_analytics', opts), - delete_datafeed: lazyLoad('ml.delete_datafeed', opts), - deleteDatafeed: lazyLoad('ml.delete_datafeed', opts), - delete_expired_data: lazyLoad('ml.delete_expired_data', opts), - deleteExpiredData: lazyLoad('ml.delete_expired_data', opts), - delete_filter: lazyLoad('ml.delete_filter', opts), - deleteFilter: lazyLoad('ml.delete_filter', opts), - delete_forecast: lazyLoad('ml.delete_forecast', opts), - deleteForecast: lazyLoad('ml.delete_forecast', opts), - delete_job: lazyLoad('ml.delete_job', opts), - deleteJob: lazyLoad('ml.delete_job', opts), - delete_model_snapshot: lazyLoad('ml.delete_model_snapshot', opts), - deleteModelSnapshot: lazyLoad('ml.delete_model_snapshot', opts), - delete_trained_model: lazyLoad('ml.delete_trained_model', opts), - deleteTrainedModel: lazyLoad('ml.delete_trained_model', opts), - estimate_model_memory: lazyLoad('ml.estimate_model_memory', opts), - estimateModelMemory: lazyLoad('ml.estimate_model_memory', opts), - evaluate_data_frame: lazyLoad('ml.evaluate_data_frame', opts), - evaluateDataFrame: lazyLoad('ml.evaluate_data_frame', opts), - explain_data_frame_analytics: lazyLoad('ml.explain_data_frame_analytics', opts), - explainDataFrameAnalytics: lazyLoad('ml.explain_data_frame_analytics', opts), - find_file_structure: lazyLoad('ml.find_file_structure', opts), - findFileStructure: lazyLoad('ml.find_file_structure', opts), - flush_job: lazyLoad('ml.flush_job', opts), - flushJob: lazyLoad('ml.flush_job', opts), - forecast: lazyLoad('ml.forecast', opts), - get_buckets: lazyLoad('ml.get_buckets', opts), - getBuckets: lazyLoad('ml.get_buckets', opts), - get_calendar_events: lazyLoad('ml.get_calendar_events', opts), - getCalendarEvents: lazyLoad('ml.get_calendar_events', opts), - get_calendars: lazyLoad('ml.get_calendars', opts), - getCalendars: lazyLoad('ml.get_calendars', opts), - get_categories: lazyLoad('ml.get_categories', opts), - getCategories: lazyLoad('ml.get_categories', opts), - get_data_frame_analytics: lazyLoad('ml.get_data_frame_analytics', opts), - getDataFrameAnalytics: lazyLoad('ml.get_data_frame_analytics', opts), - get_data_frame_analytics_stats: lazyLoad('ml.get_data_frame_analytics_stats', opts), - getDataFrameAnalyticsStats: lazyLoad('ml.get_data_frame_analytics_stats', opts), - get_datafeed_stats: lazyLoad('ml.get_datafeed_stats', opts), - getDatafeedStats: lazyLoad('ml.get_datafeed_stats', opts), - get_datafeeds: lazyLoad('ml.get_datafeeds', opts), - getDatafeeds: lazyLoad('ml.get_datafeeds', opts), - get_filters: lazyLoad('ml.get_filters', opts), - getFilters: lazyLoad('ml.get_filters', opts), - get_influencers: lazyLoad('ml.get_influencers', opts), - getInfluencers: lazyLoad('ml.get_influencers', opts), - get_job_stats: lazyLoad('ml.get_job_stats', opts), - getJobStats: lazyLoad('ml.get_job_stats', opts), - get_jobs: lazyLoad('ml.get_jobs', opts), - getJobs: lazyLoad('ml.get_jobs', opts), - get_model_snapshots: lazyLoad('ml.get_model_snapshots', opts), - getModelSnapshots: lazyLoad('ml.get_model_snapshots', opts), - get_overall_buckets: lazyLoad('ml.get_overall_buckets', opts), - getOverallBuckets: lazyLoad('ml.get_overall_buckets', opts), - get_records: lazyLoad('ml.get_records', opts), - getRecords: lazyLoad('ml.get_records', opts), - get_trained_models: lazyLoad('ml.get_trained_models', opts), - getTrainedModels: lazyLoad('ml.get_trained_models', opts), - get_trained_models_stats: lazyLoad('ml.get_trained_models_stats', opts), - getTrainedModelsStats: lazyLoad('ml.get_trained_models_stats', opts), - info: lazyLoad('ml.info', opts), - open_job: lazyLoad('ml.open_job', opts), - openJob: lazyLoad('ml.open_job', opts), - post_calendar_events: lazyLoad('ml.post_calendar_events', opts), - postCalendarEvents: lazyLoad('ml.post_calendar_events', opts), - post_data: lazyLoad('ml.post_data', opts), - postData: lazyLoad('ml.post_data', opts), - preview_datafeed: lazyLoad('ml.preview_datafeed', opts), - previewDatafeed: lazyLoad('ml.preview_datafeed', opts), - put_calendar: lazyLoad('ml.put_calendar', opts), - putCalendar: lazyLoad('ml.put_calendar', opts), - put_calendar_job: lazyLoad('ml.put_calendar_job', opts), - putCalendarJob: lazyLoad('ml.put_calendar_job', opts), - put_data_frame_analytics: lazyLoad('ml.put_data_frame_analytics', opts), - putDataFrameAnalytics: lazyLoad('ml.put_data_frame_analytics', opts), - put_datafeed: lazyLoad('ml.put_datafeed', opts), - putDatafeed: lazyLoad('ml.put_datafeed', opts), - put_filter: lazyLoad('ml.put_filter', opts), - putFilter: lazyLoad('ml.put_filter', opts), - put_job: lazyLoad('ml.put_job', opts), - putJob: lazyLoad('ml.put_job', opts), - put_trained_model: lazyLoad('ml.put_trained_model', opts), - putTrainedModel: lazyLoad('ml.put_trained_model', opts), - revert_model_snapshot: lazyLoad('ml.revert_model_snapshot', opts), - revertModelSnapshot: lazyLoad('ml.revert_model_snapshot', opts), - set_upgrade_mode: lazyLoad('ml.set_upgrade_mode', opts), - setUpgradeMode: lazyLoad('ml.set_upgrade_mode', opts), - start_data_frame_analytics: lazyLoad('ml.start_data_frame_analytics', opts), - startDataFrameAnalytics: lazyLoad('ml.start_data_frame_analytics', opts), - start_datafeed: lazyLoad('ml.start_datafeed', opts), - startDatafeed: lazyLoad('ml.start_datafeed', opts), - stop_data_frame_analytics: lazyLoad('ml.stop_data_frame_analytics', opts), - stopDataFrameAnalytics: lazyLoad('ml.stop_data_frame_analytics', opts), - stop_datafeed: lazyLoad('ml.stop_datafeed', opts), - stopDatafeed: lazyLoad('ml.stop_datafeed', opts), - update_data_frame_analytics: lazyLoad('ml.update_data_frame_analytics', opts), - updateDataFrameAnalytics: lazyLoad('ml.update_data_frame_analytics', opts), - update_datafeed: lazyLoad('ml.update_datafeed', opts), - updateDatafeed: lazyLoad('ml.update_datafeed', opts), - update_filter: lazyLoad('ml.update_filter', opts), - updateFilter: lazyLoad('ml.update_filter', opts), - update_job: lazyLoad('ml.update_job', opts), - updateJob: lazyLoad('ml.update_job', opts), - update_model_snapshot: lazyLoad('ml.update_model_snapshot', opts), - updateModelSnapshot: lazyLoad('ml.update_model_snapshot', opts), - validate: lazyLoad('ml.validate', opts), - validate_detector: lazyLoad('ml.validate_detector', opts), - validateDetector: lazyLoad('ml.validate_detector', opts) - }, - monitoring: { - bulk: lazyLoad('monitoring.bulk', opts) - }, - msearch: lazyLoad('msearch', opts), - msearch_template: lazyLoad('msearch_template', opts), - msearchTemplate: lazyLoad('msearch_template', opts), - mtermvectors: lazyLoad('mtermvectors', opts), - nodes: { - hot_threads: lazyLoad('nodes.hot_threads', opts), - hotThreads: lazyLoad('nodes.hot_threads', opts), - info: lazyLoad('nodes.info', opts), - reload_secure_settings: lazyLoad('nodes.reload_secure_settings', opts), - reloadSecureSettings: lazyLoad('nodes.reload_secure_settings', opts), - stats: lazyLoad('nodes.stats', opts), - usage: lazyLoad('nodes.usage', opts) - }, - open_point_in_time: lazyLoad('open_point_in_time', opts), - openPointInTime: lazyLoad('open_point_in_time', opts), - ping: lazyLoad('ping', opts), - put_script: lazyLoad('put_script', opts), - putScript: lazyLoad('put_script', opts), - rank_eval: lazyLoad('rank_eval', opts), - rankEval: lazyLoad('rank_eval', opts), - reindex: lazyLoad('reindex', opts), - reindex_rethrottle: lazyLoad('reindex_rethrottle', opts), - reindexRethrottle: lazyLoad('reindex_rethrottle', opts), - render_search_template: lazyLoad('render_search_template', opts), - renderSearchTemplate: lazyLoad('render_search_template', opts), - rollup: { - delete_job: lazyLoad('rollup.delete_job', opts), - deleteJob: lazyLoad('rollup.delete_job', opts), - get_jobs: lazyLoad('rollup.get_jobs', opts), - getJobs: lazyLoad('rollup.get_jobs', opts), - get_rollup_caps: lazyLoad('rollup.get_rollup_caps', opts), - getRollupCaps: lazyLoad('rollup.get_rollup_caps', opts), - get_rollup_index_caps: lazyLoad('rollup.get_rollup_index_caps', opts), - getRollupIndexCaps: lazyLoad('rollup.get_rollup_index_caps', opts), - put_job: lazyLoad('rollup.put_job', opts), - putJob: lazyLoad('rollup.put_job', opts), - rollup_search: lazyLoad('rollup.rollup_search', opts), - rollupSearch: lazyLoad('rollup.rollup_search', opts), - start_job: lazyLoad('rollup.start_job', opts), - startJob: lazyLoad('rollup.start_job', opts), - stop_job: lazyLoad('rollup.stop_job', opts), - stopJob: lazyLoad('rollup.stop_job', opts) - }, - scripts_painless_execute: lazyLoad('scripts_painless_execute', opts), - scriptsPainlessExecute: lazyLoad('scripts_painless_execute', opts), - scroll: lazyLoad('scroll', opts), - search: lazyLoad('search', opts), - search_shards: lazyLoad('search_shards', opts), - searchShards: lazyLoad('search_shards', opts), - search_template: lazyLoad('search_template', opts), - searchTemplate: lazyLoad('search_template', opts), - searchable_snapshots: { - clear_cache: lazyLoad('searchable_snapshots.clear_cache', opts), - clearCache: lazyLoad('searchable_snapshots.clear_cache', opts), - mount: lazyLoad('searchable_snapshots.mount', opts), - repository_stats: lazyLoad('searchable_snapshots.repository_stats', opts), - repositoryStats: lazyLoad('searchable_snapshots.repository_stats', opts), - stats: lazyLoad('searchable_snapshots.stats', opts) - }, - searchableSnapshots: { - clear_cache: lazyLoad('searchable_snapshots.clear_cache', opts), - clearCache: lazyLoad('searchable_snapshots.clear_cache', opts), - mount: lazyLoad('searchable_snapshots.mount', opts), - repository_stats: lazyLoad('searchable_snapshots.repository_stats', opts), - repositoryStats: lazyLoad('searchable_snapshots.repository_stats', opts), - stats: lazyLoad('searchable_snapshots.stats', opts) - }, - security: { - authenticate: lazyLoad('security.authenticate', opts), - change_password: lazyLoad('security.change_password', opts), - changePassword: lazyLoad('security.change_password', opts), - clear_cached_privileges: lazyLoad('security.clear_cached_privileges', opts), - clearCachedPrivileges: lazyLoad('security.clear_cached_privileges', opts), - clear_cached_realms: lazyLoad('security.clear_cached_realms', opts), - clearCachedRealms: lazyLoad('security.clear_cached_realms', opts), - clear_cached_roles: lazyLoad('security.clear_cached_roles', opts), - clearCachedRoles: lazyLoad('security.clear_cached_roles', opts), - create_api_key: lazyLoad('security.create_api_key', opts), - createApiKey: lazyLoad('security.create_api_key', opts), - delete_privileges: lazyLoad('security.delete_privileges', opts), - deletePrivileges: lazyLoad('security.delete_privileges', opts), - delete_role: lazyLoad('security.delete_role', opts), - deleteRole: lazyLoad('security.delete_role', opts), - delete_role_mapping: lazyLoad('security.delete_role_mapping', opts), - deleteRoleMapping: lazyLoad('security.delete_role_mapping', opts), - delete_user: lazyLoad('security.delete_user', opts), - deleteUser: lazyLoad('security.delete_user', opts), - disable_user: lazyLoad('security.disable_user', opts), - disableUser: lazyLoad('security.disable_user', opts), - enable_user: lazyLoad('security.enable_user', opts), - enableUser: lazyLoad('security.enable_user', opts), - get_api_key: lazyLoad('security.get_api_key', opts), - getApiKey: lazyLoad('security.get_api_key', opts), - get_builtin_privileges: lazyLoad('security.get_builtin_privileges', opts), - getBuiltinPrivileges: lazyLoad('security.get_builtin_privileges', opts), - get_privileges: lazyLoad('security.get_privileges', opts), - getPrivileges: lazyLoad('security.get_privileges', opts), - get_role: lazyLoad('security.get_role', opts), - getRole: lazyLoad('security.get_role', opts), - get_role_mapping: lazyLoad('security.get_role_mapping', opts), - getRoleMapping: lazyLoad('security.get_role_mapping', opts), - get_token: lazyLoad('security.get_token', opts), - getToken: lazyLoad('security.get_token', opts), - get_user: lazyLoad('security.get_user', opts), - getUser: lazyLoad('security.get_user', opts), - get_user_privileges: lazyLoad('security.get_user_privileges', opts), - getUserPrivileges: lazyLoad('security.get_user_privileges', opts), - has_privileges: lazyLoad('security.has_privileges', opts), - hasPrivileges: lazyLoad('security.has_privileges', opts), - invalidate_api_key: lazyLoad('security.invalidate_api_key', opts), - invalidateApiKey: lazyLoad('security.invalidate_api_key', opts), - invalidate_token: lazyLoad('security.invalidate_token', opts), - invalidateToken: lazyLoad('security.invalidate_token', opts), - put_privileges: lazyLoad('security.put_privileges', opts), - putPrivileges: lazyLoad('security.put_privileges', opts), - put_role: lazyLoad('security.put_role', opts), - putRole: lazyLoad('security.put_role', opts), - put_role_mapping: lazyLoad('security.put_role_mapping', opts), - putRoleMapping: lazyLoad('security.put_role_mapping', opts), - put_user: lazyLoad('security.put_user', opts), - putUser: lazyLoad('security.put_user', opts) - }, - slm: { - delete_lifecycle: lazyLoad('slm.delete_lifecycle', opts), - deleteLifecycle: lazyLoad('slm.delete_lifecycle', opts), - execute_lifecycle: lazyLoad('slm.execute_lifecycle', opts), - executeLifecycle: lazyLoad('slm.execute_lifecycle', opts), - execute_retention: lazyLoad('slm.execute_retention', opts), - executeRetention: lazyLoad('slm.execute_retention', opts), - get_lifecycle: lazyLoad('slm.get_lifecycle', opts), - getLifecycle: lazyLoad('slm.get_lifecycle', opts), - get_stats: lazyLoad('slm.get_stats', opts), - getStats: lazyLoad('slm.get_stats', opts), - get_status: lazyLoad('slm.get_status', opts), - getStatus: lazyLoad('slm.get_status', opts), - put_lifecycle: lazyLoad('slm.put_lifecycle', opts), - putLifecycle: lazyLoad('slm.put_lifecycle', opts), - start: lazyLoad('slm.start', opts), - stop: lazyLoad('slm.stop', opts) - }, - snapshot: { - cleanup_repository: lazyLoad('snapshot.cleanup_repository', opts), - cleanupRepository: lazyLoad('snapshot.cleanup_repository', opts), - create: lazyLoad('snapshot.create', opts), - create_repository: lazyLoad('snapshot.create_repository', opts), - createRepository: lazyLoad('snapshot.create_repository', opts), - delete: lazyLoad('snapshot.delete', opts), - delete_repository: lazyLoad('snapshot.delete_repository', opts), - deleteRepository: lazyLoad('snapshot.delete_repository', opts), - get: lazyLoad('snapshot.get', opts), - get_repository: lazyLoad('snapshot.get_repository', opts), - getRepository: lazyLoad('snapshot.get_repository', opts), - restore: lazyLoad('snapshot.restore', opts), - status: lazyLoad('snapshot.status', opts), - verify_repository: lazyLoad('snapshot.verify_repository', opts), - verifyRepository: lazyLoad('snapshot.verify_repository', opts) - }, - sql: { - clear_cursor: lazyLoad('sql.clear_cursor', opts), - clearCursor: lazyLoad('sql.clear_cursor', opts), - query: lazyLoad('sql.query', opts), - translate: lazyLoad('sql.translate', opts) - }, - ssl: { - certificates: lazyLoad('ssl.certificates', opts) - }, - tasks: { - cancel: lazyLoad('tasks.cancel', opts), - get: lazyLoad('tasks.get', opts), - list: lazyLoad('tasks.list', opts) - }, - termvectors: lazyLoad('termvectors', opts), - transform: { - delete_transform: lazyLoad('transform.delete_transform', opts), - deleteTransform: lazyLoad('transform.delete_transform', opts), - get_transform: lazyLoad('transform.get_transform', opts), - getTransform: lazyLoad('transform.get_transform', opts), - get_transform_stats: lazyLoad('transform.get_transform_stats', opts), - getTransformStats: lazyLoad('transform.get_transform_stats', opts), - preview_transform: lazyLoad('transform.preview_transform', opts), - previewTransform: lazyLoad('transform.preview_transform', opts), - put_transform: lazyLoad('transform.put_transform', opts), - putTransform: lazyLoad('transform.put_transform', opts), - start_transform: lazyLoad('transform.start_transform', opts), - startTransform: lazyLoad('transform.start_transform', opts), - stop_transform: lazyLoad('transform.stop_transform', opts), - stopTransform: lazyLoad('transform.stop_transform', opts), - update_transform: lazyLoad('transform.update_transform', opts), - updateTransform: lazyLoad('transform.update_transform', opts) - }, - update: lazyLoad('update', opts), - update_by_query: lazyLoad('update_by_query', opts), - updateByQuery: lazyLoad('update_by_query', opts), - update_by_query_rethrottle: lazyLoad('update_by_query_rethrottle', opts), - updateByQueryRethrottle: lazyLoad('update_by_query_rethrottle', opts), - watcher: { - ack_watch: lazyLoad('watcher.ack_watch', opts), - ackWatch: lazyLoad('watcher.ack_watch', opts), - activate_watch: lazyLoad('watcher.activate_watch', opts), - activateWatch: lazyLoad('watcher.activate_watch', opts), - deactivate_watch: lazyLoad('watcher.deactivate_watch', opts), - deactivateWatch: lazyLoad('watcher.deactivate_watch', opts), - delete_watch: lazyLoad('watcher.delete_watch', opts), - deleteWatch: lazyLoad('watcher.delete_watch', opts), - execute_watch: lazyLoad('watcher.execute_watch', opts), - executeWatch: lazyLoad('watcher.execute_watch', opts), - get_watch: lazyLoad('watcher.get_watch', opts), - getWatch: lazyLoad('watcher.get_watch', opts), - put_watch: lazyLoad('watcher.put_watch', opts), - putWatch: lazyLoad('watcher.put_watch', opts), - start: lazyLoad('watcher.start', opts), - stats: lazyLoad('watcher.stats', opts), - stop: lazyLoad('watcher.stop', opts) - }, - xpack: { - info: lazyLoad('xpack.info', opts), - usage: lazyLoad('xpack.usage', opts) -======= Object.defineProperties(ESAPI.prototype, { cat: { get () { @@ -847,7 +198,6 @@ Object.defineProperties(ESAPI.prototype, { this[kCat] = new CatApi(this.transport, this[kConfigurationError]) } return this[kCat] ->>>>>>> a064f0f3... Improve child performances (#1314) } }, clear_scroll: { get () { return this.clearScroll } }, diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index a6aea51cd..9c4c4b5b8 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -41,8 +41,6 @@ export interface AsyncSearchGet extends Generic { export interface AsyncSearchSubmit extends Generic { index?: string | string[]; - _source_exclude?: string | string[]; - _source_include?: string | string[]; wait_for_completion_timeout?: string; keep_on_completion?: boolean; keep_alive?: string; @@ -78,7 +76,7 @@ export interface AsyncSearchSubmit extends Generic { suggest_text?: string; timeout?: string; track_scores?: boolean; - track_total_hits?: boolean | number; + track_total_hits?: boolean; allow_partial_search_results?: boolean; typed_keys?: boolean; version?: boolean; @@ -833,18 +831,9 @@ export interface GetSource extends Generic { version_type?: 'internal' | 'external' | 'external_gte' | 'force'; } -<<<<<<< HEAD -export interface Index extends Generic { - id?: string; - index: string; - type?: string; - wait_for_active_shards?: string; - op_type?: 'index' | 'create'; - refresh?: 'wait_for' | boolean; -======= export interface GraphExplore extends Generic { index: string | string[]; ->>>>>>> a064f0f3... Improve child performances (#1314) + type?: string | string[]; routing?: string; timeout?: string; body?: T; @@ -894,6 +883,7 @@ export interface IlmStop extends Generic { export interface Index extends Generic { id?: string; index: string; + type?: string; wait_for_active_shards?: string; op_type?: 'index' | 'create'; refresh?: 'wait_for' | boolean; @@ -1440,776 +1430,6 @@ export interface Mget extends Generic { body: T; } -<<<<<<< HEAD -export interface Msearch extends Generic { - index?: string | string[]; - type?: string | string[]; - search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch'; - max_concurrent_searches?: number; - typed_keys?: boolean; - pre_filter_shard_size?: number; - max_concurrent_shard_requests?: number; - rest_total_hits_as_int?: boolean; - ccs_minimize_roundtrips?: boolean; - body: T; -} - -export interface MsearchTemplate extends Generic { - index?: string | string[]; - type?: string | string[]; - search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch'; - typed_keys?: boolean; - max_concurrent_searches?: number; - rest_total_hits_as_int?: boolean; - ccs_minimize_roundtrips?: boolean; - body: T; -} - -export interface Mtermvectors extends Generic { - index?: string; - type?: string; - ids?: string | string[]; - term_statistics?: boolean; - field_statistics?: boolean; - fields?: string | string[]; - offsets?: boolean; - positions?: boolean; - payloads?: boolean; - preference?: string; - routing?: string; - realtime?: boolean; - version?: number; - version_type?: 'internal' | 'external' | 'external_gte' | 'force'; - body?: T; -======= -export interface MigrationDeprecations extends Generic { - index?: string; -} - -export interface MlCloseJob extends Generic { - job_id: string; - allow_no_match?: boolean; - allow_no_jobs?: boolean; - force?: boolean; - timeout?: string; - body?: T; -} - -export interface MlDeleteCalendar extends Generic { - calendar_id: string; ->>>>>>> a064f0f3... Improve child performances (#1314) -} - -export interface MlDeleteCalendarEvent extends Generic { - calendar_id: string; - event_id: string; -} - -export interface MlDeleteCalendarJob extends Generic { - calendar_id: string; - job_id: string; -} - -export interface MlDeleteDataFrameAnalytics extends Generic { - id: string; - force?: boolean; - timeout?: string; -} - -export interface MlDeleteDatafeed extends Generic { - datafeed_id: string; - force?: boolean; -} - -export interface MlDeleteExpiredData extends Generic { - job_id?: string; - requests_per_second?: number; - timeout?: string; - body?: T; -} - -export interface MlDeleteFilter extends Generic { - filter_id: string; -} - -export interface MlDeleteForecast extends Generic { - job_id: string; - forecast_id?: string; - allow_no_forecasts?: boolean; - timeout?: string; -} - -export interface MlDeleteJob extends Generic { - job_id: string; - force?: boolean; - wait_for_completion?: boolean; -} - -export interface MlDeleteModelSnapshot extends Generic { - job_id: string; - snapshot_id: string; -} - -export interface MlDeleteTrainedModel extends Generic { - model_id: string; -} - -export interface MlEstimateModelMemory extends Generic { - body: T; -} - -<<<<<<< HEAD -export interface RankEval extends Generic { - index?: string | string[]; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - search_type?: 'query_then_fetch' | 'dfs_query_then_fetch'; - body: T; -} - -export interface Reindex extends Generic { - refresh?: boolean; - timeout?: string; - wait_for_active_shards?: string; - wait_for_completion?: boolean; - requests_per_second?: number; - scroll?: string; - slices?: number|string; - max_docs?: number; - body: T; -} - -export interface ReindexRethrottle extends Generic { - task_id: string; - requests_per_second: number; -} - -export interface RenderSearchTemplate extends Generic { - id?: string; - body?: T; -} - -export interface ScriptsPainlessExecute extends Generic { - body?: T; -} - -export interface Scroll extends Generic { - scroll_id?: string; - scroll?: string; - rest_total_hits_as_int?: boolean; - body?: T; -} - -export interface Search extends Generic { - index?: string | string[]; - type?: string | string[]; - analyzer?: string; - analyze_wildcard?: boolean; - ccs_minimize_roundtrips?: boolean; - default_operator?: 'AND' | 'OR'; - df?: string; - explain?: boolean; - stored_fields?: string | string[]; - docvalue_fields?: string | string[]; - from?: number; - ignore_unavailable?: boolean; - ignore_throttled?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - lenient?: boolean; - preference?: string; - q?: string; - routing?: string | string[]; - scroll?: string; - search_type?: 'query_then_fetch' | 'dfs_query_then_fetch'; - size?: number; - sort?: string | string[]; - _source?: string | string[]; - _source_excludes?: string | string[]; - _source_includes?: string | string[]; - terminate_after?: number; - stats?: string | string[]; - suggest_field?: string; - suggest_mode?: 'missing' | 'popular' | 'always'; - suggest_size?: number; - suggest_text?: string; - timeout?: string; - track_scores?: boolean; - track_total_hits?: boolean; - allow_partial_search_results?: boolean; - typed_keys?: boolean; - version?: boolean; - seq_no_primary_term?: boolean; - request_cache?: boolean; - batched_reduce_size?: number; - max_concurrent_shard_requests?: number; - pre_filter_shard_size?: number; - rest_total_hits_as_int?: boolean; - body?: T; -} - -export interface SearchShards extends Generic { - index?: string | string[]; - preference?: string; - routing?: string; - local?: boolean; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; -} - -export interface SearchTemplate extends Generic { - index?: string | string[]; - type?: string | string[]; - ignore_unavailable?: boolean; - ignore_throttled?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - preference?: string; - routing?: string | string[]; - scroll?: string; - search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch'; - explain?: boolean; - profile?: boolean; - typed_keys?: boolean; - rest_total_hits_as_int?: boolean; - ccs_minimize_roundtrips?: boolean; - body: T; -} - -export interface SnapshotCleanupRepository extends Generic { - repository: string; - master_timeout?: string; - timeout?: string; -} - -export interface SnapshotCreate extends Generic { - repository: string; - snapshot: string; - master_timeout?: string; - wait_for_completion?: boolean; - body?: T; -} - -export interface SnapshotCreateRepository extends Generic { - repository: string; - master_timeout?: string; - timeout?: string; - verify?: boolean; - body: T; -} - -export interface SnapshotDelete extends Generic { - repository: string; - snapshot: string; - master_timeout?: string; -} - -export interface SnapshotDeleteRepository extends Generic { - repository: string | string[]; - master_timeout?: string; - timeout?: string; -} - -export interface SnapshotGet extends Generic { - repository: string; - snapshot: string | string[]; - master_timeout?: string; - ignore_unavailable?: boolean; - verbose?: boolean; -} - -export interface SnapshotGetRepository extends Generic { - repository?: string | string[]; - master_timeout?: string; - local?: boolean; -} - -export interface SnapshotRestore extends Generic { - repository: string; - snapshot: string; - master_timeout?: string; - wait_for_completion?: boolean; - body?: T; -} - -export interface SnapshotStatus extends Generic { - repository?: string; - snapshot?: string | string[]; - master_timeout?: string; - ignore_unavailable?: boolean; -} - -export interface SnapshotVerifyRepository extends Generic { - repository: string; - master_timeout?: string; - timeout?: string; -} - -export interface TasksCancel extends Generic { - task_id?: string; - nodes?: string | string[]; - actions?: string | string[]; - parent_task_id?: string; - wait_for_completion?: boolean; -} - -export interface TasksGet extends Generic { - task_id: string; - wait_for_completion?: boolean; - timeout?: string; -} - -export interface TasksList extends Generic { - nodes?: string | string[]; - actions?: string | string[]; - detailed?: boolean; - parent_task_id?: string; - wait_for_completion?: boolean; - group_by?: 'nodes' | 'parents' | 'none'; - timeout?: string; -} - -export interface Termvectors extends Generic { - index: string; - id?: string; - type?: string; - term_statistics?: boolean; - field_statistics?: boolean; - fields?: string | string[]; - offsets?: boolean; - positions?: boolean; - payloads?: boolean; - preference?: string; - routing?: string; - realtime?: boolean; - version?: number; - version_type?: 'internal' | 'external' | 'external_gte' | 'force'; - body?: T; -} - -export interface Update extends Generic { - id: string; - index: string; - type?: string; - wait_for_active_shards?: string; - _source?: string | string[]; - _source_excludes?: string | string[]; - _source_includes?: string | string[]; - lang?: string; - refresh?: 'wait_for' | boolean; - retry_on_conflict?: number; - routing?: string; - timeout?: string; - if_seq_no?: number; - if_primary_term?: number; - require_alias?: boolean; - body: T; -} - -export interface UpdateByQuery extends Generic { - index: string | string[]; - type?: string | string[]; - analyzer?: string; - analyze_wildcard?: boolean; - default_operator?: 'AND' | 'OR'; - df?: string; - from?: number; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - conflicts?: 'abort' | 'proceed'; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - lenient?: boolean; - pipeline?: string; - preference?: string; - q?: string; - routing?: string | string[]; - scroll?: string; - search_type?: 'query_then_fetch' | 'dfs_query_then_fetch'; - search_timeout?: string; - size?: number; - max_docs?: number; - sort?: string | string[]; - _source?: string | string[]; - _source_excludes?: string | string[]; - _source_includes?: string | string[]; - terminate_after?: number; - stats?: string | string[]; - version?: boolean; - version_type?: boolean; - request_cache?: boolean; - refresh?: boolean; - timeout?: string; - wait_for_active_shards?: string; - scroll_size?: number; - wait_for_completion?: boolean; - requests_per_second?: number; - slices?: number|string; - body?: T; -} - -export interface UpdateByQueryRethrottle extends Generic { - task_id: string; - requests_per_second: number; -} - -export interface AsyncSearchDelete extends Generic { - id: string; -} - -export interface AsyncSearchGet extends Generic { - id: string; - wait_for_completion_timeout?: string; - keep_alive?: string; - typed_keys?: boolean; -} - -export interface AsyncSearchSubmit extends Generic { - index?: string | string[]; - wait_for_completion_timeout?: string; - keep_on_completion?: boolean; - keep_alive?: string; - batched_reduce_size?: number; - request_cache?: boolean; - analyzer?: string; - analyze_wildcard?: boolean; - default_operator?: 'AND' | 'OR'; - df?: string; - explain?: boolean; - stored_fields?: string | string[]; - docvalue_fields?: string | string[]; - from?: number; - ignore_unavailable?: boolean; - ignore_throttled?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - lenient?: boolean; - preference?: string; - q?: string; - routing?: string | string[]; - search_type?: 'query_then_fetch' | 'dfs_query_then_fetch'; - size?: number; - sort?: string | string[]; - _source?: string | string[]; - _source_excludes?: string | string[]; - _source_includes?: string | string[]; - terminate_after?: number; - stats?: string | string[]; - suggest_field?: string; - suggest_mode?: 'missing' | 'popular' | 'always'; - suggest_size?: number; - suggest_text?: string; - timeout?: string; - track_scores?: boolean; - track_total_hits?: boolean; - allow_partial_search_results?: boolean; - typed_keys?: boolean; - version?: boolean; - seq_no_primary_term?: boolean; - max_concurrent_shard_requests?: number; - body?: T; -} - -export interface AutoscalingDeleteAutoscalingPolicy extends Generic { - name: string; -} - -export interface AutoscalingGetAutoscalingDecision extends Generic { -} - -export interface AutoscalingGetAutoscalingPolicy extends Generic { - name: string; -} - -export interface AutoscalingPutAutoscalingPolicy extends Generic { - name: string; - body: T; -} - -export interface CatMlDataFrameAnalytics extends Generic { - id?: string; - allow_no_match?: boolean; - bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; - format?: string; - h?: string | string[]; - help?: boolean; - s?: string | string[]; - time?: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos'; - v?: boolean; -} - -export interface CatMlDatafeeds extends Generic { - datafeed_id?: string; - allow_no_match?: boolean; - allow_no_datafeeds?: boolean; - format?: string; - h?: string | string[]; - help?: boolean; - s?: string | string[]; - time?: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos'; - v?: boolean; -} - -export interface CatMlJobs extends Generic { - job_id?: string; - allow_no_match?: boolean; - allow_no_jobs?: boolean; - bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; - format?: string; - h?: string | string[]; - help?: boolean; - s?: string | string[]; - time?: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos'; - v?: boolean; -} - -export interface CatMlTrainedModels extends Generic { - model_id?: string; - allow_no_match?: boolean; - from?: number; - size?: number; - bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; - format?: string; - h?: string | string[]; - help?: boolean; - s?: string | string[]; - time?: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos'; - v?: boolean; -} - -export interface CatTransforms extends Generic { - transform_id?: string; - from?: number; - size?: number; - allow_no_match?: boolean; - format?: string; - h?: string | string[]; - help?: boolean; - s?: string | string[]; - time?: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos'; - v?: boolean; -} - -export interface CcrDeleteAutoFollowPattern extends Generic { - name: string; -} - -export interface CcrFollow extends Generic { - index: string; - wait_for_active_shards?: string; - body: T; -} - -export interface CcrFollowInfo extends Generic { - index: string | string[]; -} - -export interface CcrFollowStats extends Generic { - index: string | string[]; -} - -export interface CcrForgetFollower extends Generic { - index: string; - body: T; -} - -export interface CcrGetAutoFollowPattern extends Generic { - name?: string; -} - -export interface CcrPauseAutoFollowPattern extends Generic { - name: string; -} - -export interface CcrPauseFollow extends Generic { - index: string; -} - -export interface CcrPutAutoFollowPattern extends Generic { - name: string; - body: T; -} - -export interface CcrResumeAutoFollowPattern extends Generic { - name: string; -} - -export interface CcrResumeFollow extends Generic { - index: string; - body?: T; -} - -export interface CcrStats extends Generic { -} - -export interface CcrUnfollow extends Generic { - index: string; -} - -export interface ClosePointInTime extends Generic { - body?: T; -} - -export interface EnrichDeletePolicy extends Generic { - name: string; -} - -export interface EnrichExecutePolicy extends Generic { - name: string; - wait_for_completion?: boolean; -} - -export interface EnrichGetPolicy extends Generic { - name?: string | string[]; -} - -export interface EnrichPutPolicy extends Generic { - name: string; - body: T; -} - -export interface EnrichStats extends Generic { -} - -export interface EqlDelete extends Generic { - id: string; -} - -export interface EqlGet extends Generic { - id: string; - wait_for_completion_timeout?: string; - keep_alive?: string; -} - -export interface EqlSearch extends Generic { - index: string; - wait_for_completion_timeout?: string; - keep_on_completion?: boolean; - keep_alive?: string; - body: T; -} - -export interface GraphExplore extends Generic { - index: string | string[]; - type?: string | string[]; - routing?: string; - timeout?: string; - body?: T; -} - -export interface IlmDeleteLifecycle extends Generic { - policy: string; -} - -export interface IlmExplainLifecycle extends Generic { - index: string; - only_managed?: boolean; - only_errors?: boolean; -} - -export interface IlmGetLifecycle extends Generic { - policy?: string; -} - -export interface IlmGetStatus extends Generic { -} - -export interface IlmMoveToStep extends Generic { - index: string; - body?: T; -} - -export interface IlmPutLifecycle extends Generic { - policy: string; - body?: T; -} - -export interface IlmRemovePolicy extends Generic { - index: string; -} - -export interface IlmRetry extends Generic { - index: string; -} - -export interface IlmStart extends Generic { -} - -export interface IlmStop extends Generic { -} - -export interface IndicesCreateDataStream extends Generic { - name: string; -} - -export interface IndicesDataStreamsStats extends Generic { - name?: string | string[]; -} - -export interface IndicesDeleteDataStream extends Generic { - name: string | string[]; -} - -export interface IndicesFreeze extends Generic { - index: string; - timeout?: string; - master_timeout?: string; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - wait_for_active_shards?: string; -} - -export interface IndicesGetDataStream extends Generic { - name?: string | string[]; -} - -export interface IndicesReloadSearchAnalyzers extends Generic { - index: string | string[]; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; -} - -export interface IndicesUnfreeze extends Generic { - index: string; - timeout?: string; - master_timeout?: string; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - wait_for_active_shards?: string; -} - -export interface LicenseDelete extends Generic { -} - -export interface LicenseGet extends Generic { - local?: boolean; - accept_enterprise?: boolean; -} - -export interface LicenseGetBasicStatus extends Generic { -} - -export interface LicenseGetTrialStatus extends Generic { -} - -export interface LicensePost extends Generic { - acknowledge?: boolean; - body?: T; -} - -export interface LicensePostStartBasic extends Generic { - acknowledge?: boolean; -} - -export interface LicensePostStartTrial extends Generic { - type?: string; - acknowledge?: boolean; -} - export interface MigrationDeprecations extends Generic { index?: string; } @@ -2285,8 +1505,6 @@ export interface MlEstimateModelMemory extends Generic { body: T; } -======= ->>>>>>> a064f0f3... Improve child performances (#1314) export interface MlEvaluateDataFrame extends Generic { body: T; } @@ -2638,6 +1856,7 @@ export interface MonitoringBulk extends Generic { export interface Msearch extends Generic { index?: string | string[]; + type?: string | string[]; search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch'; max_concurrent_searches?: number; typed_keys?: boolean; @@ -2650,6 +1869,7 @@ export interface Msearch extends Generic { export interface MsearchTemplate extends Generic { index?: string | string[]; + type?: string | string[]; search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch'; typed_keys?: boolean; max_concurrent_searches?: number; @@ -2660,6 +1880,7 @@ export interface MsearchTemplate extends Generic { export interface Mtermvectors extends Generic { index?: string; + type?: string; ids?: string | string[]; term_statistics?: boolean; field_statistics?: boolean; @@ -2671,7 +1892,7 @@ export interface Mtermvectors extends Generic { routing?: string; realtime?: boolean; version?: number; - version_type?: 'internal' | 'external' | 'external_gte'; + version_type?: 'internal' | 'external' | 'external_gte' | 'force'; body?: T; } @@ -2821,8 +2042,7 @@ export interface Scroll extends Generic { export interface Search extends Generic { index?: string | string[]; - _source_exclude?: string | string[]; - _source_include?: string | string[]; + type?: string | string[]; analyzer?: string; analyze_wildcard?: boolean; ccs_minimize_roundtrips?: boolean; @@ -2855,7 +2075,7 @@ export interface Search extends Generic { suggest_text?: string; timeout?: string; track_scores?: boolean; - track_total_hits?: boolean | number; + track_total_hits?: boolean; allow_partial_search_results?: boolean; typed_keys?: boolean; version?: boolean; @@ -2880,6 +2100,7 @@ export interface SearchShards extends Generic { export interface SearchTemplate extends Generic { index?: string | string[]; + type?: string | string[]; ignore_unavailable?: boolean; ignore_throttled?: boolean; allow_no_indices?: boolean; @@ -3104,7 +2325,7 @@ export interface SnapshotCreateRepository extends Generic { export interface SnapshotDelete extends Generic { repository: string; - snapshot: string | string[]; + snapshot: string; master_timeout?: string; } @@ -3192,6 +2413,7 @@ export interface TasksList extends Generic { export interface Termvectors extends Generic { index: string; id?: string; + type?: string; term_statistics?: boolean; field_statistics?: boolean; fields?: string | string[]; @@ -3202,7 +2424,7 @@ export interface Termvectors extends Generic { routing?: string; realtime?: boolean; version?: number; - version_type?: 'internal' | 'external' | 'external_gte'; + version_type?: 'internal' | 'external' | 'external_gte' | 'force'; body?: T; } @@ -3259,8 +2481,6 @@ export interface Update extends Generic { id: string; index: string; type?: string; - _source_exclude?: string | string[]; - _source_include?: string | string[]; wait_for_active_shards?: string; _source?: string | string[]; _source_excludes?: string | string[]; @@ -3278,8 +2498,7 @@ export interface Update extends Generic { export interface UpdateByQuery extends Generic { index: string | string[]; - _source_exclude?: string | string[]; - _source_include?: string | string[]; + type?: string | string[]; analyzer?: string; analyze_wildcard?: boolean; default_operator?: 'AND' | 'OR'; @@ -3297,6 +2516,7 @@ export interface UpdateByQuery extends Generic { scroll?: string; search_type?: 'query_then_fetch' | 'dfs_query_then_fetch'; search_timeout?: string; + size?: number; max_docs?: number; sort?: string | string[]; _source?: string | string[]; diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index d6822f695..d619bc61c 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -95,681 +95,7 @@ link:{ref}/common-options.html[Documentation] |`list` - A comma-separated list of filters used to reduce the response. |=== -<<<<<<< HEAD -=== bulk - -[source,ts] ----- -client.bulk({ - index: string, - type: string, - wait_for_active_shards: string, - refresh: 'true' | 'false' | 'wait_for', - routing: string, - timeout: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - pipeline: string, - require_alias: boolean, - body: object -}) ----- -link:{ref}/docs-bulk.html[Documentation] + -{jsclient}/bulk_examples.html[Code Example] + -[cols=2*] -|=== -|`index` -|`string` - Default index for items which don't provide one - -|`type` -|`string` - Default document type for items which don't provide one - -|`wait_for_active_shards` or `waitForActiveShards` -|`string` - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - -|`refresh` -|`'true' \| 'false' \| 'wait_for'` - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - -|`routing` -|`string` - Specific routing value - -|`timeout` -|`string` - Explicit operation timeout - -|`_source` -|`string \| string[]` - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - -|`_source_excludes` or `_sourceExcludes` -|`string \| string[]` - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - -|`_source_includes` or `_sourceIncludes` -|`string \| string[]` - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - -|`pipeline` -|`string` - The pipeline id to preprocess incoming documents with - -|`require_alias` or `requireAlias` -|`boolean` - Sets require_alias for all incoming documents. Defaults to unset (false) - -|`body` -|`object` - The operation definition and data (action-data pairs), separated by newlines - -|=== - -=== cat.aliases - -[source,ts] ----- -client.cat.aliases({ - name: string | string[], - format: string, - local: boolean, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all' -}) ----- -link:{ref}/cat-alias.html[Documentation] + -[cols=2*] -|=== -|`name` -|`string \| string[]` - A comma-separated list of alias names to return - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|`expand_wildcards` or `expandWildcards` -|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + -_Default:_ `all` - -|=== - -=== cat.allocation - -[source,ts] ----- -client.cat.allocation({ - node_id: string | string[], - format: string, - bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-allocation.html[Documentation] + -[cols=2*] -|=== -|`node_id` or `nodeId` -|`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`bytes` -|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.count - -[source,ts] ----- -client.cat.count({ - index: string | string[], - format: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-count.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string \| string[]` - A comma-separated list of index names to limit the returned information - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.fielddata - -[source,ts] ----- -client.cat.fielddata({ - fields: string | string[], - format: string, - bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-fielddata.html[Documentation] + -[cols=2*] -|=== -|`fields` -|`string \| string[]` - A comma-separated list of fields to return the fielddata size - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`bytes` -|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.health - -[source,ts] ----- -client.cat.health({ - format: string, - h: string | string[], - help: boolean, - s: string | string[], - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', - ts: boolean, - v: boolean -}) ----- -link:{ref}/cat-health.html[Documentation] + -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`time` -|`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values - -|`ts` -|`boolean` - Set to false to disable timestamping + -_Default:_ `true` - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.help - -[source,ts] ----- -client.cat.help({ - help: boolean, - s: string | string[] -}) ----- -link:{ref}/cat.html[Documentation] + -[cols=2*] -|=== -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|=== - -=== cat.indices - -[source,ts] ----- -client.cat.indices({ - index: string | string[], - format: string, - bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - local: boolean, - master_timeout: string, - h: string | string[], - health: 'green' | 'yellow' | 'red', - help: boolean, - pri: boolean, - s: string | string[], - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', - v: boolean, - include_unloaded_segments: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all' -}) ----- -link:{ref}/cat-indices.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string \| string[]` - A comma-separated list of index names to limit the returned information - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`bytes` -|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`health` -|`'green' \| 'yellow' \| 'red'` - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - -|`help` -|`boolean` - Return help information - -|`pri` -|`boolean` - Set to true to return stats only for primary shards - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`time` -|`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values - -|`v` -|`boolean` - Verbose mode. Display column headers - -|`include_unloaded_segments` or `includeUnloadedSegments` -|`boolean` - If set to true segment stats will include stats for segments that are not currently loaded into memory - -|`expand_wildcards` or `expandWildcards` -|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + -_Default:_ `all` - -|=== - -=== cat.master - -[source,ts] ----- -client.cat.master({ - format: string, - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-master.html[Documentation] + -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.nodeattrs - -[source,ts] ----- -client.cat.nodeattrs({ - format: string, - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-nodeattrs.html[Documentation] + -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.nodes - -[source,ts] ----- -client.cat.nodes({ - bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - format: string, - full_id: boolean, - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', - v: boolean -}) ----- -link:{ref}/cat-nodes.html[Documentation] + -[cols=2*] -|=== -|`bytes` -|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`full_id` or `fullId` -|`boolean` - Return the full node ID instead of the shortened version (default: false) - -|`local` -|`boolean` - Calculate the selected nodes using the local cluster state rather than the state from master node (default: false) + - -WARNING: This parameter has been deprecated. - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`time` -|`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.pendingTasks - -[source,ts] ----- -client.cat.pendingTasks({ - format: string, - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', - v: boolean -}) ----- -link:{ref}/cat-pending-tasks.html[Documentation] + -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`time` -|`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.plugins - -[source,ts] ----- -client.cat.plugins({ - format: string, - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-plugins.html[Documentation] + -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.recovery - -[source,ts] ----- -client.cat.recovery({ - index: string | string[], - format: string, - active_only: boolean, - bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - detailed: boolean, - h: string | string[], - help: boolean, - s: string | string[], - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', - v: boolean -}) ----- -link:{ref}/cat-recovery.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string \| string[]` - Comma-separated list or wildcard expression of index names to limit the returned information - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`active_only` or `activeOnly` -|`boolean` - If `true`, the response only includes ongoing shard recoveries - -|`bytes` -|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values - -|`detailed` -|`boolean` - If `true`, the response includes detailed information about shard recoveries - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`time` -|`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.repositories - -[source,ts] ----- -client.cat.repositories({ - format: string, - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-repositories.html[Documentation] + -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.segments -======= === asyncSearch.delete ->>>>>>> a064f0f3... Improve child performances (#1314) [source,ts] ---- @@ -854,7 +180,7 @@ client.asyncSearch.submit({ suggest_text: string, timeout: string, track_scores: boolean, - track_total_hits: boolean|long, + track_total_hits: boolean, allow_partial_search_results: boolean, typed_keys: boolean, version: boolean, @@ -974,43 +300,14 @@ _Default:_ `missing` |`suggest_text` or `suggestText` |`string` - The source text for which the suggestions should be returned -<<<<<<< HEAD -[source,ts] ----- -client.cat.threadPool({ - thread_pool_patterns: string | string[], - format: string, - size: '' | 'k' | 'm' | 'g' | 't' | 'p', - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-thread-pool.html[Documentation] + -[cols=2*] -|=== -|`thread_pool_patterns` or `threadPoolPatterns` -|`string \| string[]` - A comma-separated list of regular-expressions to filter the thread pools in the output -======= |`timeout` |`string` - Explicit operation timeout ->>>>>>> a064f0f3... Improve child performances (#1314) |`track_scores` or `trackScores` |`boolean` - Whether to calculate and return scores even if they are not used for sorting -<<<<<<< HEAD -|`size` -|`'' \| 'k' \| 'm' \| 'g' \| 't' \| 'p'` - The multiplier in which to display values + - -WARNING: This parameter has been deprecated. -======= |`track_total_hits` or `trackTotalHits` -|`boolean\|long` - Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number. ->>>>>>> a064f0f3... Improve child performances (#1314) +|`boolean` - Indicate if the number of documents that match the query should be tracked |`allow_partial_search_results` or `allowPartialSearchResults` |`boolean` - Indicate if an error should be returned if there is a partial search failure or timeout + @@ -1651,26 +948,6 @@ WARNING: This parameter has been deprecated. [source,ts] ---- -<<<<<<< HEAD -client.count({ - index: string | string[], - type: string | string[], - ignore_unavailable: boolean, - ignore_throttled: boolean, - allow_no_indices: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - min_score: number, - preference: string, - routing: string | string[], - q: string, - analyzer: string, - analyze_wildcard: boolean, - default_operator: 'AND' | 'OR', - df: string, - lenient: boolean, - terminate_after: number, - body: object -======= client.cat.mlTrainedModels({ model_id: string, allow_no_match: boolean, @@ -1683,7 +960,6 @@ client.cat.mlTrainedModels({ s: string | string[], time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', v: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cat-trained-model.html[Documentation] + @@ -1692,17 +968,9 @@ link:{ref}/cat-trained-model.html[Documentation] + |`model_id` or `modelId` |`string` - The ID of the trained models stats to fetch -<<<<<<< HEAD -|`type` -|`string \| string[]` - A comma-separated list of types to restrict the results - -|`ignore_unavailable` or `ignoreUnavailable` -|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) -======= |`allow_no_match` or `allowNoMatch` |`boolean` - Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) + _Default:_ `true` ->>>>>>> a064f0f3... Improve child performances (#1314) |`from` |`number` - skips a number of trained models @@ -1782,6 +1050,7 @@ client.cat.nodes({ bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', format: string, full_id: boolean, + local: boolean, master_timeout: string, h: string | string[], help: boolean, @@ -1802,6 +1071,11 @@ link:{ref}/cat-nodes.html[Documentation] + |`full_id` or `fullId` |`boolean` - Return the full node ID instead of the shortened version (default: false) +|`local` +|`boolean` - Calculate the selected nodes using the local cluster state rather than the state from master node (default: false) + + +WARNING: This parameter has been deprecated. + |`master_timeout` or `masterTimeout` |`string` - Explicit operation timeout for connection to master node @@ -1910,20 +1184,6 @@ link:{ref}/cat-plugins.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.delete({ - id: string, - index: string, - type: string, - wait_for_active_shards: string, - refresh: 'true' | 'false' | 'wait_for', - routing: string, - timeout: string, - if_seq_no: number, - if_primary_term: number, - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force' -======= client.cat.recovery({ index: string | string[], format: string, @@ -1935,7 +1195,6 @@ client.cat.recovery({ s: string | string[], time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', v: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cat-recovery.html[Documentation] + @@ -1968,13 +1227,8 @@ link:{ref}/cat-recovery.html[Documentation] + |`time` |`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= |`v` |`boolean` - Verbose mode. Display column headers ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -1982,45 +1236,6 @@ link:{ref}/cat-recovery.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.deleteByQuery({ - index: string | string[], - type: string | string[], - analyzer: string, - analyze_wildcard: boolean, - default_operator: 'AND' | 'OR', - df: string, - from: number, - ignore_unavailable: boolean, - allow_no_indices: boolean, - conflicts: 'abort' | 'proceed', - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - lenient: boolean, - preference: string, - q: string, - routing: string | string[], - scroll: string, - search_type: 'query_then_fetch' | 'dfs_query_then_fetch', - search_timeout: string, - size: number, - max_docs: number, - sort: string | string[], - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - terminate_after: number, - stats: string | string[], - version: boolean, - request_cache: boolean, - refresh: boolean, - timeout: string, - wait_for_active_shards: string, - scroll_size: number, - wait_for_completion: boolean, - requests_per_second: number, - slices: number|string, - body: object -======= client.cat.repositories({ format: string, local: boolean, @@ -2029,41 +1244,13 @@ client.cat.repositories({ help: boolean, s: string | string[], v: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cat-repositories.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`index` -|`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - -|`type` -|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types - -|`analyzer` -|`string` - The analyzer to use for the query string - -|`analyze_wildcard` or `analyzeWildcard` -|`boolean` - Specify whether wildcard and prefix queries should be analyzed (default: false) - -|`default_operator` or `defaultOperator` -|`'AND' \| 'OR'` - The default operator for query string query (AND or OR) + -_Default:_ `OR` - -|`df` -|`string` - The field to use as default where no field prefix is given in the query string - -|`from` -|`number` - Starting offset (default: 0) - -|`ignore_unavailable` or `ignoreUnavailable` -|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) -======= |`format` |`string` - a short version of the Accept header, e.g. json, yaml ->>>>>>> a064f0f3... Improve child performances (#1314) |`local` |`boolean` - Return local information, do not retrieve the state from master node @@ -2108,16 +1295,8 @@ link:{ref}/cat-segments.html[Documentation] + |`format` |`string` - a short version of the Accept header, e.g. json, yaml -<<<<<<< HEAD -|`size` -|`number` - Deprecated, please use `max_docs` instead - -|`max_docs` or `maxDocs` -|`number` - Maximum number of documents to process (default: all documents) -======= |`bytes` |`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values ->>>>>>> a064f0f3... Improve child performances (#1314) |`h` |`string \| string[]` - Comma-separated list of column names to display @@ -2159,13 +1338,8 @@ link:{ref}/cat-shards.html[Documentation] + |`format` |`string` - a short version of the Accept header, e.g. json, yaml -<<<<<<< HEAD -|`refresh` -|`boolean` - Should the effected indexes be refreshed? -======= |`bytes` |`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values ->>>>>>> a064f0f3... Improve child performances (#1314) |`local` |`boolean` - Return local information, do not retrieve the state from master node (default: false) @@ -2294,22 +1468,6 @@ link:{ref}/tasks.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.exists({ - id: string, - index: string, - type: string, - stored_fields: string | string[], - preference: string, - realtime: boolean, - refresh: boolean, - routing: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force' -======= client.cat.templates({ name: string, format: string, @@ -2319,36 +1477,13 @@ client.cat.templates({ help: boolean, s: string | string[], v: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cat-templates.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`id` -|`string` - The document ID - -|`index` -|`string` - The name of the index - -|`type` -|`string` - The type of the document (use `_all` to fetch the first document matching the ID across all types) + - -WARNING: This parameter has been deprecated. - -|`stored_fields` or `storedFields` -|`string \| string[]` - A comma-separated list of stored fields to return in the response - -|`preference` -|`string` - Specify the node or shard the operation should be performed on (default: random) - -|`realtime` -|`boolean` - Specify whether to perform the operation in realtime or search mode -======= |`name` |`string` - A pattern that returned template names must match ->>>>>>> a064f0f3... Improve child performances (#1314) |`format` |`string` - a short version of the Accept header, e.g. json, yaml @@ -2368,13 +1503,8 @@ WARNING: This parameter has been deprecated. |`s` |`string \| string[]` - Comma-separated list of column names or column aliases to sort by -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= |`v` |`boolean` - Verbose mode. Display column headers ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -2382,32 +1512,16 @@ WARNING: This parameter has been deprecated. [source,ts] ---- -<<<<<<< HEAD -client.existsSource({ - id: string, - index: string, - type: string, - preference: string, - realtime: boolean, - refresh: boolean, - routing: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force' -======= client.cat.threadPool({ thread_pool_patterns: string | string[], format: string, - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', + size: '' | 'k' | 'm' | 'g' | 't' | 'p', local: boolean, master_timeout: string, h: string | string[], help: boolean, s: string | string[], v: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cat-thread-pool.html[Documentation] + @@ -2419,8 +1533,10 @@ link:{ref}/cat-thread-pool.html[Documentation] + |`format` |`string` - a short version of the Accept header, e.g. json, yaml -|`time` -|`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values +|`size` +|`'' \| 'k' \| 'm' \| 'g' \| 't' \| 'p'` - The multiplier in which to display values + + +WARNING: This parameter has been deprecated. |`local` |`boolean` - Return local information, do not retrieve the state from master node (default: false) @@ -2437,13 +1553,8 @@ link:{ref}/cat-thread-pool.html[Documentation] + |`s` |`string \| string[]` - Comma-separated list of column names or column aliases to sort by -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= |`v` |`boolean` - Verbose mode. Display column headers ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -2451,25 +1562,6 @@ link:{ref}/cat-thread-pool.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.explain({ - id: string, - index: string, - type: string, - analyze_wildcard: boolean, - analyzer: string, - default_operator: 'AND' | 'OR', - df: string, - stored_fields: string | string[], - lenient: boolean, - preference: string, - q: string, - routing: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - body: object -======= client.cat.transforms({ transform_id: string, from: number, @@ -2481,30 +1573,13 @@ client.cat.transforms({ s: string | string[], time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', v: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cat-transforms.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`id` -|`string` - The document ID - -|`index` -|`string` - The name of the index - -|`type` -|`string` - The type of the document + - -WARNING: This parameter has been deprecated. - -|`analyze_wildcard` or `analyzeWildcard` -|`boolean` - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) -======= |`transform_id` or `transformId` |`string` - The id of the transform for which to get stats. '_all' or '*' implies all transforms ->>>>>>> a064f0f3... Improve child performances (#1314) |`from` |`number` - skips a number of transform configs, defaults to 0 @@ -2596,25 +1671,8 @@ link:{ref}/ccr-get-follow-info.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.get({ - id: string, - index: string, - type: string, - stored_fields: string | string[], - preference: string, - realtime: boolean, - refresh: boolean, - routing: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force' -======= client.ccr.followStats({ index: string | string[] ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/ccr-get-follow-stats.html[Documentation] + @@ -2623,17 +1681,7 @@ link:{ref}/ccr-get-follow-stats.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index patterns; use `_all` to perform the operation on all indices -<<<<<<< HEAD -|`type` -|`string` - The type of the document (use `_all` to fetch the first document matching the ID across all types) + - -WARNING: This parameter has been deprecated. - -|`stored_fields` or `storedFields` -|`string \| string[]` - A comma-separated list of stored fields to return in the response -======= |=== ->>>>>>> a064f0f3... Improve child performances (#1314) === ccr.forgetFollower @@ -2673,10 +1721,6 @@ link:{ref}/ccr-get-auto-follow-pattern.html[Documentation] + === ccr.pauseAutoFollowPattern -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= [source,ts] ---- client.ccr.pauseAutoFollowPattern({ @@ -2688,7 +1732,6 @@ link:{ref}/ccr-pause-auto-follow-pattern.html[Documentation] + |=== |`name` |`string` - The name of the auto follow pattern that should pause discovering new indices to follow. ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -2750,42 +1793,14 @@ link:{ref}/ccr-resume-auto-follow-pattern.html[Documentation] + ---- client.ccr.resumeFollow({ index: string, -<<<<<<< HEAD - type: string, - preference: string, - realtime: boolean, - refresh: boolean, - routing: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force' -======= body: object ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/ccr-post-resume-follow.html[Documentation] + [cols=2*] |=== |`index` -<<<<<<< HEAD -|`string` - The name of the index - -|`type` -|`string` - The type of the document; deprecated and optional starting with 7.0 + - -WARNING: This parameter has been deprecated. - -|`preference` -|`string` - Specify the node or shard the operation should be performed on (default: random) - -|`realtime` -|`boolean` - Specify whether to perform the operation in realtime or search mode -======= |`string` - The name of the follow index to resume following. ->>>>>>> a064f0f3... Improve child performances (#1314) |`body` |`object` - The name of the leader index and other optional ccr related parameters @@ -2803,10 +1818,6 @@ link:{ref}/ccr-get-stats.html[Documentation] + === ccr.unfollow -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= [source,ts] ---- client.ccr.unfollow({ @@ -2818,7 +1829,6 @@ link:{ref}/ccr-post-unfollow.html[Documentation] + |=== |`index` |`string` - The name of the follower index that should be turned into a regular index. ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -2826,53 +1836,16 @@ link:{ref}/ccr-post-unfollow.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.index({ - id: string, - index: string, - type: string, - wait_for_active_shards: string, - op_type: 'index' | 'create', - refresh: 'true' | 'false' | 'wait_for', - routing: string, - timeout: string, - version: number, - version_type: 'internal' | 'external' | 'external_gte', - if_seq_no: number, - if_primary_term: number, - pipeline: string, - require_alias: boolean, -======= client.clearScroll({ scroll_id: string | string[], ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- link:{ref}/clear-scroll-api.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`id` -|`string` - Document ID - -|`index` -|`string` - The name of the index - -|`type` -|`string` - The type of the document + - -WARNING: This parameter has been deprecated. - -|`wait_for_active_shards` or `waitForActiveShards` -|`string` - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - -|`op_type` or `opType` -|`'index' \| 'create'` - Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID -======= |`scroll_id` or `scrollId` |`string \| string[]` - A comma-separated list of scroll IDs to clear + ->>>>>>> a064f0f3... Improve child performances (#1314) WARNING: This parameter has been deprecated. @@ -2889,7 +1862,7 @@ client.closePointInTime({ body: object }) ---- -link:{ref}/point-in-time-api.html[Documentation] + +link:{ref}/point-in-time.html[Documentation] + [cols=2*] |=== |`body` @@ -3104,40 +2077,16 @@ _Default:_ `cluster` [source,ts] ---- -<<<<<<< HEAD -client.indices.create({ - index: string, - include_type_name: boolean, - wait_for_active_shards: string, - timeout: string, - master_timeout: string, - body: object -======= client.cluster.pendingTasks({ local: boolean, master_timeout: string ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cluster-pending.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`index` -|`string` - The name of the index - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be expected in the body of the mappings. - -|`wait_for_active_shards` or `waitForActiveShards` -|`string` - Set the number of active shards to wait for before the operation returns. - -|`timeout` -|`string` - Explicit operation timeout -======= |`local` |`boolean` - Return local information, do not retrieve the state from master node (default: false) ->>>>>>> a064f0f3... Improve child performances (#1314) |`master_timeout` or `masterTimeout` |`string` - Specify timeout for connection to master @@ -3361,6 +2310,7 @@ link:{ref}/cluster-stats.html[Documentation] + ---- client.count({ index: string | string[], + type: string | string[], ignore_unavailable: boolean, ignore_throttled: boolean, allow_no_indices: boolean, @@ -3384,6 +2334,9 @@ link:{ref}/search-count.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of indices to restrict the results +|`type` +|`string \| string[]` - A comma-separated list of types to restrict the results + |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3433,40 +2386,7 @@ _Default:_ `OR` |=== -<<<<<<< HEAD -=== indices.flushSynced - -[source,ts] ----- -client.indices.flushSynced({ - index: string | string[], - ignore_unavailable: boolean, - allow_no_indices: boolean, - expand_wildcards: 'open' | 'closed' | 'none' | 'all' -}) ----- -link:{ref}/indices-synced-flush-api.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string for all indices - -|`ignore_unavailable` or `ignoreUnavailable` -|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) - -|`allow_no_indices` or `allowNoIndices` -|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - -|`expand_wildcards` or `expandWildcards` -|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + -_Default:_ `open` - -|=== - -=== indices.forcemerge -======= === create ->>>>>>> a064f0f3... Improve child performances (#1314) [source,ts] ---- @@ -3528,51 +2448,18 @@ WARNING: This parameter has been deprecated. [source,ts] ---- -<<<<<<< HEAD -client.indices.get({ - index: string | string[], - include_type_name: boolean, - local: boolean, - ignore_unavailable: boolean, - allow_no_indices: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - flat_settings: boolean, - include_defaults: boolean, -======= client.danglingIndices.deleteDanglingIndex({ index_uuid: string, accept_data_loss: boolean, timeout: string, ->>>>>>> a064f0f3... Improve child performances (#1314) master_timeout: string }) ---- link:{ref}/modules-gateway-dangling-indices.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`index` -|`string \| string[]` - A comma-separated list of index names - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether to add the type name to the response (default: false) - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`ignore_unavailable` or `ignoreUnavailable` -|`boolean` - Ignore unavailable indexes (default: false) - -|`allow_no_indices` or `allowNoIndices` -|`boolean` - Ignore if a wildcard expression resolves to no concrete indices (default: false) - -|`expand_wildcards` or `expandWildcards` -|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether wildcard expressions should get expanded to open or closed indices (default: open) + -_Default:_ `open` -======= |`index_uuid` or `indexUuid` |`string` - The UUID of the dangling index ->>>>>>> a064f0f3... Improve child performances (#1314) |`accept_data_loss` or `acceptDataLoss` |`boolean` - Must be set to true in order to delete the dangling index @@ -3626,18 +2513,6 @@ link:{ref}/modules-gateway-dangling-indices.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.indices.getFieldMapping({ - fields: string | string[], - index: string | string[], - type: string | string[], - include_type_name: boolean, - include_defaults: boolean, - ignore_unavailable: boolean, - allow_no_indices: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - local: boolean -======= client.delete({ id: string, index: string, @@ -3649,8 +2524,7 @@ client.delete({ if_seq_no: number, if_primary_term: number, version: number, - version_type: 'internal' | 'external' | 'external_gte' ->>>>>>> a064f0f3... Improve child performances (#1314) + version_type: 'internal' | 'external' | 'external_gte' | 'force' }) ---- link:{ref}/docs-delete.html[Documentation] + @@ -3663,19 +2537,7 @@ link:{ref}/docs-delete.html[Documentation] + |`string` - The name of the index |`type` -<<<<<<< HEAD -|`string \| string[]` - A comma-separated list of document types + - -WARNING: This parameter has been deprecated. - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be returned in the body of the mappings. - -|`include_defaults` or `includeDefaults` -|`boolean` - Whether the default mapping values should be returned as well -======= |`string` - The type of the document + ->>>>>>> a064f0f3... Improve child performances (#1314) WARNING: This parameter has been deprecated. @@ -3701,7 +2563,7 @@ WARNING: This parameter has been deprecated. |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |=== @@ -3711,6 +2573,7 @@ WARNING: This parameter has been deprecated. ---- client.deleteByQuery({ index: string | string[], + type: string | string[], analyzer: string, analyze_wildcard: boolean, default_operator: 'AND' | 'OR', @@ -3727,6 +2590,7 @@ client.deleteByQuery({ scroll: string, search_type: 'query_then_fetch' | 'dfs_query_then_fetch', search_timeout: string, + size: number, max_docs: number, sort: string | string[], _source: string | string[], @@ -3752,6 +2616,9 @@ link:{ref}/docs-delete-by-query.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +|`type` +|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + |`analyzer` |`string` - The analyzer to use for the query string @@ -3765,37 +2632,8 @@ _Default:_ `OR` |`df` |`string` - The field to use as default where no field prefix is given in the query string -<<<<<<< HEAD -[source,ts] ----- -client.indices.getMapping({ - index: string | string[], - type: string | string[], - include_type_name: boolean, - ignore_unavailable: boolean, - allow_no_indices: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - master_timeout: string, - local: boolean -}) ----- -link:{ref}/indices-get-mapping.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string \| string[]` - A comma-separated list of index names -======= |`from` |`number` - Starting offset (default: 0) ->>>>>>> a064f0f3... Improve child performances (#1314) - -|`type` -|`string \| string[]` - A comma-separated list of document types + - -WARNING: This parameter has been deprecated. - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether to add the type name to the response (default: false) |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3832,6 +2670,9 @@ _Default:_ `open` |`search_timeout` or `searchTimeout` |`string` - Explicit timeout for each search request. Defaults to no timeout. +|`size` +|`number` - Deprecated, please use `max_docs` instead + |`max_docs` or `maxDocs` |`number` - Maximum number of documents to process (default: all documents) @@ -3859,36 +2700,12 @@ _Default:_ `open` |`request_cache` or `requestCache` |`boolean` - Specify if request cache should be used for this request or not, defaults to index level setting -<<<<<<< HEAD -[source,ts] ----- -client.indices.getTemplate({ - name: string | string[], - include_type_name: boolean, - flat_settings: boolean, - master_timeout: string, - local: boolean -}) ----- -link:{ref}/indices-templates.html[Documentation] + -[cols=2*] -|=== -|`name` -|`string \| string[]` - The comma separated names of the index templates - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be returned in the body of the mappings. - -|`flat_settings` or `flatSettings` -|`boolean` - Return settings in flat format (default: false) -======= |`refresh` -|`boolean` - Should the affected indexes be refreshed? +|`boolean` - Should the effected indexes be refreshed? |`timeout` |`string` - Time each individual bulk request should wait for shards that are unavailable. + _Default:_ `1m` ->>>>>>> a064f0f3... Improve child performances (#1314) |`wait_for_active_shards` or `waitForActiveShards` |`string` - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) @@ -4014,48 +2831,16 @@ link:{ref}/get-enrich-policy-api.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.indices.putMapping({ - index: string | string[], - type: string, - include_type_name: boolean, - timeout: string, - master_timeout: string, - ignore_unavailable: boolean, - allow_no_indices: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - write_index_only: boolean, -======= client.enrich.putPolicy({ name: string, ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- link:{ref}/put-enrich-policy-api.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`index` -|`string \| string[]` - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - -|`type` -|`string` - The name of the document type + - -WARNING: This parameter has been deprecated. - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be expected in the body of the mappings. - -|`timeout` -|`string` - Explicit operation timeout - -|`master_timeout` or `masterTimeout` -|`string` - Specify timeout for connection to master -======= |`name` |`string` - The name of the enrich policy ->>>>>>> a064f0f3... Improve child performances (#1314) |`body` |`object` - The enrich policy to register @@ -4116,20 +2901,11 @@ _Default:_ `5d` *Stability:* beta [source,ts] ---- -<<<<<<< HEAD -client.indices.putTemplate({ - name: string, - include_type_name: boolean, - order: number, - create: boolean, - master_timeout: string, -======= client.eql.search({ index: string, wait_for_completion_timeout: string, keep_on_completion: boolean, keep_alive: string, ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- @@ -4139,16 +2915,8 @@ link:{ref}/eql-search-api.html[Documentation] + |`index` |`string` - The name of the index to scope the operation -<<<<<<< HEAD -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be returned in the body of the mappings. - -|`order` -|`number` - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) -======= |`wait_for_completion_timeout` or `waitForCompletionTimeout` |`string` - Specify the time that the request should block waiting for the final response ->>>>>>> a064f0f3... Improve child performances (#1314) |`keep_on_completion` or `keepOnCompletion` |`boolean` - Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false) @@ -4169,6 +2937,7 @@ _Default:_ `5d` client.exists({ id: string, index: string, + type: string, stored_fields: string | string[], preference: string, realtime: boolean, @@ -4178,7 +2947,7 @@ client.exists({ _source_excludes: string | string[], _source_includes: string | string[], version: number, - version_type: 'internal' | 'external' | 'external_gte' + version_type: 'internal' | 'external' | 'external_gte' | 'force' }) ---- link:{ref}/docs-get.html[Documentation] + @@ -4191,6 +2960,11 @@ link:{ref}/docs-get.html[Documentation] + |`index` |`string` - The name of the index +|`type` +|`string` - The type of the document (use `_all` to fetch the first document matching the ID across all types) + + +WARNING: This parameter has been deprecated. + |`stored_fields` or `storedFields` |`string \| string[]` - A comma-separated list of stored fields to return in the response @@ -4219,7 +2993,7 @@ link:{ref}/docs-get.html[Documentation] + |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |=== @@ -4239,7 +3013,7 @@ client.existsSource({ _source_excludes: string | string[], _source_includes: string | string[], version: number, - version_type: 'internal' | 'external' | 'external_gte' + version_type: 'internal' | 'external' | 'external_gte' | 'force' }) ---- link:{ref}/docs-get.html[Documentation] + @@ -4281,7 +3055,7 @@ WARNING: This parameter has been deprecated. |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |=== @@ -4289,19 +3063,10 @@ WARNING: This parameter has been deprecated. [source,ts] ---- -<<<<<<< HEAD -client.indices.rollover({ - alias: string, - new_index: string, - include_type_name: boolean, - timeout: string, - dry_run: boolean, - master_timeout: string, - wait_for_active_shards: string, -======= client.explain({ id: string, index: string, + type: string, analyze_wildcard: boolean, analyzer: string, default_operator: 'AND' | 'OR', @@ -4314,7 +3079,6 @@ client.explain({ _source: string | string[], _source_excludes: string | string[], _source_includes: string | string[], ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- @@ -4327,16 +3091,13 @@ link:{ref}/search-explain.html[Documentation] + |`index` |`string` - The name of the index -<<<<<<< HEAD -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be included in the body of the mappings. +|`type` +|`string` - The type of the document + + +WARNING: This parameter has been deprecated. -|`timeout` -|`string` - Explicit operation timeout -======= |`analyze_wildcard` or `analyzeWildcard` |`boolean` - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) ->>>>>>> a064f0f3... Improve child performances (#1314) |`analyzer` |`string` - The analyzer for the query string query @@ -4425,14 +3186,7 @@ _Default:_ `open` client.get({ id: string, index: string, -<<<<<<< HEAD - target: string, - copy_settings: boolean, - timeout: string, - master_timeout: string, - wait_for_active_shards: string, - body: object -======= + type: string, stored_fields: string | string[], preference: string, realtime: boolean, @@ -4442,8 +3196,7 @@ client.get({ _source_excludes: string | string[], _source_includes: string | string[], version: number, - version_type: 'internal' | 'external' | 'external_gte' ->>>>>>> a064f0f3... Improve child performances (#1314) + version_type: 'internal' | 'external' | 'external_gte' | 'force' }) ---- link:{ref}/docs-get.html[Documentation] + @@ -4453,16 +3206,13 @@ link:{ref}/docs-get.html[Documentation] + |`id` |`string` - The document ID -<<<<<<< HEAD -|`copy_settings` or `copySettings` -|`boolean` - whether or not to copy settings from the source index (defaults to false) - -|`timeout` -|`string` - Explicit operation timeout -======= |`index` |`string` - The name of the index ->>>>>>> a064f0f3... Improve child performances (#1314) + +|`type` +|`string` - The type of the document (use `_all` to fetch the first document matching the ID across all types) + + +WARNING: This parameter has been deprecated. |`stored_fields` or `storedFields` |`string \| string[]` - A comma-separated list of stored fields to return in the response @@ -4492,7 +3242,7 @@ link:{ref}/docs-get.html[Documentation] + |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |=== @@ -4520,39 +3270,9 @@ link:{ref}/modules-scripting.html[Documentation] + *Stability:* experimental [source,ts] ---- -<<<<<<< HEAD -client.indices.split({ - index: string, - target: string, - copy_settings: boolean, - timeout: string, - master_timeout: string, - wait_for_active_shards: string, - body: object -}) ----- -link:{ref}/indices-split-index.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string` - The name of the source index to split - -|`target` -|`string` - The name of the target index to split into - -|`copy_settings` or `copySettings` -|`boolean` - whether or not to copy settings from the source index (defaults to false) - -|`timeout` -|`string` - Explicit operation timeout - -|`master_timeout` or `masterTimeout` -|`string` - Specify timeout for connection to master -======= client.getScriptContext() ---- link:https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html[Documentation] + ->>>>>>> a064f0f3... Improve child performances (#1314) === getScriptLanguages @@ -4571,6 +3291,7 @@ link:{ref}/modules-scripting.html[Documentation] + client.getSource({ id: string, index: string, + type: string, preference: string, realtime: boolean, refresh: boolean, @@ -4579,7 +3300,7 @@ client.getSource({ _source_excludes: string | string[], _source_includes: string | string[], version: number, - version_type: 'internal' | 'external' | 'external_gte' + version_type: 'internal' | 'external' | 'external_gte' | 'force' }) ---- link:{ref}/docs-get.html[Documentation] + @@ -4591,6 +3312,11 @@ link:{ref}/docs-get.html[Documentation] + |`index` |`string` - The name of the index +|`type` +|`string` - The type of the document; deprecated and optional starting with 7.0 + + +WARNING: This parameter has been deprecated. + |`preference` |`string` - Specify the node or shard the operation should be performed on (default: random) @@ -4616,7 +3342,7 @@ link:{ref}/docs-get.html[Documentation] + |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |=== @@ -4626,6 +3352,7 @@ link:{ref}/docs-get.html[Documentation] + ---- client.graph.explore({ index: string | string[], + type: string | string[], routing: string, timeout: string, body: object @@ -4637,6 +3364,11 @@ link:{ref}/graph-explore-api.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +|`type` +|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + + +WARNING: This parameter has been deprecated. + |`routing` |`string` - Specific routing value @@ -4810,6 +3542,7 @@ link:{ref}/ilm-stop.html[Documentation] + client.index({ id: string, index: string, + type: string, wait_for_active_shards: string, op_type: 'index' | 'create', refresh: 'true' | 'false' | 'wait_for', @@ -4833,6 +3566,11 @@ link:{ref}/docs-index_.html[Documentation] + |`index` |`string` - The name of the index +|`type` +|`string` - The type of the document + + +WARNING: This parameter has been deprecated. + |`wait_for_active_shards` or `waitForActiveShards` |`string` - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) @@ -4875,20 +3613,6 @@ link:{ref}/docs-index_.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.mget({ - index: string, - type: string, - stored_fields: string | string[], - preference: string, - realtime: boolean, - refresh: boolean, - routing: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - body: object -======= client.indices.addBlock({ index: string | string[], block: string, @@ -4897,7 +3621,6 @@ client.indices.addBlock({ ignore_unavailable: boolean, allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all' ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/index-modules-blocks.html[Documentation] + @@ -4906,18 +3629,8 @@ link:{ref}/index-modules-blocks.html[Documentation] + |`index` |`string \| string[]` - A comma separated list of indices to add a block to -<<<<<<< HEAD -|`type` -|`string` - The type of the document + - -WARNING: This parameter has been deprecated. - -|`stored_fields` or `storedFields` -|`string \| string[]` - A comma-separated list of stored fields to return in the response -======= |`block` |`string` - The block to add (one of read, write, read_only or metadata) ->>>>>>> a064f0f3... Improve child performances (#1314) |`timeout` |`string` - Explicit operation timeout @@ -4953,11 +3666,7 @@ link:{ref}/indices-analyze.html[Documentation] + |`string` - The name of the index to scope the operation |`body` -<<<<<<< HEAD -|`object` - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL. -======= |`object` - Define analyzer/tokenizer parameters and the text on which the analysis should be performed ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -4967,17 +3676,6 @@ link:{ref}/indices-analyze.html[Documentation] + ---- client.indices.clearCache({ index: string | string[], -<<<<<<< HEAD - type: string | string[], - search_type: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch', - max_concurrent_searches: number, - typed_keys: boolean, - pre_filter_shard_size: number, - max_concurrent_shard_requests: number, - rest_total_hits_as_int: boolean, - ccs_minimize_roundtrips: boolean, - body: object -======= fielddata: boolean, fields: string | string[], query: boolean, @@ -4985,24 +3683,13 @@ client.indices.clearCache({ allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', request: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/indices-clearcache.html[Documentation] + [cols=2*] |=== |`index` -<<<<<<< HEAD -|`string \| string[]` - A comma-separated list of index names to use as default - -|`type` -|`string \| string[]` - A comma-separated list of document types to use as default - -|`search_type` or `searchType` -|`'query_then_fetch' \| 'query_and_fetch' \| 'dfs_query_then_fetch' \| 'dfs_query_and_fetch'` - Search operation type -======= |`string \| string[]` - A comma-separated list of index name to limit the operation ->>>>>>> a064f0f3... Improve child performances (#1314) |`fielddata` |`boolean` - Clear field data @@ -5032,23 +3719,12 @@ _Default:_ `open` [source,ts] ---- -<<<<<<< HEAD -client.msearchTemplate({ - index: string | string[], - type: string | string[], - search_type: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch', - typed_keys: boolean, - max_concurrent_searches: number, - rest_total_hits_as_int: boolean, - ccs_minimize_roundtrips: boolean, -======= client.indices.clone({ index: string, target: string, timeout: string, master_timeout: string, wait_for_active_shards: string, ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- @@ -5056,17 +3732,7 @@ link:{ref}/indices-clone-index.html[Documentation] + [cols=2*] |=== |`index` -<<<<<<< HEAD -|`string \| string[]` - A comma-separated list of index names to use as default - -|`type` -|`string \| string[]` - A comma-separated list of document types to use as default - -|`search_type` or `searchType` -|`'query_then_fetch' \| 'query_and_fetch' \| 'dfs_query_then_fetch' \| 'dfs_query_and_fetch'` - Search operation type -======= |`string` - The name of the source index to clone ->>>>>>> a064f0f3... Improve child performances (#1314) |`target` |`string` - The name of the target index to clone into @@ -5089,24 +3755,6 @@ link:{ref}/indices-clone-index.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.mtermvectors({ - index: string, - type: string, - ids: string | string[], - term_statistics: boolean, - field_statistics: boolean, - fields: string | string[], - offsets: boolean, - positions: boolean, - payloads: boolean, - preference: string, - routing: string, - realtime: boolean, - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force', - body: object -======= client.indices.close({ index: string | string[], timeout: string, @@ -5115,46 +3763,13 @@ client.indices.close({ allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', wait_for_active_shards: string ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/indices-open-close.html[Documentation] + [cols=2*] |=== |`index` -<<<<<<< HEAD -|`string` - The index in which the document resides. - -|`type` -|`string` - The type of the document. - -|`ids` -|`string \| string[]` - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - -|`term_statistics` or `termStatistics` -|`boolean` - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - -|`field_statistics` or `fieldStatistics` -|`boolean` - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + -_Default:_ `true` - -|`fields` -|`string \| string[]` - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - -|`offsets` -|`boolean` - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + -_Default:_ `true` - -|`positions` -|`boolean` - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + -_Default:_ `true` - -|`payloads` -|`boolean` - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + -_Default:_ `true` -======= |`string \| string[]` - A comma separated list of indices to close ->>>>>>> a064f0f3... Improve child performances (#1314) |`timeout` |`string` - Explicit operation timeout @@ -5168,14 +3783,9 @@ _Default:_ `true` |`allow_no_indices` or `allowNoIndices` |`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= |`expand_wildcards` or `expandWildcards` |`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + _Default:_ `open` ->>>>>>> a064f0f3... Improve child performances (#1314) |`wait_for_active_shards` or `waitForActiveShards` |`string` - Sets the number of active shards to wait for before the operation returns. @@ -5188,6 +3798,7 @@ _Default:_ `open` ---- client.indices.create({ index: string, + include_type_name: boolean, wait_for_active_shards: string, timeout: string, master_timeout: string, @@ -5200,6 +3811,9 @@ link:{ref}/indices-create-index.html[Documentation] + |`index` |`string` - The name of the index +|`include_type_name` or `includeTypeName` +|`boolean` - Whether a type should be expected in the body of the mappings. + |`wait_for_active_shards` or `waitForActiveShards` |`string` - Set the number of active shards to wait for before the operation returns. @@ -5552,58 +4166,11 @@ _Default:_ `open` ---- client.indices.flush({ index: string | string[], -<<<<<<< HEAD - type: string | string[], - analyzer: string, - analyze_wildcard: boolean, - ccs_minimize_roundtrips: boolean, - default_operator: 'AND' | 'OR', - df: string, - explain: boolean, - stored_fields: string | string[], - docvalue_fields: string | string[], - from: number, -======= force: boolean, wait_if_ongoing: boolean, ->>>>>>> a064f0f3... Improve child performances (#1314) ignore_unavailable: boolean, allow_no_indices: boolean, -<<<<<<< HEAD - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - lenient: boolean, - preference: string, - q: string, - routing: string | string[], - scroll: string, - search_type: 'query_then_fetch' | 'dfs_query_then_fetch', - size: number, - sort: string | string[], - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - terminate_after: number, - stats: string | string[], - suggest_field: string, - suggest_mode: 'missing' | 'popular' | 'always', - suggest_size: number, - suggest_text: string, - timeout: string, - track_scores: boolean, - track_total_hits: boolean, - allow_partial_search_results: boolean, - typed_keys: boolean, - version: boolean, - seq_no_primary_term: boolean, - request_cache: boolean, - batched_reduce_size: number, - max_concurrent_shard_requests: number, - pre_filter_shard_size: number, - rest_total_hits_as_int: boolean, - body: object -======= expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all' ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/indices-flush.html[Documentation] + @@ -5612,16 +4179,8 @@ link:{ref}/indices-flush.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names; use `_all` or empty string for all indices -<<<<<<< HEAD -|`type` -|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types - -|`analyzer` -|`string` - The analyzer to use for the query string -======= |`force` |`boolean` - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) ->>>>>>> a064f0f3... Improve child performances (#1314) |`wait_if_ongoing` or `waitIfOngoing` |`boolean` - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. @@ -5638,6 +4197,35 @@ _Default:_ `open` |=== +=== indices.flushSynced + +[source,ts] +---- +client.indices.flushSynced({ + index: string | string[], + ignore_unavailable: boolean, + allow_no_indices: boolean, + expand_wildcards: 'open' | 'closed' | 'none' | 'all' +}) +---- +link:{ref}/indices-synced-flush-api.html[Documentation] + +[cols=2*] +|=== +|`index` +|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string for all indices + +|`ignore_unavailable` or `ignoreUnavailable` +|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) + +|`allow_no_indices` or `allowNoIndices` +|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + +|`expand_wildcards` or `expandWildcards` +|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + +_Default:_ `open` + +|=== + === indices.forcemerge [source,ts] @@ -5726,6 +4314,7 @@ _Default:_ `closed` ---- client.indices.get({ index: string | string[], + include_type_name: boolean, local: boolean, ignore_unavailable: boolean, allow_no_indices: boolean, @@ -5741,6 +4330,9 @@ link:{ref}/indices-get-index.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names +|`include_type_name` or `includeTypeName` +|`boolean` - Whether to add the type name to the response (default: false) + |`local` |`boolean` - Return local information, do not retrieve the state from master node (default: false) @@ -5763,12 +4355,7 @@ _Default:_ `open` |`master_timeout` or `masterTimeout` |`string` - Specify timeout for connection to master -<<<<<<< HEAD -|`track_total_hits` or `trackTotalHits` -|`boolean` - Indicate if the number of documents that match the query should be tracked -======= |=== ->>>>>>> a064f0f3... Improve child performances (#1314) === indices.getAlias @@ -5830,6 +4417,8 @@ link:{ref}/data-streams.html[Documentation] + client.indices.getFieldMapping({ fields: string | string[], index: string | string[], + type: string | string[], + include_type_name: boolean, include_defaults: boolean, ignore_unavailable: boolean, allow_no_indices: boolean, @@ -5846,6 +4435,14 @@ link:{ref}/indices-get-field-mapping.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names +|`type` +|`string \| string[]` - A comma-separated list of document types + + +WARNING: This parameter has been deprecated. + +|`include_type_name` or `includeTypeName` +|`boolean` - Whether a type should be returned in the body of the mappings. + |`include_defaults` or `includeDefaults` |`boolean` - Whether the default mapping values should be returned as well @@ -5899,6 +4496,7 @@ link:{ref}/indices-templates.html[Documentation] + client.indices.getMapping({ index: string | string[], type: string | string[], + include_type_name: boolean, ignore_unavailable: boolean, allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', @@ -5913,7 +4511,12 @@ link:{ref}/indices-get-mapping.html[Documentation] + |`string \| string[]` - A comma-separated list of index names |`type` -|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types +|`string \| string[]` - A comma-separated list of document types + + +WARNING: This parameter has been deprecated. + +|`include_type_name` or `includeTypeName` +|`boolean` - Whether to add the type name to the response (default: false) |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -5990,6 +4593,7 @@ _Default:_ `all` ---- client.indices.getTemplate({ name: string | string[], + include_type_name: boolean, flat_settings: boolean, master_timeout: string, local: boolean @@ -6001,6 +4605,9 @@ link:{ref}/indices-templates.html[Documentation] + |`name` |`string \| string[]` - The comma separated names of the index templates +|`include_type_name` or `includeTypeName` +|`boolean` - Whether a type should be returned in the body of the mappings. + |`flat_settings` or `flatSettings` |`boolean` - Return settings in flat format (default: false) @@ -6086,19 +4693,12 @@ _Default:_ `closed` [source,ts] ---- -<<<<<<< HEAD -client.snapshot.delete({ - repository: string, - snapshot: string, - master_timeout: string -======= client.indices.putAlias({ index: string | string[], name: string, timeout: string, master_timeout: string, body: object ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/indices-aliases.html[Documentation] + @@ -6107,16 +4707,11 @@ link:{ref}/indices-aliases.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. -<<<<<<< HEAD -|`snapshot` -|`string` - A snapshot name -======= |`name` |`string` - The name of the alias to be created or updated |`timeout` |`string` - Explicit timestamp for the document ->>>>>>> a064f0f3... Improve child performances (#1314) |`master_timeout` or `masterTimeout` |`string` - Specify timeout for connection to master @@ -6164,6 +4759,8 @@ link:{ref}/indices-templates.html[Documentation] + ---- client.indices.putMapping({ index: string | string[], + type: string, + include_type_name: boolean, timeout: string, master_timeout: string, ignore_unavailable: boolean, @@ -6179,6 +4776,14 @@ link:{ref}/indices-put-mapping.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. +|`type` +|`string` - The name of the document type + + +WARNING: This parameter has been deprecated. + +|`include_type_name` or `includeTypeName` +|`boolean` - Whether a type should be expected in the body of the mappings. + |`timeout` |`string` - Explicit operation timeout @@ -6258,6 +4863,7 @@ _Default:_ `open` ---- client.indices.putTemplate({ name: string, + include_type_name: boolean, order: number, create: boolean, master_timeout: string, @@ -6270,6 +4876,9 @@ link:{ref}/indices-templates.html[Documentation] + |`name` |`string` - The name of the template +|`include_type_name` or `includeTypeName` +|`boolean` - Whether a type should be returned in the body of the mappings. + |`order` |`number` - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) @@ -6394,6 +5003,7 @@ _Default:_ `open` client.indices.rollover({ alias: string, new_index: string, + include_type_name: boolean, timeout: string, dry_run: boolean, master_timeout: string, @@ -6410,6 +5020,9 @@ link:{ref}/indices-rollover-index.html[Documentation] + |`new_index` or `newIndex` |`string` - The name of the rollover index +|`include_type_name` or `includeTypeName` +|`boolean` - Whether a type should be included in the body of the mappings. + |`timeout` |`string` - Explicit operation timeout @@ -6431,55 +5044,19 @@ link:{ref}/indices-rollover-index.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.termvectors({ - index: string, - id: string, - type: string, - term_statistics: boolean, - field_statistics: boolean, - fields: string | string[], - offsets: boolean, - positions: boolean, - payloads: boolean, - preference: string, - routing: string, - realtime: boolean, - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force', - body: object -======= client.indices.segments({ index: string | string[], ignore_unavailable: boolean, allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', verbose: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/indices-segments.html[Documentation] + [cols=2*] |=== |`index` -<<<<<<< HEAD -|`string` - The index in which the document resides. - -|`id` -|`string` - The id of the document, when not specified a doc param should be supplied. - -|`type` -|`string` - The type of the document. - -|`term_statistics` or `termStatistics` -|`boolean` - Specifies if total term frequency and document frequency should be returned. - -|`field_statistics` or `fieldStatistics` -|`boolean` - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. + -_Default:_ `true` -======= |`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices ->>>>>>> a064f0f3... Improve child performances (#1314) |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -6517,13 +5094,8 @@ link:{ref}/indices-shards-stores.html[Documentation] + |`status` |`string \| string[]` - A comma-separated list of statuses used to filter on shards to get store information for -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) ->>>>>>> a064f0f3... Improve child performances (#1314) |`allow_no_indices` or `allowNoIndices` |`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) @@ -6541,6 +5113,7 @@ _Default:_ `open` client.indices.shrink({ index: string, target: string, + copy_settings: boolean, timeout: string, master_timeout: string, wait_for_active_shards: string, @@ -6556,6 +5129,9 @@ link:{ref}/indices-shrink-index.html[Documentation] + |`target` |`string` - The name of the target index to shrink into +|`copy_settings` or `copySettings` +|`boolean` - whether or not to copy settings from the source index (defaults to false) + |`timeout` |`string` - Explicit operation timeout @@ -6574,52 +5150,11 @@ link:{ref}/indices-shrink-index.html[Documentation] + *Stability:* experimental [source,ts] ---- -<<<<<<< HEAD -client.updateByQuery({ - index: string | string[], - type: string | string[], - analyzer: string, - analyze_wildcard: boolean, - default_operator: 'AND' | 'OR', - df: string, - from: number, - ignore_unavailable: boolean, - allow_no_indices: boolean, - conflicts: 'abort' | 'proceed', - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - lenient: boolean, - pipeline: string, - preference: string, - q: string, - routing: string | string[], - scroll: string, - search_type: 'query_then_fetch' | 'dfs_query_then_fetch', - search_timeout: string, - size: number, - max_docs: number, - sort: string | string[], - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - terminate_after: number, - stats: string | string[], - version: boolean, - version_type: boolean, - request_cache: boolean, - refresh: boolean, - timeout: string, - wait_for_active_shards: string, - scroll_size: number, - wait_for_completion: boolean, - requests_per_second: number, - slices: number|string, -======= client.indices.simulateIndexTemplate({ name: string, create: boolean, cause: string, master_timeout: string, ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- @@ -6629,16 +5164,8 @@ link:{ref}/indices-templates.html[Documentation] + |`name` |`string` - The name of the index (it must be a concrete index name) -<<<<<<< HEAD -|`type` -|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types - -|`analyzer` -|`string` - The analyzer to use for the query string -======= |`create` |`boolean` - Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one ->>>>>>> a064f0f3... Improve child performances (#1314) |`cause` |`string` - User defined reason for dry-run creating the new template for simulation purposes @@ -6690,6 +5217,7 @@ link:{ref}/indices-templates.html[Documentation] + client.indices.split({ index: string, target: string, + copy_settings: boolean, timeout: string, master_timeout: string, wait_for_active_shards: string, @@ -6705,6 +5233,9 @@ link:{ref}/indices-split-index.html[Documentation] + |`target` |`string` - The name of the target index to split into +|`copy_settings` or `copySettings` +|`boolean` - whether or not to copy settings from the source index (defaults to false) + |`timeout` |`string` - Explicit operation timeout @@ -6714,16 +5245,8 @@ link:{ref}/indices-split-index.html[Documentation] + |`wait_for_active_shards` or `waitForActiveShards` |`string` - Set the number of active shards to wait for on the shrunken index before the operation returns. -<<<<<<< HEAD -|`size` -|`number` - Deprecated, please use `max_docs` instead - -|`max_docs` or `maxDocs` -|`number` - Maximum number of documents to process (default: all documents) -======= |`body` |`object` - The configuration for the target index (`settings` and `aliases`) ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -6904,29 +5427,6 @@ client.indices.validateQuery({ allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', q: string, -<<<<<<< HEAD - routing: string | string[], - search_type: 'query_then_fetch' | 'dfs_query_then_fetch', - size: number, - sort: string | string[], - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - terminate_after: number, - stats: string | string[], - suggest_field: string, - suggest_mode: 'missing' | 'popular' | 'always', - suggest_size: number, - suggest_text: string, - timeout: string, - track_scores: boolean, - track_total_hits: boolean, - allow_partial_search_results: boolean, - typed_keys: boolean, - version: boolean, - seq_no_primary_term: boolean, - max_concurrent_shard_requests: number, -======= analyzer: string, analyze_wildcard: boolean, default_operator: 'AND' | 'OR', @@ -6934,7 +5434,6 @@ client.indices.validateQuery({ lenient: boolean, rewrite: boolean, all_shards: boolean, ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- @@ -7023,35 +5522,6 @@ link:{ref}/delete-pipeline-api.html[Documentation] + |`timeout` |`string` - Explicit operation timeout -<<<<<<< HEAD -|`track_scores` or `trackScores` -|`boolean` - Whether to calculate and return scores even if they are not used for sorting - -|`track_total_hits` or `trackTotalHits` -|`boolean` - Indicate if the number of documents that match the query should be tracked - -|`allow_partial_search_results` or `allowPartialSearchResults` -|`boolean` - Indicate if an error should be returned if there is a partial search failure or timeout + -_Default:_ `true` - -|`typed_keys` or `typedKeys` -|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - -|`version` -|`boolean` - Specify whether to return document version as part of a hit - -|`seq_no_primary_term` or `seqNoPrimaryTerm` -|`boolean` - Specify whether to return sequence number and primary term of the last modification of each hit - -|`max_concurrent_shard_requests` or `maxConcurrentShardRequests` -|`number` - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + -_Default:_ `5` - -|`body` -|`object` - The search definition using the Query DSL - -======= ->>>>>>> a064f0f3... Improve child performances (#1314) |=== === ingest.getPipeline @@ -7160,9 +5630,7 @@ link:{ref}/get-license.html[Documentation] + |`boolean` - Return local information, do not retrieve the state from master node (default: false) |`accept_enterprise` or `acceptEnterprise` -|`boolean` - Supported for backwards compatibility with 7.x. If this param is used it must be set to true + - -WARNING: This parameter has been deprecated. +|`boolean` - If the active license is an enterprise license, return type as 'enterprise' (default: false) |=== @@ -7246,6 +5714,7 @@ link:{ref}/start-trial.html[Documentation] + ---- client.mget({ index: string, + type: string, stored_fields: string | string[], preference: string, realtime: boolean, @@ -7263,6 +5732,11 @@ link:{ref}/docs-multi-get.html[Documentation] + |`index` |`string` - The name of the index +|`type` +|`string` - The type of the document + + +WARNING: This parameter has been deprecated. + |`stored_fields` or `storedFields` |`string \| string[]` - A comma-separated list of stored fields to return in the response @@ -7288,7 +5762,7 @@ link:{ref}/docs-multi-get.html[Documentation] + |`string \| string[]` - A list of fields to extract and return from the _source field |`body` -|`object` - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. +|`object` - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL. |=== @@ -7611,10 +6085,6 @@ link:{ref}/evaluate-dfanalytics.html[Documentation] + |=== -<<<<<<< HEAD -=== enrich.deletePolicy - -======= === ml.explainDataFrameAnalytics *Stability:* experimental [source,ts] @@ -7940,7 +6410,6 @@ link:{ref}/ml-get-category.html[Documentation] + === ml.getDataFrameAnalytics *Stability:* experimental ->>>>>>> a064f0f3... Improve child performances (#1314) [source,ts] ---- client.ml.getDataFrameAnalytics({ @@ -8135,19 +6604,10 @@ link:{ref}/ml-get-influencer.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.graph.explore({ - index: string | string[], - type: string | string[], - routing: string, - timeout: string, - body: object -======= client.ml.getJobStats({ job_id: string, allow_no_match: boolean, allow_no_jobs: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/ml-get-job-stats.html[Documentation] + @@ -8156,18 +6616,8 @@ link:{ref}/ml-get-job-stats.html[Documentation] + |`job_id` or `jobId` |`string` - The ID of the jobs stats to fetch -<<<<<<< HEAD -|`type` -|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + - -WARNING: This parameter has been deprecated. - -|`routing` -|`string` - Specific routing value -======= |`allow_no_match` or `allowNoMatch` |`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) ->>>>>>> a064f0f3... Improve child performances (#1314) |`allow_no_jobs` or `allowNoJobs` |`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) + @@ -8574,35 +7024,8 @@ client.ml.putDataFrameAnalytics({ link:{ref}/put-dfanalytics.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`accept_enterprise` or `acceptEnterprise` -|`boolean` - If the active license is an enterprise license, return type as 'enterprise' (default: false) - -|=== - -=== license.getBasicStatus - -[source,ts] ----- -client.license.getBasicStatus() ----- -link:{ref}/get-basic-status.html[Documentation] + - - -=== license.getTrialStatus - -[source,ts] ----- -client.license.getTrialStatus() ----- -link:{ref}/get-trial-status.html[Documentation] + -======= |`id` |`string` - The ID of the data frame analytics to create ->>>>>>> a064f0f3... Improve child performances (#1314) |`body` |`object` - The data frame analytics configuration @@ -9071,6 +7494,7 @@ WARNING: This parameter has been deprecated. ---- client.msearch({ index: string | string[], + type: string | string[], search_type: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch', max_concurrent_searches: number, typed_keys: boolean, @@ -9088,6 +7512,9 @@ link:{ref}/search-multi-search.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to use as default +|`type` +|`string \| string[]` - A comma-separated list of document types to use as default + |`search_type` or `searchType` |`'query_then_fetch' \| 'query_and_fetch' \| 'dfs_query_then_fetch' \| 'dfs_query_and_fetch'` - Search operation type @@ -9122,6 +7549,7 @@ _Default:_ `true` ---- client.msearchTemplate({ index: string | string[], + type: string | string[], search_type: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch', typed_keys: boolean, max_concurrent_searches: number, @@ -9136,6 +7564,9 @@ link:{ref}/search-multi-search.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to use as default +|`type` +|`string \| string[]` - A comma-separated list of document types to use as default + |`search_type` or `searchType` |`'query_then_fetch' \| 'query_and_fetch' \| 'dfs_query_then_fetch' \| 'dfs_query_and_fetch'` - Search operation type @@ -9163,6 +7594,7 @@ _Default:_ `true` ---- client.mtermvectors({ index: string, + type: string, ids: string | string[], term_statistics: boolean, field_statistics: boolean, @@ -9174,7 +7606,7 @@ client.mtermvectors({ routing: string, realtime: boolean, version: number, - version_type: 'internal' | 'external' | 'external_gte', + version_type: 'internal' | 'external' | 'external_gte' | 'force', body: object }) ---- @@ -9184,6 +7616,9 @@ link:{ref}/docs-multi-termvectors.html[Documentation] + |`index` |`string` - The index in which the document resides. +|`type` +|`string` - The type of the document. + |`ids` |`string \| string[]` - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body @@ -9222,7 +7657,7 @@ _Default:_ `true` |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |`body` |`object` - Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation. @@ -9415,7 +7850,7 @@ client.openPointInTime({ keep_alive: string }) ---- -link:{ref}/point-in-time-api.html[Documentation] + +link:{ref}/point-in-time.html[Documentation] + [cols=2*] |=== |`index` @@ -9821,6 +8256,7 @@ WARNING: This parameter has been deprecated. ---- client.search({ index: string | string[], + type: string | string[], analyzer: string, analyze_wildcard: boolean, ccs_minimize_roundtrips: boolean, @@ -9853,7 +8289,7 @@ client.search({ suggest_text: string, timeout: string, track_scores: boolean, - track_total_hits: boolean|long, + track_total_hits: boolean, allow_partial_search_results: boolean, typed_keys: boolean, version: boolean, @@ -9873,6 +8309,9 @@ link:{ref}/search-search.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +|`type` +|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + |`analyzer` |`string` - The analyzer to use for the query string @@ -9974,7 +8413,7 @@ _Default:_ `missing` |`boolean` - Whether to calculate and return scores even if they are not used for sorting |`track_total_hits` or `trackTotalHits` -|`boolean\|long` - Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number. +|`boolean` - Indicate if the number of documents that match the query should be tracked |`allow_partial_search_results` or `allowPartialSearchResults` |`boolean` - Indicate if an error should be returned if there is a partial search failure or timeout + @@ -10058,6 +8497,7 @@ _Default:_ `open` ---- client.searchTemplate({ index: string | string[], + type: string | string[], ignore_unavailable: boolean, ignore_throttled: boolean, allow_no_indices: boolean, @@ -10080,6 +8520,9 @@ link:{ref}/search-template.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +|`type` +|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -10514,14 +8957,14 @@ link:{ref}/security-api-get-privileges.html[Documentation] + [source,ts] ---- client.security.getRole({ - name: string | string[] + name: string }) ---- link:{ref}/security-api-get-role.html[Documentation] + [cols=2*] |=== |`name` -|`string \| string[]` - A comma-separated list of role names +|`string` - Role name |=== @@ -10530,14 +8973,14 @@ link:{ref}/security-api-get-role.html[Documentation] + [source,ts] ---- client.security.getRoleMapping({ - name: string | string[] + name: string }) ---- link:{ref}/security-api-get-role-mapping.html[Documentation] + [cols=2*] |=== |`name` -|`string \| string[]` - A comma-separated list of role-mapping names +|`string` - Role-Mapping name |=== @@ -10933,7 +9376,7 @@ link:{ref}/modules-snapshots.html[Documentation] + ---- client.snapshot.delete({ repository: string, - snapshot: string | string[], + snapshot: string, master_timeout: string }) ---- @@ -10944,7 +9387,7 @@ link:{ref}/modules-snapshots.html[Documentation] + |`string` - A repository name |`snapshot` -|`string \| string[]` - A comma-separated list of snapshot names +|`string` - A snapshot name |`master_timeout` or `masterTimeout` |`string` - Explicit operation timeout for connection to master node @@ -11035,26 +9478,17 @@ link:{ref}/modules-snapshots.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.security.getRole({ - name: string -======= client.snapshot.restore({ repository: string, snapshot: string, master_timeout: string, wait_for_completion: boolean, body: object ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/modules-snapshots.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`name` -|`string` - Role name -======= |`repository` |`string` - A repository name @@ -11069,7 +9503,6 @@ link:{ref}/modules-snapshots.html[Documentation] + |`body` |`object` - Details of what to restore ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -11077,25 +9510,16 @@ link:{ref}/modules-snapshots.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.security.getRoleMapping({ - name: string -======= client.snapshot.status({ repository: string, snapshot: string | string[], master_timeout: string, ignore_unavailable: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/modules-snapshots.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`name` -|`string` - Role-Mapping name -======= |`repository` |`string` - A repository name @@ -11107,7 +9531,6 @@ link:{ref}/modules-snapshots.html[Documentation] + |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -11301,6 +9724,7 @@ _Default:_ `nodes` client.termvectors({ index: string, id: string, + type: string, term_statistics: boolean, field_statistics: boolean, fields: string | string[], @@ -11311,7 +9735,7 @@ client.termvectors({ routing: string, realtime: boolean, version: number, - version_type: 'internal' | 'external' | 'external_gte', + version_type: 'internal' | 'external' | 'external_gte' | 'force', body: object }) ---- @@ -11324,6 +9748,9 @@ link:{ref}/docs-termvectors.html[Documentation] + |`id` |`string` - The id of the document, when not specified a doc param should be supplied. +|`type` +|`string` - The type of the document. + |`term_statistics` or `termStatistics` |`boolean` - Specifies if total term frequency and document frequency should be returned. @@ -11359,7 +9786,7 @@ _Default:_ `true` |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |`body` |`object` - Define parameters and or supply a document to get termvectors for. See documentation. @@ -11647,6 +10074,7 @@ WARNING: This parameter has been deprecated. ---- client.updateByQuery({ index: string | string[], + type: string | string[], analyzer: string, analyze_wildcard: boolean, default_operator: 'AND' | 'OR', @@ -11664,6 +10092,7 @@ client.updateByQuery({ scroll: string, search_type: 'query_then_fetch' | 'dfs_query_then_fetch', search_timeout: string, + size: number, max_docs: number, sort: string | string[], _source: string | string[], @@ -11691,6 +10120,9 @@ link:{ref}/docs-update-by-query.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +|`type` +|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + |`analyzer` |`string` - The analyzer to use for the query string @@ -11745,6 +10177,9 @@ _Default:_ `open` |`search_timeout` or `searchTimeout` |`string` - Explicit timeout for each search request. Defaults to no timeout. +|`size` +|`number` - Deprecated, please use `max_docs` instead + |`max_docs` or `maxDocs` |`number` - Maximum number of documents to process (default: all documents)