Skip to content

Commit ca8bcad

Browse files
Auto-generated API code
1 parent 7310c34 commit ca8bcad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+7862
-3696
lines changed

elasticsearch_serverless/_async/client/__init__.py

+2,026-724
Large diffs are not rendered by default.

elasticsearch_serverless/_async/client/async_search.py

+45-30
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ async def delete(
3636
pretty: t.Optional[bool] = None,
3737
) -> ObjectApiResponse[t.Any]:
3838
"""
39-
Delete an async search. If the asynchronous search is still running, it is cancelled.
40-
Otherwise, the saved search results are deleted. If the Elasticsearch security
41-
features are enabled, the deletion of a specific async search is restricted to:
42-
the authenticated user that submitted the original search request; users that
43-
have the `cancel_task` cluster privilege.
39+
.. raw:: html
4440
45-
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
41+
<p>Delete an async search.</p>
42+
<p>If the asynchronous search is still running, it is cancelled.
43+
Otherwise, the saved search results are deleted.
44+
If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the <code>cancel_task</code> cluster privilege.</p>
45+
46+
47+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit>`_
4648
4749
:param id: A unique identifier for the async search.
4850
"""
@@ -85,16 +87,18 @@ async def get(
8587
] = None,
8688
) -> ObjectApiResponse[t.Any]:
8789
"""
88-
Get async search results. Retrieve the results of a previously submitted asynchronous
89-
search request. If the Elasticsearch security features are enabled, access to
90-
the results of a specific async search is restricted to the user or API key that
91-
submitted it.
90+
.. raw:: html
91+
92+
<p>Get async search results.</p>
93+
<p>Retrieve the results of a previously submitted asynchronous search request.
94+
If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it.</p>
95+
9296
93-
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
97+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit>`_
9498
9599
:param id: A unique identifier for the async search.
96-
:param keep_alive: Specifies how long the async search should be available in
97-
the cluster. When not specified, the `keep_alive` set with the corresponding
100+
:param keep_alive: The length of time that the async search should be available
101+
in the cluster. When not specified, the `keep_alive` set with the corresponding
98102
submit async request will be used. Otherwise, it is possible to override
99103
the value and extend the validity of the request. When this period expires,
100104
the search, if still running, is cancelled. If the search is completed, its
@@ -149,15 +153,21 @@ async def status(
149153
pretty: t.Optional[bool] = None,
150154
) -> ObjectApiResponse[t.Any]:
151155
"""
152-
Get the async search status. Get the status of a previously submitted async search
153-
request given its identifier, without retrieving search results. If the Elasticsearch
154-
security features are enabled, use of this API is restricted to the `monitoring_user`
155-
role.
156+
.. raw:: html
156157
157-
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
158+
<p>Get the async search status.</p>
159+
<p>Get the status of a previously submitted async search request given its identifier, without retrieving search results.
160+
If the Elasticsearch security features are enabled, the access to the status of a specific async search is restricted to:</p>
161+
<ul>
162+
<li>The user or API key that submitted the original async search request.</li>
163+
<li>Users that have the <code>monitor</code> cluster privilege or greater privileges.</li>
164+
</ul>
165+
166+
167+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit>`_
158168
159169
:param id: A unique identifier for the async search.
160-
:param keep_alive: Specifies how long the async search needs to be available.
170+
:param keep_alive: The length of time that the async search needs to be available.
161171
Ongoing async searches and any saved search results are deleted after this
162172
period.
163173
"""
@@ -264,6 +274,7 @@ async def submit(
264274
ignore_throttled: t.Optional[bool] = None,
265275
ignore_unavailable: t.Optional[bool] = None,
266276
indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None,
277+
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
267278
keep_on_completion: t.Optional[bool] = None,
268279
knn: t.Optional[
269280
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
@@ -287,7 +298,7 @@ async def submit(
287298
runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
288299
script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
289300
search_after: t.Optional[
290-
t.Sequence[t.Union[None, bool, float, int, str, t.Any]]
301+
t.Sequence[t.Union[None, bool, float, int, str]]
291302
] = None,
292303
search_type: t.Optional[
293304
t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
@@ -325,17 +336,16 @@ async def submit(
325336
body: t.Optional[t.Dict[str, t.Any]] = None,
326337
) -> ObjectApiResponse[t.Any]:
327338
"""
328-
Run an async search. When the primary sort of the results is an indexed field,
329-
shards get sorted based on minimum and maximum value that they hold for that
330-
field. Partial results become available following the sort criteria that was
331-
requested. Warning: Asynchronous search does not support scroll or search requests
332-
that include only the suggest section. By default, Elasticsearch does not allow
333-
you to store an async search response larger than 10Mb and an attempt to do this
334-
results in an error. The maximum allowed size for a stored async search response
335-
can be set by changing the `search.max_async_search_response_size` cluster level
336-
setting.
339+
.. raw:: html
337340
338-
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
341+
<p>Run an async search.</p>
342+
<p>When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field. Partial results become available following the sort criteria that was requested.</p>
343+
<p>Warning: Asynchronous search does not support scroll or search requests that include only the suggest section.</p>
344+
<p>By default, Elasticsearch does not allow you to store an async search response larger than 10Mb and an attempt to do this results in an error.
345+
The maximum allowed size for a stored async search response can be set by changing the <code>search.max_async_search_response_size</code> cluster level setting.</p>
346+
347+
348+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit>`_
339349
340350
:param index: A comma-separated list of index names to search; use `_all` or
341351
empty string to perform the operation on all indices
@@ -378,6 +388,9 @@ async def submit(
378388
:param ignore_unavailable: Whether specified concrete indices should be ignored
379389
when unavailable (missing or closed)
380390
:param indices_boost: Boosts the _score of documents from specified indices.
391+
:param keep_alive: Specifies how long the async search needs to be available.
392+
Ongoing async searches and any saved search results are deleted after this
393+
period.
381394
:param keep_on_completion: If `true`, results are stored for later retrieval
382395
when the search completes within the `wait_for_completion_timeout`.
383396
:param knn: Defines the approximate kNN search to run.
@@ -503,6 +516,8 @@ async def submit(
503516
__query["ignore_throttled"] = ignore_throttled
504517
if ignore_unavailable is not None:
505518
__query["ignore_unavailable"] = ignore_unavailable
519+
if keep_alive is not None:
520+
__query["keep_alive"] = keep_alive
506521
if keep_on_completion is not None:
507522
__query["keep_on_completion"] = keep_on_completion
508523
if lenient is not None:

0 commit comments

Comments
 (0)