Skip to content

Commit 7d3941f

Browse files
Auto-generated code for 9.0 (#3030)
* Auto-generated API code * Added missing types --------- Co-authored-by: Miguel Grinberg <[email protected]>
1 parent 1ebbced commit 7d3941f

File tree

13 files changed

+1436
-90
lines changed

13 files changed

+1436
-90
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,

0 commit comments

Comments
 (0)