Skip to content

Commit bd4220e

Browse files
Auto-generated API code
1 parent cf55ab5 commit bd4220e

File tree

13 files changed

+458
-58
lines changed

13 files changed

+458
-58
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ async def bulk(
608608
<li>JavaScript: Check out <code>client.helpers.*</code></li>
609609
<li>.NET: Check out <code>BulkAllObservable</code></li>
610610
<li>PHP: Check out bulk indexing.</li>
611+
<li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
611612
</ul>
612613
<p><strong>Submitting bulk requests with cURL</strong></p>
613614
<p>If you're providing text file input to <code>curl</code>, you must use the <code>--data-binary</code> flag instead of plain <code>-d</code>.
@@ -1326,7 +1327,7 @@ async def delete(
13261327
)
13271328

13281329
@_rewrite_parameters(
1329-
body_fields=("max_docs", "query", "slice"),
1330+
body_fields=("max_docs", "query", "slice", "sort"),
13301331
parameter_aliases={"from": "from_"},
13311332
)
13321333
async def delete_by_query(
@@ -1370,7 +1371,12 @@ async def delete_by_query(
13701371
] = None,
13711372
slice: t.Optional[t.Mapping[str, t.Any]] = None,
13721373
slices: t.Optional[t.Union[int, t.Union[str, t.Literal["auto"]]]] = None,
1373-
sort: t.Optional[t.Sequence[str]] = None,
1374+
sort: t.Optional[
1375+
t.Union[
1376+
t.Sequence[t.Union[str, t.Mapping[str, t.Any]]],
1377+
t.Union[str, t.Mapping[str, t.Any]],
1378+
]
1379+
] = None,
13741380
stats: t.Optional[t.Sequence[str]] = None,
13751381
terminate_after: t.Optional[int] = None,
13761382
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -1502,7 +1508,7 @@ async def delete_by_query(
15021508
:param slice: Slice the request manually using the provided slice ID and total
15031509
number of slices.
15041510
:param slices: The number of slices this task should be divided into.
1505-
:param sort: A comma-separated list of `<field>:<direction>` pairs.
1511+
:param sort: A sort object that specifies the order of deleted documents.
15061512
:param stats: The specific `tag` of the request for logging and statistical purposes.
15071513
:param terminate_after: The maximum number of documents to collect for each shard.
15081514
If a query reaches this limit, Elasticsearch terminates the query early.
@@ -1592,8 +1598,6 @@ async def delete_by_query(
15921598
__query["search_type"] = search_type
15931599
if slices is not None:
15941600
__query["slices"] = slices
1595-
if sort is not None:
1596-
__query["sort"] = sort
15971601
if stats is not None:
15981602
__query["stats"] = stats
15991603
if terminate_after is not None:
@@ -1613,6 +1617,8 @@ async def delete_by_query(
16131617
__body["query"] = query
16141618
if slice is not None:
16151619
__body["slice"] = slice
1620+
if sort is not None:
1621+
__body["sort"] = sort
16161622
__headers = {"accept": "application/json", "content-type": "application/json"}
16171623
return await self.perform_request( # type: ignore[return-value]
16181624
"POST",
@@ -3870,6 +3876,13 @@ async def reindex(
38703876
In this case, the response includes a count of the version conflicts that were encountered.
38713877
Note that the handling of other error types is unaffected by the <code>conflicts</code> property.
38723878
Additionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than <code>max_docs</code> until it has successfully indexed <code>max_docs</code> documents into the target or it has gone through every document in the source query.</p>
3879+
<p>It's recommended to reindex on indices with a green status. Reindexing can fail when a node shuts down or crashes.</p>
3880+
<ul>
3881+
<li>When requested with <code>wait_for_completion=true</code> (default), the request fails if the node shuts down.</li>
3882+
<li>When requested with <code>wait_for_completion=false</code>, a task id is returned, for use with the task management APIs. The task may disappear or fail if the node shuts down.
3883+
When retrying a failed reindex operation, it might be necessary to set <code>conflicts=proceed</code> or to first delete the partial destination index.
3884+
Additionally, dry runs, checking disk space, and fetching index recovery information can help address the root cause.</li>
3885+
</ul>
38733886
<p>Refer to the linked documentation for examples of how to reindex documents.</p>
38743887
38753888
@@ -5649,7 +5662,7 @@ async def termvectors(
56495662
doc: t.Optional[t.Mapping[str, t.Any]] = None,
56505663
error_trace: t.Optional[bool] = None,
56515664
field_statistics: t.Optional[bool] = None,
5652-
fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
5665+
fields: t.Optional[t.Sequence[str]] = None,
56535666
filter: t.Optional[t.Mapping[str, t.Any]] = None,
56545667
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
56555668
human: t.Optional[bool] = None,

elasticsearch/_async/client/cat.py

Lines changed: 124 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,34 @@ async def aliases(
4747
] = None,
4848
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4949
format: t.Optional[str] = None,
50-
h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
50+
h: t.Optional[
51+
t.Union[
52+
t.Sequence[
53+
t.Union[
54+
str,
55+
t.Literal[
56+
"alias",
57+
"filter",
58+
"index",
59+
"is_write_index",
60+
"routing.index",
61+
"routing.search",
62+
],
63+
]
64+
],
65+
t.Union[
66+
str,
67+
t.Literal[
68+
"alias",
69+
"filter",
70+
"index",
71+
"is_write_index",
72+
"routing.index",
73+
"routing.search",
74+
],
75+
],
76+
]
77+
] = None,
5178
help: t.Optional[bool] = None,
5279
human: t.Optional[bool] = None,
5380
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -74,7 +101,8 @@ async def aliases(
74101
values, such as `open,hidden`.
75102
:param format: Specifies the format to return the columnar data in, can be set
76103
to `text`, `json`, `cbor`, `yaml`, or `smile`.
77-
:param h: List of columns to appear in the response. Supports simple wildcards.
104+
:param h: A comma-separated list of columns names to display. It supports simple
105+
wildcards.
78106
:param help: When set to `true` will output available columns. This option can't
79107
be combined with any other query string option.
80108
:param master_timeout: The period to wait for a connection to the master node.
@@ -137,7 +165,48 @@ async def allocation(
137165
error_trace: t.Optional[bool] = None,
138166
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
139167
format: t.Optional[str] = None,
140-
h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
168+
h: t.Optional[
169+
t.Union[
170+
t.Sequence[
171+
t.Union[
172+
str,
173+
t.Literal[
174+
"disk.avail",
175+
"disk.indices",
176+
"disk.indices.forecast",
177+
"disk.percent",
178+
"disk.total",
179+
"disk.used",
180+
"host",
181+
"ip",
182+
"node",
183+
"node.role",
184+
"shards",
185+
"shards.undesired",
186+
"write_load.forecast",
187+
],
188+
]
189+
],
190+
t.Union[
191+
str,
192+
t.Literal[
193+
"disk.avail",
194+
"disk.indices",
195+
"disk.indices.forecast",
196+
"disk.percent",
197+
"disk.total",
198+
"disk.used",
199+
"host",
200+
"ip",
201+
"node",
202+
"node.role",
203+
"shards",
204+
"shards.undesired",
205+
"write_load.forecast",
206+
],
207+
],
208+
]
209+
] = None,
141210
help: t.Optional[bool] = None,
142211
human: t.Optional[bool] = None,
143212
local: t.Optional[bool] = None,
@@ -161,7 +230,8 @@ async def allocation(
161230
:param bytes: The unit used to display byte values.
162231
:param format: Specifies the format to return the columnar data in, can be set
163232
to `text`, `json`, `cbor`, `yaml`, or `smile`.
164-
:param h: List of columns to appear in the response. Supports simple wildcards.
233+
:param h: A comma-separated list of columns names to display. It supports simple
234+
wildcards.
165235
:param help: When set to `true` will output available columns. This option can't
166236
be combined with any other query string option.
167237
:param local: If `true`, the request computes the list of selected nodes from
@@ -224,7 +294,36 @@ async def component_templates(
224294
error_trace: t.Optional[bool] = None,
225295
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
226296
format: t.Optional[str] = None,
227-
h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
297+
h: t.Optional[
298+
t.Union[
299+
t.Sequence[
300+
t.Union[
301+
str,
302+
t.Literal[
303+
"alias_count",
304+
"included_in",
305+
"mapping_count",
306+
"metadata_count",
307+
"name",
308+
"settings_count",
309+
"version",
310+
],
311+
]
312+
],
313+
t.Union[
314+
str,
315+
t.Literal[
316+
"alias_count",
317+
"included_in",
318+
"mapping_count",
319+
"metadata_count",
320+
"name",
321+
"settings_count",
322+
"version",
323+
],
324+
],
325+
]
326+
] = None,
228327
help: t.Optional[bool] = None,
229328
human: t.Optional[bool] = None,
230329
local: t.Optional[bool] = None,
@@ -249,7 +348,8 @@ async def component_templates(
249348
If it is omitted, all component templates are returned.
250349
:param format: Specifies the format to return the columnar data in, can be set
251350
to `text`, `json`, `cbor`, `yaml`, or `smile`.
252-
:param h: List of columns to appear in the response. Supports simple wildcards.
351+
:param h: A comma-separated list of columns names to display. It supports simple
352+
wildcards.
253353
:param help: When set to `true` will output available columns. This option can't
254354
be combined with any other query string option.
255355
:param local: If `true`, the request computes the list of selected nodes from
@@ -310,7 +410,12 @@ async def count(
310410
error_trace: t.Optional[bool] = None,
311411
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
312412
format: t.Optional[str] = None,
313-
h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
413+
h: t.Optional[
414+
t.Union[
415+
t.Sequence[t.Union[str, t.Literal["count", "epoch", "timestamp"]]],
416+
t.Union[str, t.Literal["count", "epoch", "timestamp"]],
417+
]
418+
] = None,
314419
help: t.Optional[bool] = None,
315420
human: t.Optional[bool] = None,
316421
pretty: t.Optional[bool] = None,
@@ -334,7 +439,8 @@ async def count(
334439
and indices, omit this parameter or use `*` or `_all`.
335440
:param format: Specifies the format to return the columnar data in, can be set
336441
to `text`, `json`, `cbor`, `yaml`, or `smile`.
337-
:param h: List of columns to appear in the response. Supports simple wildcards.
442+
:param h: A comma-separated list of columns names to display. It supports simple
443+
wildcards.
338444
:param help: When set to `true` will output available columns. This option can't
339445
be combined with any other query string option.
340446
:param s: List of columns that determine how the table should be sorted. Sorting
@@ -389,7 +495,14 @@ async def fielddata(
389495
error_trace: t.Optional[bool] = None,
390496
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
391497
format: t.Optional[str] = None,
392-
h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
498+
h: t.Optional[
499+
t.Union[
500+
t.Sequence[
501+
t.Union[str, t.Literal["field", "host", "id", "ip", "node", "size"]]
502+
],
503+
t.Union[str, t.Literal["field", "host", "id", "ip", "node", "size"]],
504+
]
505+
] = None,
393506
help: t.Optional[bool] = None,
394507
human: t.Optional[bool] = None,
395508
pretty: t.Optional[bool] = None,
@@ -412,7 +525,8 @@ async def fielddata(
412525
:param bytes: The unit used to display byte values.
413526
:param format: Specifies the format to return the columnar data in, can be set
414527
to `text`, `json`, `cbor`, `yaml`, or `smile`.
415-
:param h: List of columns to appear in the response. Supports simple wildcards.
528+
:param h: A comma-separated list of columns names to display. It supports simple
529+
wildcards.
416530
:param help: When set to `true` will output available columns. This option can't
417531
be combined with any other query string option.
418532
:param s: List of columns that determine how the table should be sorted. Sorting

elasticsearch/_async/client/esql.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class EsqlClient(NamespacedClient):
4444
async def async_query(
4545
self,
4646
*,
47-
query: t.Optional[str] = None,
47+
query: t.Optional[t.Union[str, "ESQLBase"]] = None,
4848
columnar: t.Optional[bool] = None,
4949
delimiter: t.Optional[str] = None,
5050
drop_null_columns: t.Optional[bool] = None,
@@ -99,7 +99,12 @@ async def async_query(
9999
which has the name of all the columns.
100100
:param filter: Specify a Query DSL query in the filter parameter to filter the
101101
set of documents that an ES|QL query runs on.
102-
:param format: A short version of the Accept header, for example `json` or `yaml`.
102+
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
103+
`tsv`, and `txt` formats will return results in a tabular format, excluding
104+
other metadata fields from the response. For async requests, nothing will
105+
be returned if the async query doesn't finish within the timeout. The query
106+
ID and running status are available in the `X-Elasticsearch-Async-Id` and
107+
`X-Elasticsearch-Async-Is-Running` HTTP headers of the response, respectively.
103108
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
104109
query, the response will include an extra `_clusters` object with information
105110
about the clusters that participated in the search along with info such as
@@ -151,7 +156,7 @@ async def async_query(
151156
__query["pretty"] = pretty
152157
if not __body:
153158
if query is not None:
154-
__body["query"] = query
159+
__body["query"] = str(query)
155160
if columnar is not None:
156161
__body["columnar"] = columnar
157162
if filter is not None:
@@ -389,7 +394,7 @@ async def async_query_stop(
389394
async def query(
390395
self,
391396
*,
392-
query: t.Optional[str] = None,
397+
query: t.Optional[t.Union[str, "ESQLBase"]] = None,
393398
columnar: t.Optional[bool] = None,
394399
delimiter: t.Optional[str] = None,
395400
drop_null_columns: t.Optional[bool] = None,
@@ -438,7 +443,9 @@ async def query(
438443
`all_columns` which has the name of all columns.
439444
:param filter: Specify a Query DSL query in the filter parameter to filter the
440445
set of documents that an ES|QL query runs on.
441-
:param format: A short version of the Accept header, e.g. json, yaml.
446+
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
447+
`tsv`, and `txt` formats will return results in a tabular format, excluding
448+
other metadata fields from the response.
442449
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
443450
query, the response will include an extra `_clusters` object with information
444451
about the clusters that participated in the search along with info such as
@@ -476,7 +483,7 @@ async def query(
476483
__query["pretty"] = pretty
477484
if not __body:
478485
if query is not None:
479-
__body["query"] = query
486+
__body["query"] = str(query)
480487
if columnar is not None:
481488
__body["columnar"] = columnar
482489
if filter is not None:

elasticsearch/_async/client/indices.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3715,7 +3715,7 @@ async def put_mapping(
37153715
<li>Change a field's mapping using reindexing</li>
37163716
<li>Rename a field using a field alias</li>
37173717
</ul>
3718-
<p>Learn how to use the update mapping API with practical examples in the <a href="https://www.elastic.co/docs//manage-data/data-store/mapping/update-mappings-examples">Update mapping API examples</a> guide.</p>
3718+
<p>Learn how to use the update mapping API with practical examples in the <a href="https://www.elastic.co/docs/manage-data/data-store/mapping/update-mappings-examples">Update mapping API examples</a> guide.</p>
37193719
37203720
37213721
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-mapping>`_
@@ -4587,7 +4587,7 @@ async def rollover(
45874587
.. raw:: html
45884588
45894589
<p>Roll over to a new index.
4590-
TIP: It is recommended to use the index lifecycle rollover action to automate rollovers.</p>
4590+
TIP: We recommend using the index lifecycle rollover action to automate rollovers. However, Serverless does not support Index Lifecycle Management (ILM), so don't use this approach in the Serverless context.</p>
45914591
<p>The rollover API creates a new index for a data stream or index alias.
45924592
The API behavior depends on the rollover target.</p>
45934593
<p><strong>Roll over a data stream</strong></p>

elasticsearch/_async/client/sql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ async def query(
283283
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
284284
keep_on_completion: t.Optional[bool] = None,
285285
page_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
286-
params: t.Optional[t.Mapping[str, t.Any]] = None,
286+
params: t.Optional[t.Sequence[t.Any]] = None,
287287
pretty: t.Optional[bool] = None,
288288
query: t.Optional[str] = None,
289289
request_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,

0 commit comments

Comments
 (0)