diff --git a/elasticsearch/_async/client/__init__.py b/elasticsearch/_async/client/__init__.py index c7d190220..28eb58477 100644 --- a/elasticsearch/_async/client/__init__.py +++ b/elasticsearch/_async/client/__init__.py @@ -3638,6 +3638,7 @@ async def scroll( "query", "rank", "rescore", + "retriever", "runtime_mappings", "script_fields", "search_after", @@ -3719,6 +3720,7 @@ async def search( t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, rest_total_hits_as_int: t.Optional[bool] = None, + retriever: t.Optional[t.Mapping[str, t.Any]] = None, routing: t.Optional[str] = None, runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, @@ -3878,6 +3880,9 @@ async def search( example 100 - 500) documents returned by the `query` and `post_filter` phases. :param rest_total_hits_as_int: Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. + :param retriever: A retriever is a specification to describe top documents returned + from a search. A retriever replaces other elements of the search API that + also return top documents such as query and knn. :param routing: Custom value used to route operations to a specific shard. :param runtime_mappings: Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name. @@ -4074,6 +4079,8 @@ async def search( __body["rank"] = rank if rescore is not None: __body["rescore"] = rescore + if retriever is not None: + __body["retriever"] = retriever if runtime_mappings is not None: __body["runtime_mappings"] = runtime_mappings if script_fields is not None: diff --git a/elasticsearch/_async/client/cluster.py b/elasticsearch/_async/client/cluster.py index 990653d27..6a14632a5 100644 --- a/elasticsearch/_async/client/cluster.py +++ b/elasticsearch/_async/client/cluster.py @@ -669,7 +669,6 @@ async def put_component_template( *, name: str, template: t.Optional[t.Mapping[str, t.Any]] = None, - cause: t.Optional[str] = None, create: t.Optional[bool] = None, deprecated: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, @@ -699,7 +698,6 @@ async def put_component_template( update settings API. :param template: The template to be applied which includes mappings, settings, or aliases configuration. - :param cause: :param create: If `true`, this request cannot replace or update existing component templates. :param deprecated: Marks this index template as deprecated. When creating or @@ -724,8 +722,6 @@ async def put_component_template( __path = f'/_component_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} - if cause is not None: - __query["cause"] = cause if create is not None: __query["create"] = create if error_trace is not None: diff --git a/elasticsearch/_async/client/esql.py b/elasticsearch/_async/client/esql.py index 072bedbc1..d39a86f28 100644 --- a/elasticsearch/_async/client/esql.py +++ b/elasticsearch/_async/client/esql.py @@ -26,14 +26,13 @@ class EsqlClient(NamespacedClient): @_rewrite_parameters( - body_fields=("query", "version", "columnar", "filter", "locale", "params"), + body_fields=("query", "columnar", "filter", "locale", "params"), ignore_deprecated_options={"params"}, ) async def query( self, *, query: t.Optional[str] = None, - version: t.Optional[t.Union["t.Literal['2024.04.01']", str]] = None, columnar: t.Optional[bool] = None, delimiter: t.Optional[str] = None, error_trace: t.Optional[bool] = None, @@ -53,8 +52,6 @@ async def query( :param query: The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results. - :param version: The version of the ES|QL language in which the "query" field - was written. :param columnar: By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one @@ -71,8 +68,6 @@ async def query( """ if query is None and body is None: raise ValueError("Empty value passed for parameter 'query'") - if version is None and body is None: - raise ValueError("Empty value passed for parameter 'version'") __path_parts: t.Dict[str, str] = {} __path = "/_query" __query: t.Dict[str, t.Any] = {} @@ -92,8 +87,6 @@ async def query( if not __body: if query is not None: __body["query"] = query - if version is not None: - __body["version"] = version if columnar is not None: __body["columnar"] = columnar if filter is not None: diff --git a/elasticsearch/_sync/client/__init__.py b/elasticsearch/_sync/client/__init__.py index 2b722719b..80b01e580 100644 --- a/elasticsearch/_sync/client/__init__.py +++ b/elasticsearch/_sync/client/__init__.py @@ -3636,6 +3636,7 @@ def scroll( "query", "rank", "rescore", + "retriever", "runtime_mappings", "script_fields", "search_after", @@ -3717,6 +3718,7 @@ def search( t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, rest_total_hits_as_int: t.Optional[bool] = None, + retriever: t.Optional[t.Mapping[str, t.Any]] = None, routing: t.Optional[str] = None, runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, @@ -3876,6 +3878,9 @@ def search( example 100 - 500) documents returned by the `query` and `post_filter` phases. :param rest_total_hits_as_int: Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. + :param retriever: A retriever is a specification to describe top documents returned + from a search. A retriever replaces other elements of the search API that + also return top documents such as query and knn. :param routing: Custom value used to route operations to a specific shard. :param runtime_mappings: Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name. @@ -4072,6 +4077,8 @@ def search( __body["rank"] = rank if rescore is not None: __body["rescore"] = rescore + if retriever is not None: + __body["retriever"] = retriever if runtime_mappings is not None: __body["runtime_mappings"] = runtime_mappings if script_fields is not None: diff --git a/elasticsearch/_sync/client/cluster.py b/elasticsearch/_sync/client/cluster.py index 6cc0a3309..3537ae559 100644 --- a/elasticsearch/_sync/client/cluster.py +++ b/elasticsearch/_sync/client/cluster.py @@ -669,7 +669,6 @@ def put_component_template( *, name: str, template: t.Optional[t.Mapping[str, t.Any]] = None, - cause: t.Optional[str] = None, create: t.Optional[bool] = None, deprecated: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, @@ -699,7 +698,6 @@ def put_component_template( update settings API. :param template: The template to be applied which includes mappings, settings, or aliases configuration. - :param cause: :param create: If `true`, this request cannot replace or update existing component templates. :param deprecated: Marks this index template as deprecated. When creating or @@ -724,8 +722,6 @@ def put_component_template( __path = f'/_component_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} - if cause is not None: - __query["cause"] = cause if create is not None: __query["create"] = create if error_trace is not None: diff --git a/elasticsearch/_sync/client/esql.py b/elasticsearch/_sync/client/esql.py index ee83ec3d2..1dee2e934 100644 --- a/elasticsearch/_sync/client/esql.py +++ b/elasticsearch/_sync/client/esql.py @@ -26,14 +26,13 @@ class EsqlClient(NamespacedClient): @_rewrite_parameters( - body_fields=("query", "version", "columnar", "filter", "locale", "params"), + body_fields=("query", "columnar", "filter", "locale", "params"), ignore_deprecated_options={"params"}, ) def query( self, *, query: t.Optional[str] = None, - version: t.Optional[t.Union["t.Literal['2024.04.01']", str]] = None, columnar: t.Optional[bool] = None, delimiter: t.Optional[str] = None, error_trace: t.Optional[bool] = None, @@ -53,8 +52,6 @@ def query( :param query: The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results. - :param version: The version of the ES|QL language in which the "query" field - was written. :param columnar: By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one @@ -71,8 +68,6 @@ def query( """ if query is None and body is None: raise ValueError("Empty value passed for parameter 'query'") - if version is None and body is None: - raise ValueError("Empty value passed for parameter 'version'") __path_parts: t.Dict[str, str] = {} __path = "/_query" __query: t.Dict[str, t.Any] = {} @@ -92,8 +87,6 @@ def query( if not __body: if query is not None: __body["query"] = query - if version is not None: - __body["version"] = version if columnar is not None: __body["columnar"] = columnar if filter is not None: