Skip to content

Commit ad975f6

Browse files
[DOCS] Adds description to global APIs part 2 (#2270)
Co-authored-by: Abdon Pijpelink <[email protected]>
1 parent 2bb669c commit ad975f6

File tree

13 files changed

+605
-115
lines changed

13 files changed

+605
-115
lines changed

output/schema/schema.json

Lines changed: 168 additions & 114 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_global/create/CreateRequest.ts

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,66 @@ import {
3030
import { Duration } from '@_types/Time'
3131

3232
/**
33+
* Adds a JSON document to the specified data stream or index and makes it searchable.
34+
* If the target is an index and the document already exists, the request updates the document and increments its version.
3335
* @rest_spec_name create
3436
* @availability stack since=5.0.0 stability=stable
3537
* @availability serverless stability=stable visibility=public
3638
*
3739
*/
3840
export interface Request<TDocument> extends RequestBase {
3941
path_parts: {
42+
/**
43+
* Unique identifier for the document.
44+
*/
4045
id: Id
46+
/**
47+
* Name of the data stream or index to target.
48+
* If the target doesn’t exist and matches the name or wildcard (`*`) pattern of an index template with a `data_stream` definition, this request creates the data stream.
49+
* If the target doesn’t exist and doesn’t match a data stream template, this request creates the index.
50+
*/
4151
index: IndexName
4252
}
4353
query_parameters: {
54+
/**
55+
* ID of the pipeline to use to preprocess incoming documents.
56+
* If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.
57+
* If a final pipeline is configured it will always run, regardless of the value of this parameter.
58+
*/
4459
pipeline?: string
60+
/**
61+
* If `true`, Elasticsearch refreshes 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` do nothing with refreshes.
62+
* Valid values: `true`, `false`, `wait_for`.
63+
* @server_default false
64+
*/
4565
refresh?: Refresh
66+
/**
67+
* Custom value used to route operations to a specific shard.
68+
*/
4669
routing?: Routing
70+
/**
71+
* Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.
72+
* @server_default 1m
73+
*/
4774
timeout?: Duration
75+
/**
76+
* Explicit version number for concurrency control.
77+
* The specified version must match the current version of the document for the request to succeed.
78+
*/
4879
version?: VersionNumber
80+
/**
81+
* Specific version type: `external`, `external_gte`.
82+
*/
4983
version_type?: VersionType
84+
/**
85+
* The number of shard copies that must be active before proceeding with the operation.
86+
* Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).
87+
* @server_default 1
88+
*/
5089
wait_for_active_shards?: WaitForActiveShards
5190
}
52-
/** @codegen_name document */
91+
/**
92+
* Request body contains the JSON source for the document data.
93+
* @codegen_name document */
5394
body?: TDocument
5495
}

specification/_global/delete/DeleteRequest.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,60 @@ import { long } from '@_types/Numeric'
3232
import { Duration } from '@_types/Time'
3333

3434
/**
35+
* Removes a JSON document from the specified index.
3536
* @rest_spec_name delete
3637
* @availability stack since=0.0.0 stability=stable
3738
* @availability serverless stability=stable visibility=public
3839
*/
3940
export interface Request extends RequestBase {
4041
path_parts: {
42+
/**
43+
* Unique identifier for the document.
44+
*/
4145
id: Id
46+
/**
47+
* Name of the target index.
48+
*/
4249
index: IndexName
4350
}
4451
query_parameters: {
52+
/**
53+
* Only perform the operation if the document has this primary term.
54+
*/
4555
if_primary_term?: long
56+
/**
57+
* Only perform the operation if the document has this sequence number.
58+
*/
4659
if_seq_no?: SequenceNumber
60+
/**
61+
* If `true`, Elasticsearch refreshes 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` do nothing with refreshes.
62+
* Valid values: `true`, `false`, `wait_for`.
63+
* @server_default false
64+
*/
4765
refresh?: Refresh
66+
/**
67+
* Custom value used to route operations to a specific shard.
68+
*/
4869
routing?: Routing
70+
/**
71+
* Period to wait for active shards.
72+
* @server_default 1m
73+
*/
4974
timeout?: Duration
75+
/**
76+
* Explicit version number for concurrency control.
77+
* The specified version must match the current version of the document for the request to succeed.
78+
*/
5079
version?: VersionNumber
80+
/**
81+
* Specific version type: `external`, `external_gte`.
82+
*/
5183
version_type?: VersionType
84+
/**
85+
* The number of shard copies that must be active before proceeding with the operation.
86+
* Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).
87+
* @server_default 1
88+
*/
5289
wait_for_active_shards?: WaitForActiveShards
5390
}
5491
}

specification/_global/delete_by_query/DeleteByQueryRequest.ts

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,48 +34,176 @@ import { Duration } from '@_types/Time'
3434
import { Operator } from '@_types/query_dsl/Operator'
3535

3636
/**
37+
* Deletes documents that match the specified query.
3738
* @rest_spec_name delete_by_query
3839
* @availability stack since=5.0.0 stability=stable
3940
* @availability serverless stability=stable visibility=public
4041
*/
4142
export interface Request extends RequestBase {
4243
path_parts: {
44+
/**
45+
* Comma-separated list of data streams, indices, and aliases to search.
46+
* Supports wildcards (`*`).
47+
* To search all data streams or indices, omit this parameter or use `*` or `_all`.
48+
*/
4349
index: Indices
4450
}
4551
query_parameters: {
52+
/**
53+
* If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.
54+
* This behavior applies even if the request targets other open indices.
55+
* For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.
56+
* @server_default true
57+
*/
4658
allow_no_indices?: boolean
59+
/**
60+
* Analyzer to use for the query string.
61+
*/
4762
analyzer?: string
63+
/**
64+
* If `true`, wildcard and prefix queries are analyzed.
65+
* @server_default false
66+
*/
4867
analyze_wildcard?: boolean
68+
/**
69+
* What to do if delete by query hits version conflicts: `abort` or `proceed`.
70+
* @server_default abort
71+
*/
4972
conflicts?: Conflicts
73+
/**
74+
* The default operator for query string query: `AND` or `OR`.
75+
* @server_default OR
76+
*/
5077
default_operator?: Operator
78+
/**
79+
* Field to use as default where no field prefix is given in the query string.
80+
*/
5181
df?: string
82+
/**
83+
* Type of index that wildcard patterns can match.
84+
* If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
85+
* Supports comma-separated values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
86+
* @server_default open
87+
*/
5288
expand_wildcards?: ExpandWildcards
5389
from?: long
90+
/**
91+
* If `false`, the request returns an error if it targets a missing or closed index.
92+
* @server_default false
93+
*/
5494
ignore_unavailable?: boolean
95+
/**
96+
* If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
97+
* @server_default false
98+
*/
5599
lenient?: boolean
100+
/**
101+
* Maximum number of documents to process.
102+
* Defaults to all documents.
103+
*/
56104
max_docs?: long
105+
/**
106+
* Specifies the node or shard the operation should be performed on.
107+
* Random by default.
108+
*/
57109
preference?: string
110+
/**
111+
* If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes.
112+
* @server_default false
113+
*/
58114
refresh?: boolean
115+
/**
116+
* If `true`, the request cache is used for this request.
117+
* Defaults to the index-level setting.
118+
*/
59119
request_cache?: boolean
120+
/**
121+
* The throttle for this request in sub-requests per second.
122+
*/
60123
requests_per_second?: float
124+
/**
125+
* Custom value used to route operations to a specific shard.
126+
*/
61127
routing?: Routing
128+
/**
129+
* Query in the Lucene query string syntax.
130+
*/
62131
q?: string
132+
/**
133+
* Period to retain the search context for scrolling.
134+
*/
63135
scroll?: Duration
136+
/**
137+
* Size of the scroll request that powers the operation.
138+
* @server_default 1000
139+
*/
64140
scroll_size?: long
141+
/**
142+
* Explicit timeout for each search request.
143+
* Defaults to no timeout.
144+
*/
65145
search_timeout?: Duration
146+
/**
147+
* The type of the search operation.
148+
* Available options: `query_then_fetch`, `dfs_query_then_fetch`.
149+
*/
66150
search_type?: SearchType
151+
/**
152+
* The number of slices this task should be divided into.
153+
* @server_default 1
154+
*/
67155
slices?: Slices
156+
/**
157+
* A comma-separated list of <field>:<direction> pairs.
158+
*/
68159
sort?: string[]
160+
/**
161+
* Specific `tag` of the request for logging and statistical purposes.
162+
*/
69163
stats?: string[]
164+
/**
165+
* Maximum number of documents to collect for each shard.
166+
* If a query reaches this limit, Elasticsearch terminates the query early.
167+
* Elasticsearch collects documents before sorting.
168+
* Use with caution.
169+
* Elasticsearch applies this parameter to each shard handling the request.
170+
* When possible, let Elasticsearch perform early termination automatically.
171+
* Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
172+
*/
70173
terminate_after?: long
174+
/**
175+
* Period each deletion request waits for active shards.
176+
* @server_default 1m
177+
*/
71178
timeout?: Duration
179+
/**
180+
* If `true`, returns the document version as part of a hit.
181+
*/
72182
version?: boolean
183+
/**
184+
* The number of shard copies that must be active before proceeding with the operation.
185+
* Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).
186+
* @server_default 1
187+
*/
73188
wait_for_active_shards?: WaitForActiveShards
189+
/**
190+
* If `true`, the request blocks until the operation is complete.
191+
* @server_default true
192+
*/
74193
wait_for_completion?: boolean
75194
}
76195
body: {
196+
/**
197+
* The maximum number of documents to delete.
198+
*/
77199
max_docs?: long
200+
/**
201+
* Specifies the documents to delete using the Query DSL.
202+
*/
78203
query?: QueryContainer
204+
/**
205+
* Slice the request manually using the provided slice ID and total number of slices.
206+
*/
79207
slice?: SlicedScroll
80208
}
81209
}

specification/_global/delete_by_query_rethrottle/DeleteByQueryRethrottleRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ import { float } from '@_types/Numeric'
2727
*/
2828
export interface Request extends RequestBase {
2929
path_parts: {
30+
/**
31+
* The ID for the task.
32+
*/
3033
task_id: TaskId
3134
}
3235
query_parameters: {
36+
/**
37+
* The throttle for this request in sub-requests per second.
38+
*/
3339
requests_per_second?: float
3440
}
3541
}

specification/_global/delete_script/DeleteScriptRequest.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,30 @@ import { Id } from '@_types/common'
2222
import { Duration } from '@_types/Time'
2323

2424
/**
25+
* Deletes a stored script or search template.
2526
* @rest_spec_name delete_script
2627
* @availability stack since=0.0.0 stability=stable
2728
* @availability serverless stability=stable visibility=public
2829
*/
2930
export interface Request extends RequestBase {
3031
path_parts: {
32+
/**
33+
* Identifier for the stored script or search template.
34+
*/
3135
id: Id
3236
}
3337
query_parameters: {
38+
/**
39+
* Period to wait for a connection to the master node.
40+
* If no response is received before the timeout expires, the request fails and returns an error.
41+
* @server_default 30s
42+
*/
3443
master_timeout?: Duration
44+
/**
45+
* Period to wait for a response.
46+
* If no response is received before the timeout expires, the request fails and returns an error.
47+
* @server_default 30s
48+
*/
3549
timeout?: Duration
3650
}
3751
}

specification/_global/get_script/GetScriptRequest.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ import { Id } from '@_types/common'
2222
import { Duration } from '@_types/Time'
2323

2424
/**
25+
* Retrieves a stored script or search template.
2526
* @rest_spec_name get_script
2627
* @availability stack since=0.0.0 stability=stable
2728
* @availability serverless stability=stable visibility=public
2829
*/
2930
export interface Request extends RequestBase {
3031
path_parts: {
32+
/**
33+
* Identifier for the stored script or search template.
34+
*/
3135
id: Id
3236
}
3337
query_parameters: {

0 commit comments

Comments
 (0)