Skip to content

Commit b8633ba

Browse files
Auto-generated code for main (#2637)
* Auto-generated API code * Auto-generated API code --------- Co-authored-by: Quentin Pradet <[email protected]>
1 parent d4df09f commit b8633ba

16 files changed

+960
-362
lines changed

elasticsearch/_async/client/__init__.py

+41-2
Original file line numberDiff line numberDiff line change
@@ -2714,6 +2714,7 @@ async def msearch(
27142714
human: t.Optional[bool] = None,
27152715
ignore_throttled: t.Optional[bool] = None,
27162716
ignore_unavailable: t.Optional[bool] = None,
2717+
include_named_queries_score: t.Optional[bool] = None,
27172718
max_concurrent_searches: t.Optional[int] = None,
27182719
max_concurrent_shard_requests: t.Optional[int] = None,
27192720
pre_filter_shard_size: t.Optional[int] = None,
@@ -2747,6 +2748,13 @@ async def msearch(
27472748
when frozen.
27482749
:param ignore_unavailable: If true, missing or closed indices are not included
27492750
in the response.
2751+
:param include_named_queries_score: Indicates whether hit.matched_queries should
2752+
be rendered as a map that includes the name of the matched query associated
2753+
with its score (true) or as an array containing the name of the matched queries
2754+
(false) This functionality reruns each named query on every hit in a search
2755+
response. Typically, this adds a small overhead to a request. However, using
2756+
computationally expensive named queries on a large number of hits may add
2757+
significant overhead.
27502758
:param max_concurrent_searches: Maximum number of concurrent searches the multi
27512759
search API can execute.
27522760
:param max_concurrent_shard_requests: Maximum number of concurrent shard requests
@@ -2796,6 +2804,8 @@ async def msearch(
27962804
__query["ignore_throttled"] = ignore_throttled
27972805
if ignore_unavailable is not None:
27982806
__query["ignore_unavailable"] = ignore_unavailable
2807+
if include_named_queries_score is not None:
2808+
__query["include_named_queries_score"] = include_named_queries_score
27992809
if max_concurrent_searches is not None:
28002810
__query["max_concurrent_searches"] = max_concurrent_searches
28012811
if max_concurrent_shard_requests is not None:
@@ -3028,7 +3038,9 @@ async def mtermvectors(
30283038
path_parts=__path_parts,
30293039
)
30303040

3031-
@_rewrite_parameters()
3041+
@_rewrite_parameters(
3042+
body_fields=("index_filter",),
3043+
)
30323044
async def open_point_in_time(
30333045
self,
30343046
*,
@@ -3046,9 +3058,11 @@ async def open_point_in_time(
30463058
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
30473059
human: t.Optional[bool] = None,
30483060
ignore_unavailable: t.Optional[bool] = None,
3061+
index_filter: t.Optional[t.Mapping[str, t.Any]] = None,
30493062
preference: t.Optional[str] = None,
30503063
pretty: t.Optional[bool] = None,
30513064
routing: t.Optional[str] = None,
3065+
body: t.Optional[t.Dict[str, t.Any]] = None,
30523066
) -> ObjectApiResponse[t.Any]:
30533067
"""
30543068
A search request by default executes against the most recent visible data of
@@ -3070,17 +3084,20 @@ async def open_point_in_time(
30703084
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
30713085
:param ignore_unavailable: If `false`, the request returns an error if it targets
30723086
a missing or closed index.
3087+
:param index_filter: Allows to filter indices if the provided query rewrites
3088+
to `match_none` on every shard.
30733089
:param preference: Specifies the node or shard the operation should be performed
30743090
on. Random by default.
30753091
:param routing: Custom value used to route operations to a specific shard.
30763092
"""
30773093
if index in SKIP_IN_PATH:
30783094
raise ValueError("Empty value passed for parameter 'index'")
3079-
if keep_alive is None:
3095+
if keep_alive is None and body is None:
30803096
raise ValueError("Empty value passed for parameter 'keep_alive'")
30813097
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
30823098
__path = f'/{__path_parts["index"]}/_pit'
30833099
__query: t.Dict[str, t.Any] = {}
3100+
__body: t.Dict[str, t.Any] = body if body is not None else {}
30843101
if keep_alive is not None:
30853102
__query["keep_alive"] = keep_alive
30863103
if error_trace is not None:
@@ -3099,12 +3116,20 @@ async def open_point_in_time(
30993116
__query["pretty"] = pretty
31003117
if routing is not None:
31013118
__query["routing"] = routing
3119+
if not __body:
3120+
if index_filter is not None:
3121+
__body["index_filter"] = index_filter
3122+
if not __body:
3123+
__body = None # type: ignore[assignment]
31023124
__headers = {"accept": "application/json"}
3125+
if __body is not None:
3126+
__headers["content-type"] = "application/json"
31033127
return await self.perform_request( # type: ignore[return-value]
31043128
"POST",
31053129
__path,
31063130
params=__query,
31073131
headers=__headers,
3132+
body=__body,
31083133
endpoint_id="open_point_in_time",
31093134
path_parts=__path_parts,
31103135
)
@@ -3709,6 +3734,7 @@ async def search(
37093734
human: t.Optional[bool] = None,
37103735
ignore_throttled: t.Optional[bool] = None,
37113736
ignore_unavailable: t.Optional[bool] = None,
3737+
include_named_queries_score: t.Optional[bool] = None,
37123738
indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None,
37133739
knn: t.Optional[
37143740
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
@@ -3836,6 +3862,13 @@ async def search(
38363862
be ignored when frozen.
38373863
:param ignore_unavailable: If `false`, the request returns an error if it targets
38383864
a missing or closed index.
3865+
:param include_named_queries_score: Indicates whether hit.matched_queries should
3866+
be rendered as a map that includes the name of the matched query associated
3867+
with its score (true) or as an array containing the name of the matched queries
3868+
(false) This functionality reruns each named query on every hit in a search
3869+
response. Typically, this adds a small overhead to a request. However, using
3870+
computationally expensive named queries on a large number of hits may add
3871+
significant overhead.
38393872
:param indices_boost: Boosts the _score of documents from specified indices.
38403873
:param knn: Defines the approximate kNN search to run.
38413874
:param lenient: If `true`, format-based query failures (such as providing text
@@ -4017,6 +4050,8 @@ async def search(
40174050
__query["ignore_throttled"] = ignore_throttled
40184051
if ignore_unavailable is not None:
40194052
__query["ignore_unavailable"] = ignore_unavailable
4053+
if include_named_queries_score is not None:
4054+
__query["include_named_queries_score"] = include_named_queries_score
40204055
if lenient is not None:
40214056
__query["lenient"] = lenient
40224057
if max_concurrent_shard_requests is not None:
@@ -4963,6 +4998,7 @@ async def update_by_query(
49634998
pipeline: t.Optional[str] = None,
49644999
preference: t.Optional[str] = None,
49655000
pretty: t.Optional[bool] = None,
5001+
q: t.Optional[str] = None,
49665002
query: t.Optional[t.Mapping[str, t.Any]] = None,
49675003
refresh: t.Optional[bool] = None,
49685004
request_cache: t.Optional[bool] = None,
@@ -5029,6 +5065,7 @@ async def update_by_query(
50295065
parameter.
50305066
:param preference: Specifies the node or shard the operation should be performed
50315067
on. Random by default.
5068+
:param q: Query in the Lucene query string syntax.
50325069
:param query: Specifies the documents to update using the Query DSL.
50335070
:param refresh: If `true`, Elasticsearch refreshes affected shards to make the
50345071
operation visible to search.
@@ -5113,6 +5150,8 @@ async def update_by_query(
51135150
__query["preference"] = preference
51145151
if pretty is not None:
51155152
__query["pretty"] = pretty
5153+
if q is not None:
5154+
__query["q"] = q
51165155
if refresh is not None:
51175156
__query["refresh"] = refresh
51185157
if request_cache is not None:

elasticsearch/_async/client/cat.py

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

elasticsearch/_async/client/cluster.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,9 @@ async def health(
427427
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html>`_
428428
429429
:param index: Comma-separated list of data streams, indices, and index aliases
430-
used to limit the request. Wildcard expressions (*) are supported. To target
430+
used to limit the request. Wildcard expressions (`*`) are supported. To target
431431
all data streams and indices in a cluster, omit this parameter or use _all
432-
or *.
432+
or `*`.
433433
:param expand_wildcards: Whether to expand wildcard expression to concrete indices
434434
that are open, closed or both.
435435
:param level: Can be one of cluster, indices or shards. Controls the details
@@ -703,7 +703,7 @@ async def put_component_template(
703703
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html>`_
704704
705705
:param name: Name of the component template to create. Elasticsearch includes
706-
the following built-in component templates: `logs-mappings`; 'logs-settings`;
706+
the following built-in component templates: `logs-mappings`; `logs-settings`;
707707
`metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`.
708708
Elastic Agent uses these templates to configure backing indices for its data
709709
streams. If you use Elastic Agent and want to overwrite one of these templates,

0 commit comments

Comments
 (0)