API generation
This commit is contained in:
56
api/api/termsenum.js
Normal file
56
api/api/termsenum.js
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* 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 */
|
||||||
|
|
||||||
|
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||||
|
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
|
||||||
|
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
|
||||||
|
|
||||||
|
function termsenumApi (params, options, callback) {
|
||||||
|
;[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)
|
||||||
|
}
|
||||||
|
|
||||||
|
let { method, body, index, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||||
|
|
||||||
|
let path = ''
|
||||||
|
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||||
|
path = '/' + encodeURIComponent(index) + '/' + '_terms_enum'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: body || '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.transport.request(request, options, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = termsenumApi
|
||||||
@ -84,6 +84,7 @@ const SnapshotApi = require('./api/snapshot')
|
|||||||
const SqlApi = require('./api/sql')
|
const SqlApi = require('./api/sql')
|
||||||
const SslApi = require('./api/ssl')
|
const SslApi = require('./api/ssl')
|
||||||
const TasksApi = require('./api/tasks')
|
const TasksApi = require('./api/tasks')
|
||||||
|
const termsenumApi = require('./api/termsenum')
|
||||||
const termvectorsApi = require('./api/termvectors')
|
const termvectorsApi = require('./api/termvectors')
|
||||||
const TextStructureApi = require('./api/text_structure')
|
const TextStructureApi = require('./api/text_structure')
|
||||||
const TransformApi = require('./api/transform')
|
const TransformApi = require('./api/transform')
|
||||||
@ -201,6 +202,7 @@ ESAPI.prototype.scroll = scrollApi
|
|||||||
ESAPI.prototype.search = searchApi
|
ESAPI.prototype.search = searchApi
|
||||||
ESAPI.prototype.searchShards = searchShardsApi
|
ESAPI.prototype.searchShards = searchShardsApi
|
||||||
ESAPI.prototype.searchTemplate = searchTemplateApi
|
ESAPI.prototype.searchTemplate = searchTemplateApi
|
||||||
|
ESAPI.prototype.termsenum = termsenumApi
|
||||||
ESAPI.prototype.termvectors = termvectorsApi
|
ESAPI.prototype.termvectors = termvectorsApi
|
||||||
ESAPI.prototype.update = updateApi
|
ESAPI.prototype.update = updateApi
|
||||||
ESAPI.prototype.updateByQuery = updateByQueryApi
|
ESAPI.prototype.updateByQuery = updateByQueryApi
|
||||||
|
|||||||
5
api/requestParams.d.ts
vendored
5
api/requestParams.d.ts
vendored
@ -2509,6 +2509,11 @@ export interface TasksList extends Generic {
|
|||||||
timeout?: string;
|
timeout?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Termsenum<T = RequestBody> extends Generic {
|
||||||
|
index: string | string[];
|
||||||
|
body?: T;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Termvectors<T = RequestBody> extends Generic {
|
export interface Termvectors<T = RequestBody> extends Generic {
|
||||||
index: string;
|
index: string;
|
||||||
id?: string;
|
id?: string;
|
||||||
|
|||||||
@ -10345,6 +10345,27 @@ _Default:_ `nodes`
|
|||||||
|
|
||||||
|===
|
|===
|
||||||
|
|
||||||
|
[discrete]
|
||||||
|
=== termsenum
|
||||||
|
*Stability:* beta
|
||||||
|
[source,ts]
|
||||||
|
----
|
||||||
|
client.termsenum({
|
||||||
|
index: string | string[],
|
||||||
|
body: object
|
||||||
|
})
|
||||||
|
----
|
||||||
|
link:{ref}/terms-enum.html[Documentation] +
|
||||||
|
[cols=2*]
|
||||||
|
|===
|
||||||
|
|`index`
|
||||||
|
|`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||||
|
|
||||||
|
|`body`
|
||||||
|
|`object` - field name, string which is the prefix expected in matching terms, timeout and size for max number of results
|
||||||
|
|
||||||
|
|===
|
||||||
|
|
||||||
[discrete]
|
[discrete]
|
||||||
=== termvectors
|
=== termvectors
|
||||||
|
|
||||||
|
|||||||
4
index.d.ts
vendored
4
index.d.ts
vendored
@ -2561,6 +2561,10 @@ declare class Client {
|
|||||||
list<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.TasksList, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
list<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.TasksList, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||||
list<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.TasksList, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
list<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.TasksList, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||||
}
|
}
|
||||||
|
termsenum<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Termsenum<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||||
|
termsenum<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||||
|
termsenum<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Termsenum<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||||
|
termsenum<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Termsenum<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||||
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Termvectors<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Termvectors<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||||
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||||
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Termvectors<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Termvectors<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||||
|
|||||||
Reference in New Issue
Block a user