Skip to content

Commit

Permalink
Auto-generated code for main (#2589)
Browse files Browse the repository at this point in the history
* Apply one year of doc strings updates
* Allow sequences of job id, model id and tags where applicable in ML APIs
* Add dry_run and force parameter to the Perform inference API
  • Loading branch information
elasticmachine authored Jun 21, 2024
1 parent fe84712 commit 9656f83
Show file tree
Hide file tree
Showing 54 changed files with 1,664 additions and 572 deletions.
68 changes: 42 additions & 26 deletions elasticsearch/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,8 @@ async def bulk(
] = None,
) -> ObjectApiResponse[t.Any]:
"""
Allows to perform multiple index/update/delete operations in a single request.
Performs multiple indexing or delete operations in a single API call. This reduces
overhead and can greatly increase indexing speed.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html>`_
Expand Down Expand Up @@ -737,7 +738,7 @@ async def clear_scroll(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Explicitly clears the search context for a scroll.
Clears the search context and results for a scrolling search.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-scroll-api.html>`_
Expand Down Expand Up @@ -787,7 +788,7 @@ async def close_point_in_time(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Close a point in time
Closes a point-in-time.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html>`_
Expand Down Expand Up @@ -994,8 +995,9 @@ async def create(
] = None,
) -> ObjectApiResponse[t.Any]:
"""
Creates a new document in the index. Returns a 409 response when a document with
a same ID already exists in the index.
Adds a JSON document to the specified data stream or index and makes it searchable.
If the target is an index and the document already exists, the request updates
the document and increments its version.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html>`_
Expand Down Expand Up @@ -1099,7 +1101,7 @@ async def delete(
] = None,
) -> ObjectApiResponse[t.Any]:
"""
Removes a document from the index.
Removes a JSON document from the specified index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html>`_
Expand Down Expand Up @@ -1223,7 +1225,7 @@ async def delete_by_query(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Deletes documents matching the provided query.
Deletes documents that match the specified query.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html>`_
Expand Down Expand Up @@ -1449,7 +1451,7 @@ async def delete_script(
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Deletes a script.
Deletes a stored script or search template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
Expand Down Expand Up @@ -1517,7 +1519,7 @@ async def exists(
] = None,
) -> HeadApiResponse:
"""
Returns information about whether a document exists in an index.
Checks if a document in an index exists.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_
Expand Down Expand Up @@ -1618,7 +1620,7 @@ async def exists_source(
] = None,
) -> HeadApiResponse:
"""
Returns information about whether a document source exists in an index.
Checks if a document's `_source` is stored.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_
Expand Down Expand Up @@ -1718,7 +1720,8 @@ async def explain(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Returns information about why a specific matches (or doesn't match) a query.
Returns information about why a specific document matches (or doesn’t match)
a query.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html>`_
Expand Down Expand Up @@ -1837,7 +1840,10 @@ async def field_caps(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Returns the information about the capabilities of fields among multiple indices.
The field capabilities API returns the information about the capabilities of
fields among multiple indices. The field capabilities API returns runtime fields
like any other field. For example, a runtime field with a type of keyword is
returned as any other field that belongs to the `keyword` family.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html>`_
Expand Down Expand Up @@ -2044,7 +2050,7 @@ async def get_script(
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Returns a script.
Retrieves a stored script or search template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
Expand Down Expand Up @@ -2334,7 +2340,9 @@ async def index(
] = None,
) -> ObjectApiResponse[t.Any]:
"""
Creates or updates a document in an index.
Adds a JSON document to the specified data stream or index and makes it searchable.
If the target is an index and the document already exists, the request updates
the document and increments its version.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html>`_
Expand Down Expand Up @@ -2843,7 +2851,7 @@ async def msearch_template(
typed_keys: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Allows to execute several search template operations in one request.
Runs multiple templated searches with a single request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html>`_
Expand Down Expand Up @@ -3045,7 +3053,13 @@ async def open_point_in_time(
routing: t.Optional[str] = None,
) -> ObjectApiResponse[t.Any]:
"""
Open a point in time that can be used in subsequent searches
A search request by default executes against the most recent visible data of
the target indices, which is called point in time. Elasticsearch pit (point in
time) is a lightweight view into the state of the data as it existed when initiated.
In some cases, it’s preferred to perform multiple search requests using the same
point in time. For example, if refreshes happen between `search_after` requests,
then the results of those requests might not be consistent as changes happening
between searches are only visible to the more recent point in time.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html>`_
Expand Down Expand Up @@ -3117,7 +3131,7 @@ async def put_script(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Creates or updates a script.
Creates or updates a stored script or search template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
Expand Down Expand Up @@ -3202,8 +3216,8 @@ async def rank_eval(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Allows to evaluate the quality of ranked search results over a set of typical
search queries
Enables you to evaluate the quality of ranked search results over a set of typical
search queries.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html>`_
Expand Down Expand Up @@ -3395,7 +3409,7 @@ async def reindex_rethrottle(
requests_per_second: t.Optional[float] = None,
) -> ObjectApiResponse[t.Any]:
"""
Changes the number of requests per second for a particular Reindex operation.
Copies documents from a source to a destination.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html>`_
Expand Down Expand Up @@ -3446,7 +3460,7 @@ async def render_search_template(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Allows to use the Mustache language to pre-render a search definition.
Renders a search template as a search request body.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/render-search-template-api.html>`_
Expand Down Expand Up @@ -3514,7 +3528,7 @@ async def scripts_painless_execute(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Allows an arbitrary script to be executed and a result to be returned
Runs a script and returns a result.
`<https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html>`_
Expand Down Expand Up @@ -3761,7 +3775,9 @@ async def search(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Returns results matching a query.
Returns search hits that match the query defined in the request. You can provide
search queries using the `q` query string parameter or the request body. If both
are specified, only the query parameter is used.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html>`_
Expand Down Expand Up @@ -4439,7 +4455,7 @@ async def search_template(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Allows to use the Mustache language to pre-render a search definition.
Runs a search with a search template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html>`_
Expand Down Expand Up @@ -4980,8 +4996,8 @@ async def update_by_query(
) -> ObjectApiResponse[t.Any]:
"""
Updates documents that match the specified query. If no query is specified, performs
an update on every document in the index without changing the source, for example
to pick up a mapping change.
an update on every document in the data stream or index without modifying the
source, which is useful for picking up mapping changes.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html>`_
Expand Down
27 changes: 21 additions & 6 deletions elasticsearch/_async/client/async_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ async def delete(
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Deletes an async search by ID. If the search is still running, the search request
will be cancelled. Otherwise, the saved search results are deleted.
Deletes an async search by identifier. If the search is still running, the search
request will be 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.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
Expand Down Expand Up @@ -83,7 +86,9 @@ async def get(
) -> ObjectApiResponse[t.Any]:
"""
Retrieves the results of a previously submitted async search request given its
ID.
identifier. 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.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
Expand Down Expand Up @@ -143,8 +148,10 @@ async def status(
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Retrieves the status of a previously submitted async search request given its
ID.
Get async search status Retrieves 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.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
Expand Down Expand Up @@ -316,7 +323,15 @@ async def submit(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Executes a search request asynchronously.
Runs a search request asynchronously. 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, hence partial results become available following the sort
criteria that was requested. Warning: Async search does not support scroll nor
search requests that only include the suggest section. By default, Elasticsearch
doesn’t 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.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
Expand Down
Loading

0 comments on commit 9656f83

Please sign in to comment.