API generation

This commit is contained in:
delvedor
2019-04-24 10:22:37 +02:00
parent c35eb421cb
commit e3a0e9ed56
32 changed files with 37 additions and 233 deletions

View File

@ -78,11 +78,7 @@ function buildClearScroll (opts) {
var path = ''
if ((scroll_id || scrollId) != null) {
path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)
} else {
path = '/' + '_search' + '/' + 'scroll'
}
path = '/' + '_search' + '/' + 'scroll'
// build request object
const request = {

View File

@ -94,12 +94,6 @@ function buildCount (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}`)
@ -121,9 +115,7 @@ function buildCount (opts) {
var path = ''
if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count'
} else if ((index) != null) {
if ((index) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_count'
} else {
path = '/' + '_count'

View File

@ -112,11 +112,7 @@ function buildCreate (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_create'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_create' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + '_create' + '/' + encodeURIComponent(id)
// build request object
const request = {

View File

@ -121,11 +121,7 @@ function buildDelete (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
// build request object
const request = {

View File

@ -147,12 +147,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}`)
@ -174,11 +168,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 = {

View File

@ -119,11 +119,7 @@ function buildExists (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
// build request object
const request = {

View File

@ -96,10 +96,7 @@ function buildExistsSource (opts) {
}
// check required url components
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: type, index')
return handleError(err, callback)
} else if (params['type'] != null && (params['index'] == null)) {
if (params['id'] != null && (params['index'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
@ -125,11 +122,7 @@ function buildExistsSource (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
// build request object
const request = {

View File

@ -121,11 +121,7 @@ function buildExplain (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id)
// build request object
const request = {

View File

@ -33,6 +33,7 @@ function buildFieldCaps (opts) {
* @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.
* @param {boolean} include_unmapped - Indicates whether unmapped fields should be included in the response.
*/
const acceptedQuerystring = [
@ -40,6 +41,7 @@ function buildFieldCaps (opts) {
'ignore_unavailable',
'allow_no_indices',
'expand_wildcards',
'include_unmapped',
'pretty',
'human',
'error_trace',
@ -51,6 +53,7 @@ function buildFieldCaps (opts) {
ignoreUnavailable: 'ignore_unavailable',
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
includeUnmapped: 'include_unmapped',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -40,8 +40,6 @@ function buildGet (opts) {
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
* @param {list} _source_includes - A list of fields to extract and return from the _source field
* @param {list} _source_exclude - A list of fields to exclude from the returned _source field
* @param {list} _source_include - A list of fields to extract and return from the _source field
* @param {number} version - Explicit version number for concurrency control
* @param {enum} version_type - Specific version type
*/
@ -56,8 +54,6 @@ function buildGet (opts) {
'_source',
'_source_excludes',
'_source_includes',
'_source_exclude',
'_source_include',
'version',
'version_type',
'pretty',
@ -71,8 +67,6 @@ function buildGet (opts) {
storedFields: 'stored_fields',
_sourceExcludes: '_source_excludes',
_sourceIncludes: '_source_includes',
_sourceExclude: '_source_exclude',
_sourceInclude: '_source_include',
versionType: 'version_type',
errorTrace: 'error_trace',
filterPath: 'filter_path'
@ -125,11 +119,7 @@ function buildGet (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
// build request object
const request = {

View File

@ -116,11 +116,7 @@ function buildGetSource (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
// build request object
const request = {

View File

@ -56,12 +56,6 @@ function buildGraphExplore (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}`)
@ -83,11 +77,7 @@ function buildGraphExplore (opts) {
var path = ''
if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore'
}
path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore'
// build request object
const request = {

View File

@ -123,12 +123,8 @@ function buildIndex (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else if ((index) != null && (id) != null) {
if ((index) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
} else if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type)
} else {
path = '/' + encodeURIComponent(index) + '/' + '_doc'
}

View File

@ -106,12 +106,8 @@ function buildIndicesGetFieldMapping (opts) {
var path = ''
if ((index) != null && (type) != null && (fields) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields)
} else if ((index) != null && (fields) != null) {
if ((index) != null && (fields) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields)
} else if ((type) != null && (fields) != null) {
path = '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields)
} else {
path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields)
}

View File

@ -101,12 +101,8 @@ function buildIndicesGetMapping (opts) {
var path = ''
if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
} else if ((index) != null) {
if ((index) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_mapping'
} else if ((type) != null) {
path = '/' + '_mapping' + '/' + encodeURIComponent(type)
} else {
path = '/' + '_mapping'
}

View File

@ -102,23 +102,7 @@ function buildIndicesPutMapping (opts) {
var path = ''
if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping'
} else if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
} else if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mappings'
} else if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_mappings' + '/' + encodeURIComponent(type)
} else if ((type) != null) {
path = '/' + '_mapping' + '/' + encodeURIComponent(type)
} else if ((type) != null) {
path = '/' + '_mappings' + '/' + encodeURIComponent(type)
} else if ((index) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_mappings'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_mapping'
}
path = '/' + encodeURIComponent(index) + '/' + '_mapping'
// build request object
const request = {

View File

@ -88,12 +88,6 @@ function buildIndicesValidateQuery (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}`)
@ -115,9 +109,7 @@ function buildIndicesValidateQuery (opts) {
var path = ''
if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_validate' + '/' + 'query'
} else if ((index) != null) {
if ((index) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_validate' + '/' + 'query'
} else {
path = '/' + '_validate' + '/' + 'query'

View File

@ -83,12 +83,6 @@ function buildMget (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}`)
@ -110,9 +104,7 @@ function buildMget (opts) {
var path = ''
if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mget'
} else if ((index) != null) {
if ((index) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_mget'
} else {
path = '/' + '_mget'

View File

@ -86,11 +86,7 @@ function buildMonitoringBulk (opts) {
var path = ''
if ((type) != null) {
path = '/' + '_monitoring' + '/' + encodeURIComponent(type) + '/' + 'bulk'
} else {
path = '/' + '_monitoring' + '/' + 'bulk'
}
path = '/' + '_monitoring' + '/' + 'bulk'
// build request object
const request = {

View File

@ -85,12 +85,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}`)
@ -112,9 +106,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'

View File

@ -79,12 +79,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}`)
@ -106,9 +100,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'

View File

@ -87,12 +87,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}`)
@ -114,9 +108,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'

View File

@ -97,15 +97,9 @@ function buildNodesHotThreads (opts) {
var path = ''
if ((node_id || nodeId) != null) {
path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
} else if ((node_id || nodeId) != null) {
path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
} else if ((node_id || nodeId) != null) {
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
} else if ((node_id || nodeId) != null) {
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
} else {
path = '/' + '_cluster' + '/' + 'nodes' + '/' + 'hotthreads'
path = '/' + '_nodes' + '/' + 'hot_threads'
}
// build request object

View File

@ -67,12 +67,6 @@ function buildRollupRollupSearch (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}`)
@ -94,11 +88,7 @@ function buildRollupRollupSearch (opts) {
var path = ''
if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_rollup_search'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_rollup_search'
}
path = '/' + encodeURIComponent(index) + '/' + '_rollup_search'
// build request object
const request = {

View File

@ -86,11 +86,7 @@ function buildScroll (opts) {
var path = ''
if ((scroll_id || scrollId) != null) {
path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)
} else {
path = '/' + '_search' + '/' + 'scroll'
}
path = '/' + '_search' + '/' + 'scroll'
// build request object
const request = {

View File

@ -169,12 +169,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}`)
@ -196,9 +190,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'

View File

@ -98,12 +98,6 @@ function buildSearchTemplate (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}`)
@ -125,9 +119,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'

View File

@ -113,12 +113,8 @@ function buildTermvectors (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors'
} else if ((index) != null && (id) != null) {
if ((index) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_termvectors' + '/' + encodeURIComponent(id)
} else if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_termvectors'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_termvectors'
}

View File

@ -124,11 +124,7 @@ function buildUpdate (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_update'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_update' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + '_update' + '/' + encodeURIComponent(id)
// build request object
const request = {

View File

@ -148,12 +148,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}`)
@ -175,11 +169,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 = {

View File

@ -493,6 +493,7 @@ export interface FieldCaps extends Generic {
ignore_unavailable?: boolean;
allow_no_indices?: boolean;
expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
include_unmapped?: boolean;
}
export interface Get extends Generic {
@ -508,8 +509,6 @@ export interface Get extends Generic {
_source?: string | string[];
_source_excludes?: string | string[];
_source_includes?: string | string[];
_source_exclude?: string | string[];
_source_include?: string | string[];
version?: number;
version_type?: 'internal' | 'external' | 'external_gte' | 'force';
}

View File

@ -1492,6 +1492,9 @@ link:{ref}/search-field-caps.html[Reference]
|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`
|`include_unmapped` or `includeUnmapped`
|`boolean` - Indicates whether unmapped fields should be included in the response.
|===
=== get
@ -1538,12 +1541,6 @@ link:{ref}/docs-get.html[Reference]
|`_source_includes` or `_sourceIncludes`
|`string, string[]` - A list of fields to extract and return from the _source field
|`_source_exclude` or `_sourceExclude`
|`string, string[]` - A list of fields to exclude from the returned _source field
|`_source_include` or `_sourceInclude`
|`string, string[]` - A list of fields to extract and return from the _source field
|`version`
|`number` - Explicit version number for concurrency control