Skip to content

Auto-generated code for main #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ python:
- path: .
extra_requirements:
- "docs"

sphinx:
configuration: docs/sphinx/conf.py
fail_on_warning: true
2,750 changes: 2,026 additions & 724 deletions elasticsearch_serverless/_async/client/__init__.py

Large diffs are not rendered by default.

75 changes: 45 additions & 30 deletions elasticsearch_serverless/_async/client/async_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ async def delete(
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Delete an async search. If the asynchronous search is still running, it is cancelled.
Otherwise, the saved search results are deleted. 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 `cancel_task` cluster privilege.
.. raw:: html

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
<p>Delete an async search.</p>
<p>If the asynchronous search is still running, it is cancelled.
Otherwise, the saved search results are deleted.
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>


`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit>`_

:param id: A unique identifier for the async search.
"""
Expand Down Expand Up @@ -85,16 +87,18 @@ async def get(
] = None,
) -> ObjectApiResponse[t.Any]:
"""
Get async search results. Retrieve the results of a previously submitted asynchronous
search request. 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.
.. raw:: html

<p>Get async search results.</p>
<p>Retrieve the results of a previously submitted asynchronous search request.
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>


`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit>`_

:param id: A unique identifier for the async search.
:param keep_alive: Specifies how long the async search should be available in
the cluster. When not specified, the `keep_alive` set with the corresponding
:param keep_alive: The length of time that the async search should be available
in the cluster. When not specified, the `keep_alive` set with the corresponding
submit async request will be used. Otherwise, it is possible to override
the value and extend the validity of the request. When this period expires,
the search, if still running, is cancelled. If the search is completed, its
Expand Down Expand Up @@ -149,15 +153,21 @@ async def status(
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Get the async search status. Get the status of a previously submitted async search
request given its identifier, without retrieving search results. If the Elasticsearch
security features are enabled, use of this API is restricted to the `monitoring_user`
role.
.. raw:: html

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
<p>Get the async search status.</p>
<p>Get the status of a previously submitted async search request given its identifier, without retrieving search results.
If the Elasticsearch security features are enabled, the access to the status of a specific async search is restricted to:</p>
<ul>
<li>The user or API key that submitted the original async search request.</li>
<li>Users that have the <code>monitor</code> cluster privilege or greater privileges.</li>
</ul>


`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit>`_

:param id: A unique identifier for the async search.
:param keep_alive: Specifies how long the async search needs to be available.
:param keep_alive: The length of time that the async search needs to be available.
Ongoing async searches and any saved search results are deleted after this
period.
"""
Expand Down Expand Up @@ -264,6 +274,7 @@ async def submit(
ignore_throttled: t.Optional[bool] = None,
ignore_unavailable: t.Optional[bool] = None,
indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None,
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
keep_on_completion: t.Optional[bool] = None,
knn: t.Optional[
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
Expand All @@ -287,7 +298,7 @@ async def submit(
runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
search_after: t.Optional[
t.Sequence[t.Union[None, bool, float, int, str, t.Any]]
t.Sequence[t.Union[None, bool, float, int, str]]
] = None,
search_type: t.Optional[
t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
Expand Down Expand Up @@ -325,17 +336,16 @@ async def submit(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Run an async search. 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. Warning: Asynchronous search does not support scroll or search requests
that include only the suggest section. 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. The maximum allowed size for a stored async search response
can be set by changing the `search.max_async_search_response_size` cluster level
setting.
.. raw:: html

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
<p>Run an async search.</p>
<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>
<p>Warning: Asynchronous search does not support scroll or search requests that include only the suggest section.</p>
<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.
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>


`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit>`_

:param index: A comma-separated list of index names to search; use `_all` or
empty string to perform the operation on all indices
Expand Down Expand Up @@ -378,6 +388,9 @@ async def submit(
:param ignore_unavailable: Whether specified concrete indices should be ignored
when unavailable (missing or closed)
:param indices_boost: Boosts the _score of documents from specified indices.
:param keep_alive: Specifies how long the async search needs to be available.
Ongoing async searches and any saved search results are deleted after this
period.
:param keep_on_completion: If `true`, results are stored for later retrieval
when the search completes within the `wait_for_completion_timeout`.
:param knn: Defines the approximate kNN search to run.
Expand Down Expand Up @@ -503,6 +516,8 @@ async def submit(
__query["ignore_throttled"] = ignore_throttled
if ignore_unavailable is not None:
__query["ignore_unavailable"] = ignore_unavailable
if keep_alive is not None:
__query["keep_alive"] = keep_alive
if keep_on_completion is not None:
__query["keep_on_completion"] = keep_on_completion
if lenient is not None:
Expand Down
Loading