Skip to content

Commit 9656f83

Browse files
Auto-generated code for main (#2589)
* 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
1 parent fe84712 commit 9656f83

Some content is hidden

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

54 files changed

+1664
-572
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,8 @@ async def bulk(
638638
] = None,
639639
) -> ObjectApiResponse[t.Any]:
640640
"""
641-
Allows to perform multiple index/update/delete operations in a single request.
641+
Performs multiple indexing or delete operations in a single API call. This reduces
642+
overhead and can greatly increase indexing speed.
642643
643644
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html>`_
644645
@@ -737,7 +738,7 @@ async def clear_scroll(
737738
body: t.Optional[t.Dict[str, t.Any]] = None,
738739
) -> ObjectApiResponse[t.Any]:
739740
"""
740-
Explicitly clears the search context for a scroll.
741+
Clears the search context and results for a scrolling search.
741742
742743
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-scroll-api.html>`_
743744
@@ -787,7 +788,7 @@ async def close_point_in_time(
787788
body: t.Optional[t.Dict[str, t.Any]] = None,
788789
) -> ObjectApiResponse[t.Any]:
789790
"""
790-
Close a point in time
791+
Closes a point-in-time.
791792
792793
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html>`_
793794
@@ -994,8 +995,9 @@ async def create(
994995
] = None,
995996
) -> ObjectApiResponse[t.Any]:
996997
"""
997-
Creates a new document in the index. Returns a 409 response when a document with
998-
a same ID already exists in the index.
998+
Adds a JSON document to the specified data stream or index and makes it searchable.
999+
If the target is an index and the document already exists, the request updates
1000+
the document and increments its version.
9991001
10001002
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html>`_
10011003
@@ -1099,7 +1101,7 @@ async def delete(
10991101
] = None,
11001102
) -> ObjectApiResponse[t.Any]:
11011103
"""
1102-
Removes a document from the index.
1104+
Removes a JSON document from the specified index.
11031105
11041106
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html>`_
11051107
@@ -1223,7 +1225,7 @@ async def delete_by_query(
12231225
body: t.Optional[t.Dict[str, t.Any]] = None,
12241226
) -> ObjectApiResponse[t.Any]:
12251227
"""
1226-
Deletes documents matching the provided query.
1228+
Deletes documents that match the specified query.
12271229
12281230
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html>`_
12291231
@@ -1449,7 +1451,7 @@ async def delete_script(
14491451
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
14501452
) -> ObjectApiResponse[t.Any]:
14511453
"""
1452-
Deletes a script.
1454+
Deletes a stored script or search template.
14531455
14541456
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
14551457
@@ -1517,7 +1519,7 @@ async def exists(
15171519
] = None,
15181520
) -> HeadApiResponse:
15191521
"""
1520-
Returns information about whether a document exists in an index.
1522+
Checks if a document in an index exists.
15211523
15221524
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_
15231525
@@ -1618,7 +1620,7 @@ async def exists_source(
16181620
] = None,
16191621
) -> HeadApiResponse:
16201622
"""
1621-
Returns information about whether a document source exists in an index.
1623+
Checks if a document's `_source` is stored.
16221624
16231625
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_
16241626
@@ -1718,7 +1720,8 @@ async def explain(
17181720
body: t.Optional[t.Dict[str, t.Any]] = None,
17191721
) -> ObjectApiResponse[t.Any]:
17201722
"""
1721-
Returns information about why a specific matches (or doesn't match) a query.
1723+
Returns information about why a specific document matches (or doesn’t match)
1724+
a query.
17221725
17231726
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html>`_
17241727
@@ -1837,7 +1840,10 @@ async def field_caps(
18371840
body: t.Optional[t.Dict[str, t.Any]] = None,
18381841
) -> ObjectApiResponse[t.Any]:
18391842
"""
1840-
Returns the information about the capabilities of fields among multiple indices.
1843+
The field capabilities API returns the information about the capabilities of
1844+
fields among multiple indices. The field capabilities API returns runtime fields
1845+
like any other field. For example, a runtime field with a type of keyword is
1846+
returned as any other field that belongs to the `keyword` family.
18411847
18421848
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html>`_
18431849
@@ -2044,7 +2050,7 @@ async def get_script(
20442050
pretty: t.Optional[bool] = None,
20452051
) -> ObjectApiResponse[t.Any]:
20462052
"""
2047-
Returns a script.
2053+
Retrieves a stored script or search template.
20482054
20492055
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
20502056
@@ -2334,7 +2340,9 @@ async def index(
23342340
] = None,
23352341
) -> ObjectApiResponse[t.Any]:
23362342
"""
2337-
Creates or updates a document in an index.
2343+
Adds a JSON document to the specified data stream or index and makes it searchable.
2344+
If the target is an index and the document already exists, the request updates
2345+
the document and increments its version.
23382346
23392347
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html>`_
23402348
@@ -2843,7 +2851,7 @@ async def msearch_template(
28432851
typed_keys: t.Optional[bool] = None,
28442852
) -> ObjectApiResponse[t.Any]:
28452853
"""
2846-
Allows to execute several search template operations in one request.
2854+
Runs multiple templated searches with a single request.
28472855
28482856
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html>`_
28492857
@@ -3045,7 +3053,13 @@ async def open_point_in_time(
30453053
routing: t.Optional[str] = None,
30463054
) -> ObjectApiResponse[t.Any]:
30473055
"""
3048-
Open a point in time that can be used in subsequent searches
3056+
A search request by default executes against the most recent visible data of
3057+
the target indices, which is called point in time. Elasticsearch pit (point in
3058+
time) is a lightweight view into the state of the data as it existed when initiated.
3059+
In some cases, it’s preferred to perform multiple search requests using the same
3060+
point in time. For example, if refreshes happen between `search_after` requests,
3061+
then the results of those requests might not be consistent as changes happening
3062+
between searches are only visible to the more recent point in time.
30493063
30503064
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html>`_
30513065
@@ -3117,7 +3131,7 @@ async def put_script(
31173131
body: t.Optional[t.Dict[str, t.Any]] = None,
31183132
) -> ObjectApiResponse[t.Any]:
31193133
"""
3120-
Creates or updates a script.
3134+
Creates or updates a stored script or search template.
31213135
31223136
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
31233137
@@ -3202,8 +3216,8 @@ async def rank_eval(
32023216
body: t.Optional[t.Dict[str, t.Any]] = None,
32033217
) -> ObjectApiResponse[t.Any]:
32043218
"""
3205-
Allows to evaluate the quality of ranked search results over a set of typical
3206-
search queries
3219+
Enables you to evaluate the quality of ranked search results over a set of typical
3220+
search queries.
32073221
32083222
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html>`_
32093223
@@ -3395,7 +3409,7 @@ async def reindex_rethrottle(
33953409
requests_per_second: t.Optional[float] = None,
33963410
) -> ObjectApiResponse[t.Any]:
33973411
"""
3398-
Changes the number of requests per second for a particular Reindex operation.
3412+
Copies documents from a source to a destination.
33993413
34003414
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html>`_
34013415
@@ -3446,7 +3460,7 @@ async def render_search_template(
34463460
body: t.Optional[t.Dict[str, t.Any]] = None,
34473461
) -> ObjectApiResponse[t.Any]:
34483462
"""
3449-
Allows to use the Mustache language to pre-render a search definition.
3463+
Renders a search template as a search request body.
34503464
34513465
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/render-search-template-api.html>`_
34523466
@@ -3514,7 +3528,7 @@ async def scripts_painless_execute(
35143528
body: t.Optional[t.Dict[str, t.Any]] = None,
35153529
) -> ObjectApiResponse[t.Any]:
35163530
"""
3517-
Allows an arbitrary script to be executed and a result to be returned
3531+
Runs a script and returns a result.
35183532
35193533
`<https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html>`_
35203534
@@ -3761,7 +3775,9 @@ async def search(
37613775
body: t.Optional[t.Dict[str, t.Any]] = None,
37623776
) -> ObjectApiResponse[t.Any]:
37633777
"""
3764-
Returns results matching a query.
3778+
Returns search hits that match the query defined in the request. You can provide
3779+
search queries using the `q` query string parameter or the request body. If both
3780+
are specified, only the query parameter is used.
37653781
37663782
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html>`_
37673783
@@ -4439,7 +4455,7 @@ async def search_template(
44394455
body: t.Optional[t.Dict[str, t.Any]] = None,
44404456
) -> ObjectApiResponse[t.Any]:
44414457
"""
4442-
Allows to use the Mustache language to pre-render a search definition.
4458+
Runs a search with a search template.
44434459
44444460
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html>`_
44454461
@@ -4980,8 +4996,8 @@ async def update_by_query(
49804996
) -> ObjectApiResponse[t.Any]:
49814997
"""
49824998
Updates documents that match the specified query. If no query is specified, performs
4983-
an update on every document in the index without changing the source, for example
4984-
to pick up a mapping change.
4999+
an update on every document in the data stream or index without modifying the
5000+
source, which is useful for picking up mapping changes.
49855001
49865002
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html>`_
49875003

elasticsearch/_async/client/async_search.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ async def delete(
3636
pretty: t.Optional[bool] = None,
3737
) -> ObjectApiResponse[t.Any]:
3838
"""
39-
Deletes an async search by ID. If the search is still running, the search request
40-
will be cancelled. Otherwise, the saved search results are deleted.
39+
Deletes an async search by identifier. If the search is still running, the search
40+
request will be cancelled. Otherwise, the saved search results are deleted. If
41+
the Elasticsearch security features are enabled, the deletion of a specific async
42+
search is restricted to: the authenticated user that submitted the original search
43+
request; users that have the `cancel_task` cluster privilege.
4144
4245
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
4346
@@ -83,7 +86,9 @@ async def get(
8386
) -> ObjectApiResponse[t.Any]:
8487
"""
8588
Retrieves the results of a previously submitted async search request given its
86-
ID.
89+
identifier. If the Elasticsearch security features are enabled, access to the
90+
results of a specific async search is restricted to the user or API key that
91+
submitted it.
8792
8893
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
8994
@@ -143,8 +148,10 @@ async def status(
143148
pretty: t.Optional[bool] = None,
144149
) -> ObjectApiResponse[t.Any]:
145150
"""
146-
Retrieves the status of a previously submitted async search request given its
147-
ID.
151+
Get async search status Retrieves the status of a previously submitted async
152+
search request given its identifier, without retrieving search results. If the
153+
Elasticsearch security features are enabled, use of this API is restricted to
154+
the `monitoring_user` role.
148155
149156
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
150157
@@ -316,7 +323,15 @@ async def submit(
316323
body: t.Optional[t.Dict[str, t.Any]] = None,
317324
) -> ObjectApiResponse[t.Any]:
318325
"""
319-
Executes a search request asynchronously.
326+
Runs a search request asynchronously. When the primary sort of the results is
327+
an indexed field, shards get sorted based on minimum and maximum value that they
328+
hold for that field, hence partial results become available following the sort
329+
criteria that was requested. Warning: Async search does not support scroll nor
330+
search requests that only include the suggest section. By default, Elasticsearch
331+
doesn’t allow you to store an async search response larger than 10Mb and an attempt
332+
to do this results in an error. The maximum allowed size for a stored async search
333+
response can be set by changing the `search.max_async_search_response_size` cluster
334+
level setting.
320335
321336
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
322337

0 commit comments

Comments
 (0)