Skip to content

Commit 613f559

Browse files
authored
Run code generation (#66)
1 parent f1e95a1 commit 613f559

36 files changed

+1138
-344
lines changed

elasticsearch_serverless/_async/client/__init__.py

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ async def bulk(
466466
] = None,
467467
) -> ObjectApiResponse[t.Any]:
468468
"""
469-
Allows to perform multiple index/update/delete operations in a single request.
469+
Performs multiple indexing or delete operations in a single API call. This reduces
470+
overhead and can greatly increase indexing speed.
470471
471472
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html>`_
472473
@@ -556,7 +557,7 @@ async def clear_scroll(
556557
body: t.Optional[t.Dict[str, t.Any]] = None,
557558
) -> ObjectApiResponse[t.Any]:
558559
"""
559-
Explicitly clears the search context for a scroll.
560+
Clears the search context and results for a scrolling search.
560561
561562
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-scroll-api.html>`_
562563
@@ -599,7 +600,7 @@ async def close_point_in_time(
599600
body: t.Optional[t.Dict[str, t.Any]] = None,
600601
) -> ObjectApiResponse[t.Any]:
601602
"""
602-
Close a point in time
603+
Closes a point-in-time.
603604
604605
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html>`_
605606
@@ -790,8 +791,9 @@ async def create(
790791
] = None,
791792
) -> ObjectApiResponse[t.Any]:
792793
"""
793-
Creates a new document in the index. Returns a 409 response when a document with
794-
a same ID already exists in the index.
794+
Adds a JSON document to the specified data stream or index and makes it searchable.
795+
If the target is an index and the document already exists, the request updates
796+
the document and increments its version.
795797
796798
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html>`_
797799
@@ -888,7 +890,7 @@ async def delete(
888890
] = None,
889891
) -> ObjectApiResponse[t.Any]:
890892
"""
891-
Removes a document from the index.
893+
Removes a JSON document from the specified index.
892894
893895
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html>`_
894896
@@ -1006,7 +1008,7 @@ async def delete_by_query(
10061008
body: t.Optional[t.Dict[str, t.Any]] = None,
10071009
) -> ObjectApiResponse[t.Any]:
10081010
"""
1009-
Deletes documents matching the provided query.
1011+
Deletes documents that match the specified query.
10101012
10111013
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html>`_
10121014
@@ -1180,7 +1182,7 @@ async def delete_script(
11801182
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
11811183
) -> ObjectApiResponse[t.Any]:
11821184
"""
1183-
Deletes a script.
1185+
Deletes a stored script or search template.
11841186
11851187
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
11861188
@@ -1242,7 +1244,7 @@ async def exists(
12421244
] = None,
12431245
) -> HeadApiResponse:
12441246
"""
1245-
Returns information about whether a document exists in an index.
1247+
Checks if a document in an index exists.
12461248
12471249
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_
12481250
@@ -1337,7 +1339,7 @@ async def exists_source(
13371339
] = None,
13381340
) -> HeadApiResponse:
13391341
"""
1340-
Returns information about whether a document source exists in an index.
1342+
Checks if a document's `_source` is stored.
13411343
13421344
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_
13431345
@@ -1431,7 +1433,8 @@ async def explain(
14311433
body: t.Optional[t.Dict[str, t.Any]] = None,
14321434
) -> ObjectApiResponse[t.Any]:
14331435
"""
1434-
Returns information about why a specific matches (or doesn't match) a query.
1436+
Returns information about why a specific document matches (or doesn’t match)
1437+
a query.
14351438
14361439
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html>`_
14371440
@@ -1543,7 +1546,10 @@ async def field_caps(
15431546
body: t.Optional[t.Dict[str, t.Any]] = None,
15441547
) -> ObjectApiResponse[t.Any]:
15451548
"""
1546-
Returns the information about the capabilities of fields among multiple indices.
1549+
The field capabilities API returns the information about the capabilities of
1550+
fields among multiple indices. The field capabilities API returns runtime fields
1551+
like any other field. For example, a runtime field with a type of keyword is
1552+
returned as any other field that belongs to the `keyword` family.
15471553
15481554
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html>`_
15491555
@@ -1735,7 +1741,7 @@ async def get_script(
17351741
pretty: t.Optional[bool] = None,
17361742
) -> ObjectApiResponse[t.Any]:
17371743
"""
1738-
Returns a script.
1744+
Retrieves a stored script or search template.
17391745
17401746
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
17411747
@@ -1887,7 +1893,9 @@ async def index(
18871893
] = None,
18881894
) -> ObjectApiResponse[t.Any]:
18891895
"""
1890-
Creates or updates a document in an index.
1896+
Adds a JSON document to the specified data stream or index and makes it searchable.
1897+
If the target is an index and the document already exists, the request updates
1898+
the document and increments its version.
18911899
18921900
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html>`_
18931901
@@ -2261,7 +2269,7 @@ async def msearch_template(
22612269
typed_keys: t.Optional[bool] = None,
22622270
) -> ObjectApiResponse[t.Any]:
22632271
"""
2264-
Allows to execute several search template operations in one request.
2272+
Runs multiple templated searches with a single request.
22652273
22662274
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html>`_
22672275
@@ -2445,7 +2453,13 @@ async def open_point_in_time(
24452453
routing: t.Optional[str] = None,
24462454
) -> ObjectApiResponse[t.Any]:
24472455
"""
2448-
Open a point in time that can be used in subsequent searches
2456+
A search request by default executes against the most recent visible data of
2457+
the target indices, which is called point in time. Elasticsearch pit (point in
2458+
time) is a lightweight view into the state of the data as it existed when initiated.
2459+
In some cases, it’s preferred to perform multiple search requests using the same
2460+
point in time. For example, if refreshes happen between `search_after` requests,
2461+
then the results of those requests might not be consistent as changes happening
2462+
between searches are only visible to the more recent point in time.
24492463
24502464
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html>`_
24512465
@@ -2511,7 +2525,7 @@ async def put_script(
25112525
body: t.Optional[t.Dict[str, t.Any]] = None,
25122526
) -> ObjectApiResponse[t.Any]:
25132527
"""
2514-
Creates or updates a script.
2528+
Creates or updates a stored script or search template.
25152529
25162530
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
25172531
@@ -2587,8 +2601,8 @@ async def rank_eval(
25872601
body: t.Optional[t.Dict[str, t.Any]] = None,
25882602
) -> ObjectApiResponse[t.Any]:
25892603
"""
2590-
Allows to evaluate the quality of ranked search results over a set of typical
2591-
search queries
2604+
Enables you to evaluate the quality of ranked search results over a set of typical
2605+
search queries.
25922606
25932607
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html>`_
25942608
@@ -2770,7 +2784,7 @@ async def render_search_template(
27702784
body: t.Optional[t.Dict[str, t.Any]] = None,
27712785
) -> ObjectApiResponse[t.Any]:
27722786
"""
2773-
Allows to use the Mustache language to pre-render a search definition.
2787+
Renders a search template as a search request body.
27742788
27752789
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/render-search-template-api.html>`_
27762790
@@ -2829,7 +2843,7 @@ async def scripts_painless_execute(
28292843
body: t.Optional[t.Dict[str, t.Any]] = None,
28302844
) -> ObjectApiResponse[t.Any]:
28312845
"""
2832-
Allows an arbitrary script to be executed and a result to be returned
2846+
Runs a script and returns a result.
28332847
28342848
`<https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html>`_
28352849
@@ -2939,6 +2953,7 @@ async def scroll(
29392953
"query",
29402954
"rank",
29412955
"rescore",
2956+
"retriever",
29422957
"runtime_mappings",
29432958
"script_fields",
29442959
"search_after",
@@ -3020,6 +3035,7 @@ async def search(
30203035
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
30213036
] = None,
30223037
rest_total_hits_as_int: t.Optional[bool] = None,
3038+
retriever: t.Optional[t.Mapping[str, t.Any]] = None,
30233039
routing: t.Optional[str] = None,
30243040
runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
30253041
script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
@@ -3060,7 +3076,9 @@ async def search(
30603076
body: t.Optional[t.Dict[str, t.Any]] = None,
30613077
) -> ObjectApiResponse[t.Any]:
30623078
"""
3063-
Returns results matching a query.
3079+
Returns search hits that match the query defined in the request. You can provide
3080+
search queries using the `q` query string parameter or the request body. If both
3081+
are specified, only the query parameter is used.
30643082
30653083
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html>`_
30663084
@@ -3179,6 +3197,9 @@ async def search(
31793197
example 100 - 500) documents returned by the `query` and `post_filter` phases.
31803198
:param rest_total_hits_as_int: Indicates whether `hits.total` should be rendered
31813199
as an integer or an object in the rest search response.
3200+
:param retriever: A retriever is a specification to describe top documents returned
3201+
from a search. A retriever replaces other elements of the search API that
3202+
also return top documents such as query and knn.
31823203
:param routing: Custom value used to route operations to a specific shard.
31833204
:param runtime_mappings: Defines one or more runtime fields in the search request.
31843205
These fields take precedence over mapped fields with the same name.
@@ -3372,6 +3393,8 @@ async def search(
33723393
__body["rank"] = rank
33733394
if rescore is not None:
33743395
__body["rescore"] = rescore
3396+
if retriever is not None:
3397+
__body["retriever"] = retriever
33753398
if runtime_mappings is not None:
33763399
__body["runtime_mappings"] = runtime_mappings
33773400
if script_fields is not None:
@@ -3625,7 +3648,7 @@ async def search_template(
36253648
body: t.Optional[t.Dict[str, t.Any]] = None,
36263649
) -> ObjectApiResponse[t.Any]:
36273650
"""
3628-
Allows to use the Mustache language to pre-render a search definition.
3651+
Runs a search with a search template.
36293652
36303653
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html>`_
36313654
@@ -4134,8 +4157,8 @@ async def update_by_query(
41344157
) -> ObjectApiResponse[t.Any]:
41354158
"""
41364159
Updates documents that match the specified query. If no query is specified, performs
4137-
an update on every document in the index without changing the source, for example
4138-
to pick up a mapping change.
4160+
an update on every document in the data stream or index without modifying the
4161+
source, which is useful for picking up mapping changes.
41394162
41404163
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html>`_
41414164

elasticsearch_serverless/_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
@@ -77,7 +80,9 @@ async def get(
7780
) -> ObjectApiResponse[t.Any]:
7881
"""
7982
Retrieves the results of a previously submitted async search request given its
80-
ID.
83+
identifier. If the Elasticsearch security features are enabled, access to the
84+
results of a specific async search is restricted to the user or API key that
85+
submitted it.
8186
8287
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
8388
@@ -131,8 +136,10 @@ async def status(
131136
pretty: t.Optional[bool] = None,
132137
) -> ObjectApiResponse[t.Any]:
133138
"""
134-
Retrieves the status of a previously submitted async search request given its
135-
ID.
139+
Get async search status Retrieves the status of a previously submitted async
140+
search request given its identifier, without retrieving search results. If the
141+
Elasticsearch security features are enabled, use of this API is restricted to
142+
the `monitoring_user` role.
136143
137144
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
138145
@@ -298,7 +305,15 @@ async def submit(
298305
body: t.Optional[t.Dict[str, t.Any]] = None,
299306
) -> ObjectApiResponse[t.Any]:
300307
"""
301-
Executes a search request asynchronously.
308+
Runs a search request asynchronously. When the primary sort of the results is
309+
an indexed field, shards get sorted based on minimum and maximum value that they
310+
hold for that field, hence partial results become available following the sort
311+
criteria that was requested. Warning: Async search does not support scroll nor
312+
search requests that only include the suggest section. By default, Elasticsearch
313+
doesn’t allow you to store an async search response larger than 10Mb and an attempt
314+
to do this results in an error. The maximum allowed size for a stored async search
315+
response can be set by changing the `search.max_async_search_response_size` cluster
316+
level setting.
302317
303318
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
304319

0 commit comments

Comments
 (0)