Patch deprecated parameters (#851)
* Updated code generation * API generation * API generation * Updated code generation
This commit is contained in:
committed by
delvedor
parent
554bb1ff05
commit
c68a5ce9a2
@ -51,7 +51,13 @@ function buildBulk (opts) {
|
||||
'type',
|
||||
'fields',
|
||||
'_source',
|
||||
<<<<<<< HEAD
|
||||
'_source_exclude',
|
||||
=======
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
'_source_include',
|
||||
'pipeline',
|
||||
'pretty',
|
||||
@ -63,7 +69,13 @@ function buildBulk (opts) {
|
||||
|
||||
const snakeCase = {
|
||||
waitForActiveShards: 'wait_for_active_shards',
|
||||
<<<<<<< HEAD
|
||||
_sourceExclude: '_source_exclude',
|
||||
=======
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
_sourceInclude: '_source_include',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
|
||||
@ -29,7 +29,6 @@ function buildDeleteByQuery (opts) {
|
||||
* Perform a [delete_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-delete-by-query.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
||||
* @param {string} analyzer - The analyzer to use for the query string
|
||||
* @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
||||
* @param {enum} default_operator - The default operator for query string query (AND or OR)
|
||||
@ -85,7 +84,13 @@ function buildDeleteByQuery (opts) {
|
||||
'size',
|
||||
'sort',
|
||||
'_source',
|
||||
<<<<<<< HEAD
|
||||
'_source_exclude',
|
||||
=======
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
'_source_include',
|
||||
'terminate_after',
|
||||
'stats',
|
||||
@ -113,7 +118,13 @@ function buildDeleteByQuery (opts) {
|
||||
expandWildcards: 'expand_wildcards',
|
||||
searchType: 'search_type',
|
||||
searchTimeout: 'search_timeout',
|
||||
<<<<<<< HEAD
|
||||
_sourceExclude: '_source_exclude',
|
||||
=======
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
_sourceInclude: '_source_include',
|
||||
terminateAfter: 'terminate_after',
|
||||
requestCache: 'request_cache',
|
||||
@ -147,12 +158,6 @@ function buildDeleteByQuery (opts) {
|
||||
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}`)
|
||||
@ -160,7 +165,7 @@ function buildDeleteByQuery (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
@ -174,11 +179,7 @@ function buildDeleteByQuery (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query'
|
||||
} else {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query'
|
||||
}
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
|
||||
@ -52,7 +52,13 @@ function buildExists (opts) {
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
<<<<<<< HEAD
|
||||
'_source_exclude',
|
||||
=======
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
'_source_include',
|
||||
'version',
|
||||
'version_type',
|
||||
@ -65,7 +71,13 @@ function buildExists (opts) {
|
||||
|
||||
const snakeCase = {
|
||||
storedFields: 'stored_fields',
|
||||
<<<<<<< HEAD
|
||||
_sourceExclude: '_source_exclude',
|
||||
=======
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
_sourceInclude: '_source_include',
|
||||
versionType: 'version_type',
|
||||
errorTrace: 'error_trace',
|
||||
|
||||
@ -50,7 +50,13 @@ function buildExistsSource (opts) {
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
<<<<<<< HEAD
|
||||
'_source_exclude',
|
||||
=======
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
'_source_include',
|
||||
'version',
|
||||
'version_type',
|
||||
@ -62,7 +68,13 @@ function buildExistsSource (opts) {
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
<<<<<<< HEAD
|
||||
_sourceExclude: '_source_exclude',
|
||||
=======
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
_sourceInclude: '_source_include',
|
||||
versionType: 'version_type',
|
||||
errorTrace: 'error_trace',
|
||||
|
||||
@ -59,7 +59,13 @@ function buildExplain (opts) {
|
||||
'q',
|
||||
'routing',
|
||||
'_source',
|
||||
<<<<<<< HEAD
|
||||
'_source_exclude',
|
||||
=======
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
'_source_include',
|
||||
'pretty',
|
||||
'human',
|
||||
@ -72,7 +78,13 @@ function buildExplain (opts) {
|
||||
analyzeWildcard: 'analyze_wildcard',
|
||||
defaultOperator: 'default_operator',
|
||||
storedFields: 'stored_fields',
|
||||
<<<<<<< HEAD
|
||||
_sourceExclude: '_source_exclude',
|
||||
=======
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
_sourceInclude: '_source_include',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
|
||||
@ -52,7 +52,13 @@ function buildGet (opts) {
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
<<<<<<< HEAD
|
||||
'_source_exclude',
|
||||
=======
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
'_source_include',
|
||||
'version',
|
||||
'version_type',
|
||||
@ -65,7 +71,13 @@ function buildGet (opts) {
|
||||
|
||||
const snakeCase = {
|
||||
storedFields: 'stored_fields',
|
||||
<<<<<<< HEAD
|
||||
_sourceExclude: '_source_exclude',
|
||||
=======
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
_sourceInclude: '_source_include',
|
||||
versionType: 'version_type',
|
||||
errorTrace: 'error_trace',
|
||||
|
||||
@ -50,7 +50,13 @@ function buildGetSource (opts) {
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
<<<<<<< HEAD
|
||||
'_source_exclude',
|
||||
=======
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
'_source_include',
|
||||
'version',
|
||||
'version_type',
|
||||
@ -62,7 +68,13 @@ function buildGetSource (opts) {
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
<<<<<<< HEAD
|
||||
_sourceExclude: '_source_exclude',
|
||||
=======
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
_sourceInclude: '_source_include',
|
||||
versionType: 'version_type',
|
||||
errorTrace: 'error_trace',
|
||||
|
||||
@ -48,7 +48,13 @@ function buildMget (opts) {
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
<<<<<<< HEAD
|
||||
'_source_exclude',
|
||||
=======
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
'_source_include',
|
||||
'pretty',
|
||||
'human',
|
||||
@ -59,7 +65,13 @@ function buildMget (opts) {
|
||||
|
||||
const snakeCase = {
|
||||
storedFields: 'stored_fields',
|
||||
<<<<<<< HEAD
|
||||
_sourceExclude: '_source_exclude',
|
||||
=======
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
_sourceInclude: '_source_include',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
|
||||
@ -29,7 +29,6 @@ function buildMsearch (opts) {
|
||||
* Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-multi-search.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to use as default
|
||||
* @param {list} type - A comma-separated list of document types to use as default
|
||||
* @param {enum} search_type - Search operation type
|
||||
* @param {number} max_concurrent_searches - Controls the maximum number of concurrent searches the multi search api will execute
|
||||
* @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
|
||||
@ -76,12 +75,6 @@ function buildMsearch (opts) {
|
||||
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}`)
|
||||
@ -89,7 +82,7 @@ function buildMsearch (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
@ -103,9 +96,7 @@ function buildMsearch (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch'
|
||||
} else if ((index) != null) {
|
||||
if ((index) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_msearch'
|
||||
} else {
|
||||
path = '/' + '_msearch'
|
||||
|
||||
@ -29,7 +29,6 @@ function buildMsearchTemplate (opts) {
|
||||
* Perform a [msearch_template](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to use as default
|
||||
* @param {list} type - A comma-separated list of document types to use as default
|
||||
* @param {enum} search_type - Search operation type
|
||||
* @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
|
||||
* @param {number} max_concurrent_searches - Controls the maximum number of concurrent searches the multi search api will execute
|
||||
@ -73,12 +72,6 @@ function buildMsearchTemplate (opts) {
|
||||
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}`)
|
||||
@ -86,7 +79,7 @@ function buildMsearchTemplate (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
@ -100,9 +93,7 @@ function buildMsearchTemplate (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' + '/' + 'template'
|
||||
} else if ((index) != null) {
|
||||
if ((index) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_msearch' + '/' + 'template'
|
||||
} else {
|
||||
path = '/' + '_msearch' + '/' + 'template'
|
||||
|
||||
@ -29,7 +29,6 @@ function buildMtermvectors (opts) {
|
||||
* Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-multi-termvectors.html) request
|
||||
*
|
||||
* @param {string} index - The index in which the document resides.
|
||||
* @param {string} type - The type of the document.
|
||||
* @param {list} ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
|
||||
* @param {boolean} term_statistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
|
||||
* @param {boolean} field_statistics - 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".
|
||||
@ -87,12 +86,6 @@ function buildMtermvectors (opts) {
|
||||
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}`)
|
||||
@ -100,7 +93,7 @@ function buildMtermvectors (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
@ -114,9 +107,7 @@ function buildMtermvectors (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mtermvectors'
|
||||
} else if ((index) != null) {
|
||||
if ((index) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_mtermvectors'
|
||||
} else {
|
||||
path = '/' + '_mtermvectors'
|
||||
|
||||
@ -29,7 +29,6 @@ function buildSearch (opts) {
|
||||
* Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-search.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
||||
* @param {string} analyzer - The analyzer to use for the query string
|
||||
* @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
||||
* @param {enum} default_operator - The default operator for query string query (AND or OR)
|
||||
@ -92,7 +91,13 @@ function buildSearch (opts) {
|
||||
'size',
|
||||
'sort',
|
||||
'_source',
|
||||
<<<<<<< HEAD
|
||||
'_source_exclude',
|
||||
=======
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
'_source_include',
|
||||
'terminate_after',
|
||||
'stats',
|
||||
@ -125,7 +130,13 @@ function buildSearch (opts) {
|
||||
allowNoIndices: 'allow_no_indices',
|
||||
expandWildcards: 'expand_wildcards',
|
||||
searchType: 'search_type',
|
||||
<<<<<<< HEAD
|
||||
_sourceExclude: '_source_exclude',
|
||||
=======
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
_sourceInclude: '_source_include',
|
||||
terminateAfter: 'terminate_after',
|
||||
suggestField: 'suggest_field',
|
||||
@ -154,12 +165,6 @@ function buildSearch (opts) {
|
||||
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}`)
|
||||
@ -167,7 +172,7 @@ function buildSearch (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
@ -181,9 +186,7 @@ function buildSearch (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search'
|
||||
} else if ((index) != null) {
|
||||
if ((index) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_search'
|
||||
} else {
|
||||
path = '/' + '_search'
|
||||
|
||||
@ -29,7 +29,6 @@ function buildSearchTemplate (opts) {
|
||||
* Perform a [search_template](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||
@ -83,9 +82,15 @@ function buildSearchTemplate (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// check required url components
|
||||
if (params['type'] != null && (params['index'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
||||
=======
|
||||
// check required parameters
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
@ -96,7 +101,7 @@ function buildSearchTemplate (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
@ -110,9 +115,7 @@ function buildSearchTemplate (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' + '/' + 'template'
|
||||
} else if ((index) != null) {
|
||||
if ((index) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'template'
|
||||
} else {
|
||||
path = '/' + '_search' + '/' + 'template'
|
||||
|
||||
@ -29,7 +29,6 @@ function buildTermvectors (opts) {
|
||||
* Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-termvectors.html) request
|
||||
*
|
||||
* @param {string} index - The index in which the document resides.
|
||||
* @param {string} type - The type of the document.
|
||||
* @param {string} id - The id of the document, when not specified a doc param should be supplied.
|
||||
* @param {boolean} term_statistics - Specifies if total term frequency and document frequency should be returned.
|
||||
* @param {boolean} field_statistics - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.
|
||||
@ -103,7 +102,7 @@ function buildTermvectors (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, type, id, ...querystring } = params
|
||||
var { method, body, index, id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
@ -117,8 +116,13 @@ function buildTermvectors (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
<<<<<<< HEAD
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors'
|
||||
=======
|
||||
if ((index) != null && (id) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_termvectors' + '/' + encodeURIComponent(id)
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
} else {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_termvectors'
|
||||
}
|
||||
|
||||
@ -53,7 +53,13 @@ function buildUpdate (opts) {
|
||||
'wait_for_active_shards',
|
||||
'fields',
|
||||
'_source',
|
||||
<<<<<<< HEAD
|
||||
'_source_exclude',
|
||||
=======
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
'_source_include',
|
||||
'lang',
|
||||
'parent',
|
||||
@ -74,7 +80,13 @@ function buildUpdate (opts) {
|
||||
|
||||
const snakeCase = {
|
||||
waitForActiveShards: 'wait_for_active_shards',
|
||||
<<<<<<< HEAD
|
||||
_sourceExclude: '_source_exclude',
|
||||
=======
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
_sourceInclude: '_source_include',
|
||||
retryOnConflict: 'retry_on_conflict',
|
||||
versionType: 'version_type',
|
||||
|
||||
@ -29,7 +29,6 @@ function buildUpdateByQuery (opts) {
|
||||
* Perform a [update_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-update-by-query.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
||||
* @param {string} analyzer - The analyzer to use for the query string
|
||||
* @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
||||
* @param {enum} default_operator - The default operator for query string query (AND or OR)
|
||||
@ -88,7 +87,13 @@ function buildUpdateByQuery (opts) {
|
||||
'size',
|
||||
'sort',
|
||||
'_source',
|
||||
<<<<<<< HEAD
|
||||
'_source_exclude',
|
||||
=======
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
'_source_include',
|
||||
'terminate_after',
|
||||
'stats',
|
||||
@ -117,7 +122,13 @@ function buildUpdateByQuery (opts) {
|
||||
expandWildcards: 'expand_wildcards',
|
||||
searchType: 'search_type',
|
||||
searchTimeout: 'search_timeout',
|
||||
<<<<<<< HEAD
|
||||
_sourceExclude: '_source_exclude',
|
||||
=======
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
_sourceInclude: '_source_include',
|
||||
terminateAfter: 'terminate_after',
|
||||
versionType: 'version_type',
|
||||
@ -148,12 +159,6 @@ function buildUpdateByQuery (opts) {
|
||||
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}`)
|
||||
@ -161,7 +166,7 @@ function buildUpdateByQuery (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
@ -175,11 +180,7 @@ function buildUpdateByQuery (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_update_by_query'
|
||||
} else {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_update_by_query'
|
||||
}
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_update_by_query'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
|
||||
56
api/requestParams.d.ts
vendored
56
api/requestParams.d.ts
vendored
@ -30,6 +30,8 @@ export interface Generic {
|
||||
export interface Bulk<T = any> extends Generic {
|
||||
index?: string;
|
||||
type?: string;
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
wait_for_active_shards?: string;
|
||||
refresh?: 'true' | 'false' | 'wait_for';
|
||||
routing?: string;
|
||||
@ -399,7 +401,8 @@ export interface Delete extends Generic {
|
||||
|
||||
export interface DeleteByQuery<T = any> extends Generic {
|
||||
index: string | string[];
|
||||
type?: string | string[];
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
analyzer?: string;
|
||||
analyze_wildcard?: boolean;
|
||||
default_operator?: 'AND' | 'OR';
|
||||
@ -449,7 +452,13 @@ export interface DeleteTemplate extends Generic {
|
||||
export interface Exists extends Generic {
|
||||
id: string;
|
||||
index: string;
|
||||
<<<<<<< HEAD
|
||||
type: string;
|
||||
=======
|
||||
type?: string;
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
stored_fields?: string | string[];
|
||||
parent?: string;
|
||||
preference?: string;
|
||||
@ -466,7 +475,13 @@ export interface Exists extends Generic {
|
||||
export interface ExistsSource extends Generic {
|
||||
id: string;
|
||||
index: string;
|
||||
<<<<<<< HEAD
|
||||
type: string;
|
||||
=======
|
||||
type?: string;
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
parent?: string;
|
||||
preference?: string;
|
||||
realtime?: boolean;
|
||||
@ -482,7 +497,13 @@ export interface ExistsSource extends Generic {
|
||||
export interface Explain<T = any> extends Generic {
|
||||
id: string;
|
||||
index: string;
|
||||
<<<<<<< HEAD
|
||||
type: string;
|
||||
=======
|
||||
type?: string;
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
analyze_wildcard?: boolean;
|
||||
analyzer?: string;
|
||||
default_operator?: 'AND' | 'OR';
|
||||
@ -521,7 +542,13 @@ export interface FieldStats<T = any> extends Generic {
|
||||
export interface Get extends Generic {
|
||||
id: string;
|
||||
index: string;
|
||||
<<<<<<< HEAD
|
||||
type: string;
|
||||
=======
|
||||
type?: string;
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
stored_fields?: string | string[];
|
||||
parent?: string;
|
||||
preference?: string;
|
||||
@ -543,7 +570,13 @@ export interface GetScript extends Generic {
|
||||
export interface GetSource extends Generic {
|
||||
id: string;
|
||||
index: string;
|
||||
<<<<<<< HEAD
|
||||
type: string;
|
||||
=======
|
||||
type?: string;
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
parent?: string;
|
||||
preference?: string;
|
||||
realtime?: boolean;
|
||||
@ -951,6 +984,8 @@ export interface IngestSimulate<T = any> extends Generic {
|
||||
export interface Mget<T = any> extends Generic {
|
||||
index?: string;
|
||||
type?: string;
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
stored_fields?: string | string[];
|
||||
preference?: string;
|
||||
realtime?: boolean;
|
||||
@ -973,7 +1008,6 @@ export interface Mpercolate<T = any> extends Generic {
|
||||
|
||||
export interface Msearch<T = any> 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;
|
||||
@ -983,7 +1017,6 @@ export interface Msearch<T = any> extends Generic {
|
||||
|
||||
export interface MsearchTemplate<T = any> 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;
|
||||
@ -992,7 +1025,6 @@ export interface MsearchTemplate<T = any> extends Generic {
|
||||
|
||||
export interface Mtermvectors<T = any> extends Generic {
|
||||
index?: string;
|
||||
type?: string;
|
||||
ids?: string | string[];
|
||||
term_statistics?: boolean;
|
||||
field_statistics?: boolean;
|
||||
@ -1103,7 +1135,8 @@ export interface Scroll<T = any> extends Generic {
|
||||
|
||||
export interface Search<T = any> extends Generic {
|
||||
index?: string | string[];
|
||||
type?: string | string[];
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
analyzer?: string;
|
||||
analyze_wildcard?: boolean;
|
||||
default_operator?: 'AND' | 'OR';
|
||||
@ -1157,7 +1190,6 @@ export interface SearchShards extends Generic {
|
||||
|
||||
export interface SearchTemplate<T = any> extends Generic {
|
||||
index?: string | string[];
|
||||
type?: string | string[];
|
||||
ignore_unavailable?: boolean;
|
||||
allow_no_indices?: boolean;
|
||||
expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
|
||||
@ -1269,7 +1301,10 @@ export interface TasksList extends Generic {
|
||||
|
||||
export interface Termvectors<T = any> extends Generic {
|
||||
index: string;
|
||||
<<<<<<< HEAD
|
||||
type: string;
|
||||
=======
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
id?: string;
|
||||
term_statistics?: boolean;
|
||||
field_statistics?: boolean;
|
||||
@ -1289,7 +1324,13 @@ export interface Termvectors<T = any> extends Generic {
|
||||
export interface Update<T = any> extends Generic {
|
||||
id: string;
|
||||
index: string;
|
||||
<<<<<<< HEAD
|
||||
type: string;
|
||||
=======
|
||||
type?: string;
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||
wait_for_active_shards?: string;
|
||||
fields?: string | string[];
|
||||
_source?: string | string[];
|
||||
@ -1310,7 +1351,8 @@ export interface Update<T = any> extends Generic {
|
||||
|
||||
export interface UpdateByQuery<T = any> extends Generic {
|
||||
index: string | string[];
|
||||
type?: string | string[];
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
analyzer?: string;
|
||||
analyze_wildcard?: boolean;
|
||||
default_operator?: 'AND' | 'OR';
|
||||
|
||||
Reference in New Issue
Block a user