diff --git a/elasticsearch/_async/client/cat.py b/elasticsearch/_async/client/cat.py index fc121e9ca..e7971565d 100644 --- a/elasticsearch/_async/client/cat.py +++ b/elasticsearch/_async/client/cat.py @@ -3301,10 +3301,20 @@ async def segments( self, *, index: t.Optional[t.Union[str, t.Sequence[str]]] = None, + allow_closed: t.Optional[bool] = None, + allow_no_indices: t.Optional[bool] = None, bytes: t.Optional[ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]] ] = None, error_trace: t.Optional[bool] = None, + expand_wildcards: t.Optional[ + t.Union[ + t.Sequence[ + t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]] + ], + t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]], + ] + ] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, h: t.Optional[ @@ -3355,6 +3365,8 @@ async def segments( ] = None, help: t.Optional[bool] = None, human: t.Optional[bool] = None, + ignore_throttled: t.Optional[bool] = None, + ignore_unavailable: t.Optional[bool] = None, local: t.Optional[bool] = None, master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None, pretty: t.Optional[bool] = None, @@ -3378,6 +3390,14 @@ async def segments( :param index: A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + :param allow_closed: If true, allow closed indices to be returned in the response + otherwise if false, keep the legacy behaviour of throwing an exception if + index pattern matches closed indices + :param allow_no_indices: If false, the request returns an error if any wildcard + expression, index alias, or _all value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. For + example, a request targeting foo*,bar* returns an error if an index starts + with foo but no index starts with bar. :param bytes: Sets the units for columns that contain a byte-size value. Note that byte-size value units work in terms of powers of 1024. For instance `1kb` means 1024 bytes, not 1000 bytes. If omitted, byte-size values are @@ -3386,12 +3406,20 @@ async def segments( least `1.0`. If given, byte-size values are rendered as an integer with no suffix, representing the value of the column in the chosen unit. Values that are not an exact multiple of the chosen unit are rounded down. + :param expand_wildcards: Type of index that wildcard expressions can match. If + the request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as open,hidden. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: A comma-separated list of columns names to display. It supports simple wildcards. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. + :param ignore_throttled: If true, concrete, expanded or aliased indices are ignored + when frozen. + :param ignore_unavailable: If true, missing or closed indices are not included + in the response. :param local: If `true`, the request computes the list of selected nodes from the local cluster state. If `false` the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating @@ -3416,10 +3444,16 @@ async def segments( __path_parts = {} __path = "/_cat/segments" __query: t.Dict[str, t.Any] = {} + if allow_closed is not None: + __query["allow_closed"] = allow_closed + if allow_no_indices is not None: + __query["allow_no_indices"] = allow_no_indices if bytes is not None: __query["bytes"] = bytes if error_trace is not None: __query["error_trace"] = error_trace + if expand_wildcards is not None: + __query["expand_wildcards"] = expand_wildcards if filter_path is not None: __query["filter_path"] = filter_path if format is not None: @@ -3430,6 +3464,10 @@ async def segments( __query["help"] = help if human is not None: __query["human"] = human + if ignore_throttled is not None: + __query["ignore_throttled"] = ignore_throttled + if ignore_unavailable is not None: + __query["ignore_unavailable"] = ignore_unavailable if local is not None: __query["local"] = local if master_timeout is not None: diff --git a/elasticsearch/_async/client/cluster.py b/elasticsearch/_async/client/cluster.py index ced198b56..dae8a4a1e 100644 --- a/elasticsearch/_async/client/cluster.py +++ b/elasticsearch/_async/client/cluster.py @@ -1124,7 +1124,8 @@ async def state( when unavailable (missing or closed) :param local: Return local information, do not retrieve the state from master node (default: false) - :param master_timeout: Specify timeout for connection to master + :param master_timeout: Timeout for waiting for new cluster state in case it is + blocked :param wait_for_metadata_version: Wait for the metadata version to be equal or greater than the specified metadata version :param wait_for_timeout: The maximum time to wait for wait_for_metadata_version diff --git a/elasticsearch/_async/client/eql.py b/elasticsearch/_async/client/eql.py index 98ee4f4e8..3ea863556 100644 --- a/elasticsearch/_async/client/eql.py +++ b/elasticsearch/_async/client/eql.py @@ -291,7 +291,7 @@ async def search( Defaults to 10 :param tiebreaker_field: Field used to sort hits with the same timestamp in ascending order - :param timestamp_field: Field containing event timestamp. Default "@timestamp" + :param timestamp_field: Field containing event timestamp. :param wait_for_completion_timeout: """ if index in SKIP_IN_PATH: diff --git a/elasticsearch/_async/client/indices.py b/elasticsearch/_async/client/indices.py index 13e217943..412da3ec4 100644 --- a/elasticsearch/_async/client/indices.py +++ b/elasticsearch/_async/client/indices.py @@ -2767,8 +2767,8 @@ async def get_index_template( ``_ - :param name: Comma-separated list of index template names used to limit the request. - Wildcard (*) expressions are supported. + :param name: Name of index template to retrieve. Wildcard (*) expressions are + supported. :param flat_settings: If true, returns settings in flat format. :param include_defaults: If true, returns all relevant default configurations for the index template. @@ -3565,7 +3565,7 @@ async def put_data_lifecycle( *, name: t.Union[str, t.Sequence[str]], data_retention: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None, - downsampling: t.Optional[t.Mapping[str, t.Any]] = None, + downsampling: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, enabled: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ diff --git a/elasticsearch/_async/client/security.py b/elasticsearch/_async/client/security.py index 516906ce8..1f3f57179 100644 --- a/elasticsearch/_async/client/security.py +++ b/elasticsearch/_async/client/security.py @@ -3711,7 +3711,8 @@ async def query_role( :param size: The number of hits to return. It must not be negative. By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. To page through more hits, use the `search_after` parameter. - :param sort: The sort definition. You can sort on `username`, `roles`, or `enabled`. + :param sort: The sort definition. You can sort on `name`, `description`, `metadata`, + `applications.application`, `applications.privileges`, and `applications.resources`. In addition, sort can also be applied to the `_doc` field to sort by index order. """ diff --git a/elasticsearch/_sync/client/cat.py b/elasticsearch/_sync/client/cat.py index 46b6820ae..3cf5c70e0 100644 --- a/elasticsearch/_sync/client/cat.py +++ b/elasticsearch/_sync/client/cat.py @@ -3301,10 +3301,20 @@ def segments( self, *, index: t.Optional[t.Union[str, t.Sequence[str]]] = None, + allow_closed: t.Optional[bool] = None, + allow_no_indices: t.Optional[bool] = None, bytes: t.Optional[ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]] ] = None, error_trace: t.Optional[bool] = None, + expand_wildcards: t.Optional[ + t.Union[ + t.Sequence[ + t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]] + ], + t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]], + ] + ] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, h: t.Optional[ @@ -3355,6 +3365,8 @@ def segments( ] = None, help: t.Optional[bool] = None, human: t.Optional[bool] = None, + ignore_throttled: t.Optional[bool] = None, + ignore_unavailable: t.Optional[bool] = None, local: t.Optional[bool] = None, master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None, pretty: t.Optional[bool] = None, @@ -3378,6 +3390,14 @@ def segments( :param index: A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + :param allow_closed: If true, allow closed indices to be returned in the response + otherwise if false, keep the legacy behaviour of throwing an exception if + index pattern matches closed indices + :param allow_no_indices: If false, the request returns an error if any wildcard + expression, index alias, or _all value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. For + example, a request targeting foo*,bar* returns an error if an index starts + with foo but no index starts with bar. :param bytes: Sets the units for columns that contain a byte-size value. Note that byte-size value units work in terms of powers of 1024. For instance `1kb` means 1024 bytes, not 1000 bytes. If omitted, byte-size values are @@ -3386,12 +3406,20 @@ def segments( least `1.0`. If given, byte-size values are rendered as an integer with no suffix, representing the value of the column in the chosen unit. Values that are not an exact multiple of the chosen unit are rounded down. + :param expand_wildcards: Type of index that wildcard expressions can match. If + the request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as open,hidden. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: A comma-separated list of columns names to display. It supports simple wildcards. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. + :param ignore_throttled: If true, concrete, expanded or aliased indices are ignored + when frozen. + :param ignore_unavailable: If true, missing or closed indices are not included + in the response. :param local: If `true`, the request computes the list of selected nodes from the local cluster state. If `false` the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating @@ -3416,10 +3444,16 @@ def segments( __path_parts = {} __path = "/_cat/segments" __query: t.Dict[str, t.Any] = {} + if allow_closed is not None: + __query["allow_closed"] = allow_closed + if allow_no_indices is not None: + __query["allow_no_indices"] = allow_no_indices if bytes is not None: __query["bytes"] = bytes if error_trace is not None: __query["error_trace"] = error_trace + if expand_wildcards is not None: + __query["expand_wildcards"] = expand_wildcards if filter_path is not None: __query["filter_path"] = filter_path if format is not None: @@ -3430,6 +3464,10 @@ def segments( __query["help"] = help if human is not None: __query["human"] = human + if ignore_throttled is not None: + __query["ignore_throttled"] = ignore_throttled + if ignore_unavailable is not None: + __query["ignore_unavailable"] = ignore_unavailable if local is not None: __query["local"] = local if master_timeout is not None: diff --git a/elasticsearch/_sync/client/cluster.py b/elasticsearch/_sync/client/cluster.py index fab832aae..1f9f6b8b2 100644 --- a/elasticsearch/_sync/client/cluster.py +++ b/elasticsearch/_sync/client/cluster.py @@ -1124,7 +1124,8 @@ def state( when unavailable (missing or closed) :param local: Return local information, do not retrieve the state from master node (default: false) - :param master_timeout: Specify timeout for connection to master + :param master_timeout: Timeout for waiting for new cluster state in case it is + blocked :param wait_for_metadata_version: Wait for the metadata version to be equal or greater than the specified metadata version :param wait_for_timeout: The maximum time to wait for wait_for_metadata_version diff --git a/elasticsearch/_sync/client/eql.py b/elasticsearch/_sync/client/eql.py index 1fe0234dd..4d1015260 100644 --- a/elasticsearch/_sync/client/eql.py +++ b/elasticsearch/_sync/client/eql.py @@ -291,7 +291,7 @@ def search( Defaults to 10 :param tiebreaker_field: Field used to sort hits with the same timestamp in ascending order - :param timestamp_field: Field containing event timestamp. Default "@timestamp" + :param timestamp_field: Field containing event timestamp. :param wait_for_completion_timeout: """ if index in SKIP_IN_PATH: diff --git a/elasticsearch/_sync/client/indices.py b/elasticsearch/_sync/client/indices.py index e40be2cd7..c852897bd 100644 --- a/elasticsearch/_sync/client/indices.py +++ b/elasticsearch/_sync/client/indices.py @@ -2767,8 +2767,8 @@ def get_index_template( ``_ - :param name: Comma-separated list of index template names used to limit the request. - Wildcard (*) expressions are supported. + :param name: Name of index template to retrieve. Wildcard (*) expressions are + supported. :param flat_settings: If true, returns settings in flat format. :param include_defaults: If true, returns all relevant default configurations for the index template. @@ -3565,7 +3565,7 @@ def put_data_lifecycle( *, name: t.Union[str, t.Sequence[str]], data_retention: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None, - downsampling: t.Optional[t.Mapping[str, t.Any]] = None, + downsampling: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, enabled: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ diff --git a/elasticsearch/_sync/client/security.py b/elasticsearch/_sync/client/security.py index 2672a7951..4af0583d8 100644 --- a/elasticsearch/_sync/client/security.py +++ b/elasticsearch/_sync/client/security.py @@ -3711,7 +3711,8 @@ def query_role( :param size: The number of hits to return. It must not be negative. By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. To page through more hits, use the `search_after` parameter. - :param sort: The sort definition. You can sort on `username`, `roles`, or `enabled`. + :param sort: The sort definition. You can sort on `name`, `description`, `metadata`, + `applications.application`, `applications.privileges`, and `applications.resources`. In addition, sort can also be applied to the `_doc` field to sort by index order. """ diff --git a/elasticsearch/_version.py b/elasticsearch/_version.py index 60fcc064b..6d3f30540 100644 --- a/elasticsearch/_version.py +++ b/elasticsearch/_version.py @@ -16,4 +16,4 @@ # under the License. __versionstr__ = "9.1.2" -__es_specification_commit__ = "cc623e3b52dd3dfd85848ee992713d37da020bfb" +__es_specification_commit__ = "774ff3f6ea8701e7e2c5222f7d8c9d5294722045" diff --git a/elasticsearch/dsl/aggs.py b/elasticsearch/dsl/aggs.py index 2a6b2ff91..439955c98 100644 --- a/elasticsearch/dsl/aggs.py +++ b/elasticsearch/dsl/aggs.py @@ -1495,7 +1495,7 @@ def __init__( "DefaultType", ] = DEFAULT, field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT, - precision: Union[float, str, "DefaultType"] = DEFAULT, + precision: Union[int, str, "DefaultType"] = DEFAULT, shard_size: Union[int, "DefaultType"] = DEFAULT, size: Union[int, "DefaultType"] = DEFAULT, **kwargs: Any, @@ -1579,7 +1579,7 @@ def __init__( self, *, field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT, - precision: Union[float, "DefaultType"] = DEFAULT, + precision: Union[int, "DefaultType"] = DEFAULT, shard_size: Union[int, "DefaultType"] = DEFAULT, size: Union[int, "DefaultType"] = DEFAULT, bounds: Union[ @@ -2680,7 +2680,7 @@ def __init__( self, *, keyed: Union[bool, "DefaultType"] = DEFAULT, - percents: Union[Sequence[float], "DefaultType"] = DEFAULT, + percents: Union[float, Sequence[float], "DefaultType"] = DEFAULT, hdr: Union["types.HdrMethod", Dict[str, Any], "DefaultType"] = DEFAULT, tdigest: Union["types.TDigest", Dict[str, Any], "DefaultType"] = DEFAULT, format: Union[str, "DefaultType"] = DEFAULT, diff --git a/elasticsearch/dsl/field.py b/elasticsearch/dsl/field.py index 3b5075287..c1e309d8c 100644 --- a/elasticsearch/dsl/field.py +++ b/elasticsearch/dsl/field.py @@ -3866,9 +3866,6 @@ class SemanticText(Field): by using the Update mapping API. Use the Create inference API to create the endpoint. If not specified, the inference endpoint defined by inference_id will be used at both index and query time. - :arg index_options: Settings for index_options that override any - defaults used by semantic_text, for example specific quantization - settings. :arg chunking_settings: Settings for chunking text into smaller passages. If specified, these will override the chunking settings sent in the inference endpoint associated with inference_id. If @@ -3888,11 +3885,8 @@ def __init__( meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT, inference_id: Union[str, "DefaultType"] = DEFAULT, search_inference_id: Union[str, "DefaultType"] = DEFAULT, - index_options: Union[ - "types.SemanticTextIndexOptions", Dict[str, Any], "DefaultType" - ] = DEFAULT, chunking_settings: Union[ - "types.ChunkingSettings", None, Dict[str, Any], "DefaultType" + "types.ChunkingSettings", Dict[str, Any], "DefaultType" ] = DEFAULT, fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT, **kwargs: Any, @@ -3903,8 +3897,6 @@ def __init__( kwargs["inference_id"] = inference_id if search_inference_id is not DEFAULT: kwargs["search_inference_id"] = search_inference_id - if index_options is not DEFAULT: - kwargs["index_options"] = index_options if chunking_settings is not DEFAULT: kwargs["chunking_settings"] = chunking_settings if fields is not DEFAULT: diff --git a/elasticsearch/dsl/query.py b/elasticsearch/dsl/query.py index 927af6ad4..0a2cef032 100644 --- a/elasticsearch/dsl/query.py +++ b/elasticsearch/dsl/query.py @@ -1079,8 +1079,6 @@ class Knn(Query): a query_vector_builder or query_vector, but not both. :arg num_candidates: The number of nearest neighbor candidates to consider per shard - :arg visit_percentage: The percentage of vectors to explore per shard - while doing knn search with bbq_disk :arg k: The final number of nearest neighbors to return as top hits :arg filter: Filters for the kNN search query :arg similarity: The minimum similarity for a vector to be considered @@ -1109,7 +1107,6 @@ def __init__( "types.QueryVectorBuilder", Dict[str, Any], "DefaultType" ] = DEFAULT, num_candidates: Union[int, "DefaultType"] = DEFAULT, - visit_percentage: Union[float, "DefaultType"] = DEFAULT, k: Union[int, "DefaultType"] = DEFAULT, filter: Union[Query, Sequence[Query], "DefaultType"] = DEFAULT, similarity: Union[float, "DefaultType"] = DEFAULT, @@ -1125,7 +1122,6 @@ def __init__( query_vector=query_vector, query_vector_builder=query_vector_builder, num_candidates=num_candidates, - visit_percentage=visit_percentage, k=k, filter=filter, similarity=similarity, @@ -1437,7 +1433,7 @@ def __init__( ] = DEFAULT, version: Union[int, "DefaultType"] = DEFAULT, version_type: Union[ - Literal["internal", "external", "external_gte"], "DefaultType" + Literal["internal", "external", "external_gte", "force"], "DefaultType" ] = DEFAULT, boost: Union[float, "DefaultType"] = DEFAULT, _name: Union[str, "DefaultType"] = DEFAULT, diff --git a/elasticsearch/dsl/types.py b/elasticsearch/dsl/types.py index b62fad025..5d518c9d2 100644 --- a/elasticsearch/dsl/types.py +++ b/elasticsearch/dsl/types.py @@ -151,10 +151,9 @@ class ChunkingSettings(AttrDict[Any]): strategies in the linked documentation. Defaults to `sentence` if omitted. :arg max_chunk_size: (required) The maximum size of a chunk in words. - This value cannot be lower than `20` (for `sentence` strategy) or - `10` (for `word` strategy). This value should not exceed the - window size for the associated model. Defaults to `250` if - omitted. + This value cannot be higher than `300` or lower than `20` (for + `sentence` strategy) or `10` (for `word` strategy). Defaults to + `250` if omitted. :arg separator_group: Only applicable to the `recursive` strategy and required when using it. Sets a predefined list of separators in the saved chunking settings based on the selected text type. @@ -398,17 +397,14 @@ class DenseVectorIndexOptions(AttrDict[Any]): HNSW graph. Only applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types. Defaults to `16` if omitted. :arg rescore_vector: The rescore vector options. This is only - applicable to `bbq_disk`, `bbq_hnsw`, `int4_hnsw`, `int8_hnsw`, - `bbq_flat`, `int4_flat`, and `int8_flat` index types. - :arg on_disk_rescore: `true` if vector rescoring should be done on- - disk Only applicable to `bbq_hnsw` + applicable to `bbq_hnsw`, `int4_hnsw`, `int8_hnsw`, `bbq_flat`, + `int4_flat`, and `int8_flat` index types. """ type: Union[ Literal[ "bbq_flat", "bbq_hnsw", - "bbq_disk", "flat", "hnsw", "int4_flat", @@ -424,7 +420,6 @@ class DenseVectorIndexOptions(AttrDict[Any]): rescore_vector: Union[ "DenseVectorIndexOptionsRescoreVector", Dict[str, Any], DefaultType ] - on_disk_rescore: Union[bool, DefaultType] def __init__( self, @@ -433,7 +428,6 @@ def __init__( Literal[ "bbq_flat", "bbq_hnsw", - "bbq_disk", "flat", "hnsw", "int4_flat", @@ -449,7 +443,6 @@ def __init__( rescore_vector: Union[ "DenseVectorIndexOptionsRescoreVector", Dict[str, Any], DefaultType ] = DEFAULT, - on_disk_rescore: Union[bool, DefaultType] = DEFAULT, **kwargs: Any, ): if type is not DEFAULT: @@ -462,8 +455,6 @@ def __init__( kwargs["m"] = m if rescore_vector is not DEFAULT: kwargs["rescore_vector"] = rescore_vector - if on_disk_rescore is not DEFAULT: - kwargs["on_disk_rescore"] = on_disk_rescore super().__init__(kwargs) @@ -2335,7 +2326,9 @@ class LikeDocument(AttrDict[Any]): per_field_analyzer: Union[Mapping[Union[str, InstrumentedField], str], DefaultType] routing: Union[str, DefaultType] version: Union[int, DefaultType] - version_type: Union[Literal["internal", "external", "external_gte"], DefaultType] + version_type: Union[ + Literal["internal", "external", "external_gte", "force"], DefaultType + ] def __init__( self, @@ -2350,7 +2343,7 @@ def __init__( routing: Union[str, DefaultType] = DEFAULT, version: Union[int, DefaultType] = DEFAULT, version_type: Union[ - Literal["internal", "external", "external_gte"], DefaultType + Literal["internal", "external", "external_gte", "force"], DefaultType ] = DEFAULT, **kwargs: Any, ): @@ -3196,33 +3189,6 @@ def __init__( super().__init__(kwargs) -class SemanticTextIndexOptions(AttrDict[Any]): - """ - :arg dense_vector: - :arg sparse_vector: - """ - - dense_vector: Union["DenseVectorIndexOptions", Dict[str, Any], DefaultType] - sparse_vector: Union["SparseVectorIndexOptions", Dict[str, Any], DefaultType] - - def __init__( - self, - *, - dense_vector: Union[ - "DenseVectorIndexOptions", Dict[str, Any], DefaultType - ] = DEFAULT, - sparse_vector: Union[ - "SparseVectorIndexOptions", Dict[str, Any], DefaultType - ] = DEFAULT, - **kwargs: Any, - ): - if dense_vector is not DEFAULT: - kwargs["dense_vector"] = dense_vector - if sparse_vector is not DEFAULT: - kwargs["sparse_vector"] = sparse_vector - super().__init__(kwargs) - - class ShapeFieldQuery(AttrDict[Any]): """ :arg indexed_shape: Queries using a pre-indexed shape.