Skip to content

Commit 8d594d4

Browse files
Auto-generated code for main (#82)
Auto-generated API code Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
1 parent 9f1e03c commit 8d594d4

22 files changed

+544
-392
lines changed

elasticsearch_serverless/_async/client/__init__.py

+41-2
Original file line numberDiff line numberDiff line change
@@ -2271,6 +2271,7 @@ async def msearch(
22712271
human: t.Optional[bool] = None,
22722272
ignore_throttled: t.Optional[bool] = None,
22732273
ignore_unavailable: t.Optional[bool] = None,
2274+
include_named_queries_score: t.Optional[bool] = None,
22742275
max_concurrent_searches: t.Optional[int] = None,
22752276
max_concurrent_shard_requests: t.Optional[int] = None,
22762277
pre_filter_shard_size: t.Optional[int] = None,
@@ -2304,6 +2305,13 @@ async def msearch(
23042305
when frozen.
23052306
:param ignore_unavailable: If true, missing or closed indices are not included
23062307
in the response.
2308+
:param include_named_queries_score: Indicates whether hit.matched_queries should
2309+
be rendered as a map that includes the name of the matched query associated
2310+
with its score (true) or as an array containing the name of the matched queries
2311+
(false) This functionality reruns each named query on every hit in a search
2312+
response. Typically, this adds a small overhead to a request. However, using
2313+
computationally expensive named queries on a large number of hits may add
2314+
significant overhead.
23072315
:param max_concurrent_searches: Maximum number of concurrent searches the multi
23082316
search API can execute.
23092317
:param max_concurrent_shard_requests: Maximum number of concurrent shard requests
@@ -2353,6 +2361,8 @@ async def msearch(
23532361
__query["ignore_throttled"] = ignore_throttled
23542362
if ignore_unavailable is not None:
23552363
__query["ignore_unavailable"] = ignore_unavailable
2364+
if include_named_queries_score is not None:
2365+
__query["include_named_queries_score"] = include_named_queries_score
23562366
if max_concurrent_searches is not None:
23572367
__query["max_concurrent_searches"] = max_concurrent_searches
23582368
if max_concurrent_shard_requests is not None:
@@ -2585,7 +2595,9 @@ async def mtermvectors(
25852595
path_parts=__path_parts,
25862596
)
25872597

2588-
@_rewrite_parameters()
2598+
@_rewrite_parameters(
2599+
body_fields=("index_filter",),
2600+
)
25892601
async def open_point_in_time(
25902602
self,
25912603
*,
@@ -2603,9 +2615,11 @@ async def open_point_in_time(
26032615
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
26042616
human: t.Optional[bool] = None,
26052617
ignore_unavailable: t.Optional[bool] = None,
2618+
index_filter: t.Optional[t.Mapping[str, t.Any]] = None,
26062619
preference: t.Optional[str] = None,
26072620
pretty: t.Optional[bool] = None,
26082621
routing: t.Optional[str] = None,
2622+
body: t.Optional[t.Dict[str, t.Any]] = None,
26092623
) -> ObjectApiResponse[t.Any]:
26102624
"""
26112625
A search request by default executes against the most recent visible data of
@@ -2627,17 +2641,20 @@ async def open_point_in_time(
26272641
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
26282642
:param ignore_unavailable: If `false`, the request returns an error if it targets
26292643
a missing or closed index.
2644+
:param index_filter: Allows to filter indices if the provided query rewrites
2645+
to `match_none` on every shard.
26302646
:param preference: Specifies the node or shard the operation should be performed
26312647
on. Random by default.
26322648
:param routing: Custom value used to route operations to a specific shard.
26332649
"""
26342650
if index in SKIP_IN_PATH:
26352651
raise ValueError("Empty value passed for parameter 'index'")
2636-
if keep_alive is None:
2652+
if keep_alive is None and body is None:
26372653
raise ValueError("Empty value passed for parameter 'keep_alive'")
26382654
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
26392655
__path = f'/{__path_parts["index"]}/_pit'
26402656
__query: t.Dict[str, t.Any] = {}
2657+
__body: t.Dict[str, t.Any] = body if body is not None else {}
26412658
if keep_alive is not None:
26422659
__query["keep_alive"] = keep_alive
26432660
if error_trace is not None:
@@ -2656,12 +2673,20 @@ async def open_point_in_time(
26562673
__query["pretty"] = pretty
26572674
if routing is not None:
26582675
__query["routing"] = routing
2676+
if not __body:
2677+
if index_filter is not None:
2678+
__body["index_filter"] = index_filter
2679+
if not __body:
2680+
__body = None # type: ignore[assignment]
26592681
__headers = {"accept": "application/json"}
2682+
if __body is not None:
2683+
__headers["content-type"] = "application/json"
26602684
return await self.perform_request( # type: ignore[return-value]
26612685
"POST",
26622686
__path,
26632687
params=__query,
26642688
headers=__headers,
2689+
body=__body,
26652690
endpoint_id="open_point_in_time",
26662691
path_parts=__path_parts,
26672692
)
@@ -3221,6 +3246,7 @@ async def search(
32213246
human: t.Optional[bool] = None,
32223247
ignore_throttled: t.Optional[bool] = None,
32233248
ignore_unavailable: t.Optional[bool] = None,
3249+
include_named_queries_score: t.Optional[bool] = None,
32243250
indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None,
32253251
knn: t.Optional[
32263252
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
@@ -3348,6 +3374,13 @@ async def search(
33483374
be ignored when frozen.
33493375
:param ignore_unavailable: If `false`, the request returns an error if it targets
33503376
a missing or closed index.
3377+
:param include_named_queries_score: Indicates whether hit.matched_queries should
3378+
be rendered as a map that includes the name of the matched query associated
3379+
with its score (true) or as an array containing the name of the matched queries
3380+
(false) This functionality reruns each named query on every hit in a search
3381+
response. Typically, this adds a small overhead to a request. However, using
3382+
computationally expensive named queries on a large number of hits may add
3383+
significant overhead.
33513384
:param indices_boost: Boosts the _score of documents from specified indices.
33523385
:param knn: Defines the approximate kNN search to run.
33533386
:param lenient: If `true`, format-based query failures (such as providing text
@@ -3529,6 +3562,8 @@ async def search(
35293562
__query["ignore_throttled"] = ignore_throttled
35303563
if ignore_unavailable is not None:
35313564
__query["ignore_unavailable"] = ignore_unavailable
3565+
if include_named_queries_score is not None:
3566+
__query["include_named_queries_score"] = include_named_queries_score
35323567
if lenient is not None:
35333568
__query["lenient"] = lenient
35343569
if max_concurrent_shard_requests is not None:
@@ -4389,6 +4424,7 @@ async def update_by_query(
43894424
pipeline: t.Optional[str] = None,
43904425
preference: t.Optional[str] = None,
43914426
pretty: t.Optional[bool] = None,
4427+
q: t.Optional[str] = None,
43924428
query: t.Optional[t.Mapping[str, t.Any]] = None,
43934429
refresh: t.Optional[bool] = None,
43944430
request_cache: t.Optional[bool] = None,
@@ -4455,6 +4491,7 @@ async def update_by_query(
44554491
parameter.
44564492
:param preference: Specifies the node or shard the operation should be performed
44574493
on. Random by default.
4494+
:param q: Query in the Lucene query string syntax.
44584495
:param query: Specifies the documents to update using the Query DSL.
44594496
:param refresh: If `true`, Elasticsearch refreshes affected shards to make the
44604497
operation visible to search.
@@ -4539,6 +4576,8 @@ async def update_by_query(
45394576
__query["preference"] = preference
45404577
if pretty is not None:
45414578
__query["pretty"] = pretty
4579+
if q is not None:
4580+
__query["q"] = q
45424581
if refresh is not None:
45434582
__query["refresh"] = refresh
45444583
if request_cache is not None:

elasticsearch_serverless/_async/client/cat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ async def count(
223223
) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
224224
"""
225225
Get a document count. Provides quick access to a document count for a data stream,
226-
an index, or an entire cluster.n/ The document count only includes live documents,
226+
an index, or an entire cluster. The document count only includes live documents,
227227
not deleted documents which have not yet been removed by the merge process. CAT
228228
APIs are only intended for human consumption using the command line or Kibana
229229
console. They are not intended for use by applications. For application consumption,

elasticsearch_serverless/_async/client/cluster.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ async def put_component_template(
284284
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html>`_
285285
286286
:param name: Name of the component template to create. Elasticsearch includes
287-
the following built-in component templates: `logs-mappings`; 'logs-settings`;
287+
the following built-in component templates: `logs-mappings`; `logs-settings`;
288288
`metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`.
289289
Elastic Agent uses these templates to configure backing indices for its data
290290
streams. If you use Elastic Agent and want to overwrite one of these templates,

elasticsearch_serverless/_async/client/esql.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ async def query(
4747
error_trace: t.Optional[bool] = None,
4848
filter: t.Optional[t.Mapping[str, t.Any]] = None,
4949
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
50-
format: t.Optional[str] = None,
50+
format: t.Optional[
51+
t.Union[
52+
str,
53+
t.Literal[
54+
"arrow", "cbor", "csv", "json", "smile", "tsv", "txt", "yaml"
55+
],
56+
]
57+
] = None,
5158
human: t.Optional[bool] = None,
5259
locale: t.Optional[str] = None,
5360
params: t.Optional[

0 commit comments

Comments
 (0)