Skip to content

Commit 7c9ec88

Browse files
Auto-generated API code (#2555)
1 parent ffa9fbf commit 7c9ec88

File tree

6 files changed

+16
-24
lines changed

6 files changed

+16
-24
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3638,6 +3638,7 @@ async def scroll(
36383638
"query",
36393639
"rank",
36403640
"rescore",
3641+
"retriever",
36413642
"runtime_mappings",
36423643
"script_fields",
36433644
"search_after",
@@ -3719,6 +3720,7 @@ async def search(
37193720
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
37203721
] = None,
37213722
rest_total_hits_as_int: t.Optional[bool] = None,
3723+
retriever: t.Optional[t.Mapping[str, t.Any]] = None,
37223724
routing: t.Optional[str] = None,
37233725
runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
37243726
script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
@@ -3878,6 +3880,9 @@ async def search(
38783880
example 100 - 500) documents returned by the `query` and `post_filter` phases.
38793881
:param rest_total_hits_as_int: Indicates whether `hits.total` should be rendered
38803882
as an integer or an object in the rest search response.
3883+
:param retriever: A retriever is a specification to describe top documents returned
3884+
from a search. A retriever replaces other elements of the search API that
3885+
also return top documents such as query and knn.
38813886
:param routing: Custom value used to route operations to a specific shard.
38823887
:param runtime_mappings: Defines one or more runtime fields in the search request.
38833888
These fields take precedence over mapped fields with the same name.
@@ -4074,6 +4079,8 @@ async def search(
40744079
__body["rank"] = rank
40754080
if rescore is not None:
40764081
__body["rescore"] = rescore
4082+
if retriever is not None:
4083+
__body["retriever"] = retriever
40774084
if runtime_mappings is not None:
40784085
__body["runtime_mappings"] = runtime_mappings
40794086
if script_fields is not None:

elasticsearch/_async/client/cluster.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,6 @@ async def put_component_template(
669669
*,
670670
name: str,
671671
template: t.Optional[t.Mapping[str, t.Any]] = None,
672-
cause: t.Optional[str] = None,
673672
create: t.Optional[bool] = None,
674673
deprecated: t.Optional[bool] = None,
675674
error_trace: t.Optional[bool] = None,
@@ -699,7 +698,6 @@ async def put_component_template(
699698
update settings API.
700699
:param template: The template to be applied which includes mappings, settings,
701700
or aliases configuration.
702-
:param cause:
703701
:param create: If `true`, this request cannot replace or update existing component
704702
templates.
705703
:param deprecated: Marks this index template as deprecated. When creating or
@@ -724,8 +722,6 @@ async def put_component_template(
724722
__path = f'/_component_template/{__path_parts["name"]}'
725723
__query: t.Dict[str, t.Any] = {}
726724
__body: t.Dict[str, t.Any] = body if body is not None else {}
727-
if cause is not None:
728-
__query["cause"] = cause
729725
if create is not None:
730726
__query["create"] = create
731727
if error_trace is not None:

elasticsearch/_async/client/esql.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@
2626
class EsqlClient(NamespacedClient):
2727

2828
@_rewrite_parameters(
29-
body_fields=("query", "version", "columnar", "filter", "locale", "params"),
29+
body_fields=("query", "columnar", "filter", "locale", "params"),
3030
ignore_deprecated_options={"params"},
3131
)
3232
async def query(
3333
self,
3434
*,
3535
query: t.Optional[str] = None,
36-
version: t.Optional[t.Union["t.Literal['2024.04.01']", str]] = None,
3736
columnar: t.Optional[bool] = None,
3837
delimiter: t.Optional[str] = None,
3938
error_trace: t.Optional[bool] = None,
@@ -53,8 +52,6 @@ async def query(
5352
5453
:param query: The ES|QL query API accepts an ES|QL query string in the query
5554
parameter, runs it, and returns the results.
56-
:param version: The version of the ES|QL language in which the "query" field
57-
was written.
5855
:param columnar: By default, ES|QL returns results as rows. For example, FROM
5956
returns each individual document as one row. For the JSON, YAML, CBOR and
6057
smile formats, ES|QL can return the results in a columnar fashion where one
@@ -71,8 +68,6 @@ async def query(
7168
"""
7269
if query is None and body is None:
7370
raise ValueError("Empty value passed for parameter 'query'")
74-
if version is None and body is None:
75-
raise ValueError("Empty value passed for parameter 'version'")
7671
__path_parts: t.Dict[str, str] = {}
7772
__path = "/_query"
7873
__query: t.Dict[str, t.Any] = {}
@@ -92,8 +87,6 @@ async def query(
9287
if not __body:
9388
if query is not None:
9489
__body["query"] = query
95-
if version is not None:
96-
__body["version"] = version
9790
if columnar is not None:
9891
__body["columnar"] = columnar
9992
if filter is not None:

elasticsearch/_sync/client/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3636,6 +3636,7 @@ def scroll(
36363636
"query",
36373637
"rank",
36383638
"rescore",
3639+
"retriever",
36393640
"runtime_mappings",
36403641
"script_fields",
36413642
"search_after",
@@ -3717,6 +3718,7 @@ def search(
37173718
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
37183719
] = None,
37193720
rest_total_hits_as_int: t.Optional[bool] = None,
3721+
retriever: t.Optional[t.Mapping[str, t.Any]] = None,
37203722
routing: t.Optional[str] = None,
37213723
runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
37223724
script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
@@ -3876,6 +3878,9 @@ def search(
38763878
example 100 - 500) documents returned by the `query` and `post_filter` phases.
38773879
:param rest_total_hits_as_int: Indicates whether `hits.total` should be rendered
38783880
as an integer or an object in the rest search response.
3881+
:param retriever: A retriever is a specification to describe top documents returned
3882+
from a search. A retriever replaces other elements of the search API that
3883+
also return top documents such as query and knn.
38793884
:param routing: Custom value used to route operations to a specific shard.
38803885
:param runtime_mappings: Defines one or more runtime fields in the search request.
38813886
These fields take precedence over mapped fields with the same name.
@@ -4072,6 +4077,8 @@ def search(
40724077
__body["rank"] = rank
40734078
if rescore is not None:
40744079
__body["rescore"] = rescore
4080+
if retriever is not None:
4081+
__body["retriever"] = retriever
40754082
if runtime_mappings is not None:
40764083
__body["runtime_mappings"] = runtime_mappings
40774084
if script_fields is not None:

elasticsearch/_sync/client/cluster.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,6 @@ def put_component_template(
669669
*,
670670
name: str,
671671
template: t.Optional[t.Mapping[str, t.Any]] = None,
672-
cause: t.Optional[str] = None,
673672
create: t.Optional[bool] = None,
674673
deprecated: t.Optional[bool] = None,
675674
error_trace: t.Optional[bool] = None,
@@ -699,7 +698,6 @@ def put_component_template(
699698
update settings API.
700699
:param template: The template to be applied which includes mappings, settings,
701700
or aliases configuration.
702-
:param cause:
703701
:param create: If `true`, this request cannot replace or update existing component
704702
templates.
705703
:param deprecated: Marks this index template as deprecated. When creating or
@@ -724,8 +722,6 @@ def put_component_template(
724722
__path = f'/_component_template/{__path_parts["name"]}'
725723
__query: t.Dict[str, t.Any] = {}
726724
__body: t.Dict[str, t.Any] = body if body is not None else {}
727-
if cause is not None:
728-
__query["cause"] = cause
729725
if create is not None:
730726
__query["create"] = create
731727
if error_trace is not None:

elasticsearch/_sync/client/esql.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@
2626
class EsqlClient(NamespacedClient):
2727

2828
@_rewrite_parameters(
29-
body_fields=("query", "version", "columnar", "filter", "locale", "params"),
29+
body_fields=("query", "columnar", "filter", "locale", "params"),
3030
ignore_deprecated_options={"params"},
3131
)
3232
def query(
3333
self,
3434
*,
3535
query: t.Optional[str] = None,
36-
version: t.Optional[t.Union["t.Literal['2024.04.01']", str]] = None,
3736
columnar: t.Optional[bool] = None,
3837
delimiter: t.Optional[str] = None,
3938
error_trace: t.Optional[bool] = None,
@@ -53,8 +52,6 @@ def query(
5352
5453
:param query: The ES|QL query API accepts an ES|QL query string in the query
5554
parameter, runs it, and returns the results.
56-
:param version: The version of the ES|QL language in which the "query" field
57-
was written.
5855
:param columnar: By default, ES|QL returns results as rows. For example, FROM
5956
returns each individual document as one row. For the JSON, YAML, CBOR and
6057
smile formats, ES|QL can return the results in a columnar fashion where one
@@ -71,8 +68,6 @@ def query(
7168
"""
7269
if query is None and body is None:
7370
raise ValueError("Empty value passed for parameter 'query'")
74-
if version is None and body is None:
75-
raise ValueError("Empty value passed for parameter 'version'")
7671
__path_parts: t.Dict[str, str] = {}
7772
__path = "/_query"
7873
__query: t.Dict[str, t.Any] = {}
@@ -92,8 +87,6 @@ def query(
9287
if not __body:
9388
if query is not None:
9489
__body["query"] = query
95-
if version is not None:
96-
__body["version"] = version
9790
if columnar is not None:
9891
__body["columnar"] = columnar
9992
if filter is not None:

0 commit comments

Comments
 (0)