`_
:param requests: A set of typical search requests, together with their provided
ratings.
@@ -4066,113 +3870,10 @@ async def reindex(
In this case, the response includes a count of the version conflicts that were encountered.
Note that the handling of other error types is unaffected by the conflicts
property.
Additionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than max_docs
until it has successfully indexed max_docs
documents into the target or it has gone through every document in the source query.
- NOTE: The reindex API makes no effort to handle ID collisions.
- The last document written will "win" but the order isn't usually predictable so it is not a good idea to rely on this behavior.
- Instead, make sure that IDs are unique by using a script.
- Running reindex asynchronously
- If the request contains wait_for_completion=false
, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task.
- Elasticsearch creates a record of this task as a document at _tasks/<task_id>
.
- Reindex from multiple sources
- If you have many sources to reindex it is generally better to reindex them one at a time rather than using a glob pattern to pick up multiple sources.
- That way you can resume the process if there are any errors by removing the partially completed source and starting over.
- It also makes parallelizing the process fairly simple: split the list of sources to reindex and run each list in parallel.
- For example, you can use a bash script like this:
- for index in i1 i2 i3 i4 i5; do
- curl -HContent-Type:application/json -XPOST localhost:9200/_reindex?pretty -d'{
- "source": {
- "index": "'$index'"
- },
- "dest": {
- "index": "'$index'-reindexed"
- }
- }'
- done
-
- Throttling
- Set requests_per_second
to any positive decimal number (1.4
, 6
, 1000
, for example) to throttle the rate at which reindex issues batches of index operations.
- Requests are throttled by padding each batch with a wait time.
- To turn off throttling, set requests_per_second
to -1
.
- The throttling is done by waiting between batches so that the scroll that reindex uses internally can be given a timeout that takes into account the padding.
- The padding time is the difference between the batch size divided by the requests_per_second
and the time spent writing.
- By default the batch size is 1000
, so if requests_per_second
is set to 500
:
- target_time = 1000 / 500 per second = 2 seconds
- wait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds
-
- Since the batch is issued as a single bulk request, large batch sizes cause Elasticsearch to create many requests and then wait for a while before starting the next set.
- This is "bursty" instead of "smooth".
- Slicing
- Reindex supports sliced scroll to parallelize the reindexing process.
- This parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.
- NOTE: Reindexing from remote clusters does not support manual or automatic slicing.
- You can slice a reindex request manually by providing a slice ID and total number of slices to each request.
- You can also let reindex automatically parallelize by using sliced scroll to slice on _id
.
- The slices
parameter specifies the number of slices to use.
- Adding slices
to the reindex request just automates the manual process, creating sub-requests which means it has some quirks:
-
- - You can see these requests in the tasks API. These sub-requests are "child" tasks of the task for the request with slices.
- - Fetching the status of the task for the request with
slices
only contains the status of completed slices.
- - These sub-requests are individually addressable for things like cancellation and rethrottling.
- - Rethrottling the request with
slices
will rethrottle the unfinished sub-request proportionally.
- - Canceling the request with
slices
will cancel each sub-request.
- - Due to the nature of
slices
, each sub-request won't get a perfectly even portion of the documents. All documents will be addressed, but some slices may be larger than others. Expect larger slices to have a more even distribution.
- - Parameters like
requests_per_second
and max_docs
on a request with slices
are distributed proportionally to each sub-request. Combine that with the previous point about distribution being uneven and you should conclude that using max_docs
with slices
might not result in exactly max_docs
documents being reindexed.
- - Each sub-request gets a slightly different snapshot of the source, though these are all taken at approximately the same time.
-
- If slicing automatically, setting slices
to auto
will choose a reasonable number for most indices.
- If slicing manually or otherwise tuning automatic slicing, use the following guidelines.
- Query performance is most efficient when the number of slices is equal to the number of shards in the index.
- If that number is large (for example, 500
), choose a lower number as too many slices will hurt performance.
- Setting slices higher than the number of shards generally does not improve efficiency and adds overhead.
- Indexing performance scales linearly across available resources with the number of slices.
- Whether query or indexing performance dominates the runtime depends on the documents being reindexed and cluster resources.
- Modify documents during reindexing
- Like _update_by_query
, reindex operations support a script that modifies the document.
- Unlike _update_by_query
, the script is allowed to modify the document's metadata.
- Just as in _update_by_query
, you can set ctx.op
to change the operation that is run on the destination.
- For example, set ctx.op
to noop
if your script decides that the document doesn’t have to be indexed in the destination. This "no operation" will be reported in the noop
counter in the response body.
- Set ctx.op
to delete
if your script decides that the document must be deleted from the destination.
- The deletion will be reported in the deleted
counter in the response body.
- Setting ctx.op
to anything else will return an error, as will setting any other field in ctx
.
- Think of the possibilities! Just be careful; you are able to change:
-
- _id
- _index
- _version
- _routing
-
- Setting _version
to null
or clearing it from the ctx
map is just like not sending the version in an indexing request.
- It will cause the document to be overwritten in the destination regardless of the version on the target or the version type you use in the reindex API.
- Reindex from remote
- Reindex supports reindexing from a remote Elasticsearch cluster.
- The host
parameter must contain a scheme, host, port, and optional path.
- The username
and password
parameters are optional and when they are present the reindex operation will connect to the remote Elasticsearch node using basic authentication.
- Be sure to use HTTPS when using basic authentication or the password will be sent in plain text.
- There are a range of settings available to configure the behavior of the HTTPS connection.
- When using Elastic Cloud, it is also possible to authenticate against the remote cluster through the use of a valid API key.
- Remote hosts must be explicitly allowed with the reindex.remote.whitelist
setting.
- It can be set to a comma delimited list of allowed remote host and port combinations.
- Scheme is ignored; only the host and port are used.
- For example:
- reindex.remote.whitelist: [otherhost:9200, another:9200, 127.0.10.*:9200, localhost:*"]
-
- The list of allowed hosts must be configured on any nodes that will coordinate the reindex.
- This feature should work with remote clusters of any version of Elasticsearch.
- This should enable you to upgrade from any version of Elasticsearch to the current version by reindexing from a cluster of the old version.
- WARNING: Elasticsearch does not support forward compatibility across major versions.
- For example, you cannot reindex from a 7.x cluster into a 6.x cluster.
- To enable queries sent to older versions of Elasticsearch, the query
parameter is sent directly to the remote host without validation or modification.
- NOTE: Reindexing from remote clusters does not support manual or automatic slicing.
- Reindexing from a remote server uses an on-heap buffer that defaults to a maximum size of 100mb.
- If the remote index includes very large documents you'll need to use a smaller batch size.
- It is also possible to set the socket read timeout on the remote connection with the socket_timeout
field and the connection timeout with the connect_timeout
field.
- Both default to 30 seconds.
- Configuring SSL parameters
- Reindex from remote supports configurable SSL settings.
- These must be specified in the elasticsearch.yml
file, with the exception of the secure settings, which you add in the Elasticsearch keystore.
- It is not possible to configure SSL in the body of the reindex request.
-
-
- ``_
+ Refer to the linked documentation for examples of how to reindex documents.
+
+
+ ``_
:param dest: The destination you are copying to.
:param source: The source you are copying from.
@@ -4296,7 +3997,7 @@ async def reindex_rethrottle(
This behavior prevents scroll timeouts.
- ``_
+ ``_
:param task_id: The task identifier, which can be found by using the tasks API.
:param requests_per_second: The throttle for this request in sub-requests per
@@ -4342,7 +4043,7 @@ async def render_search_template(
human: t.Optional[bool] = None,
params: t.Optional[t.Mapping[str, t.Any]] = None,
pretty: t.Optional[bool] = None,
- source: t.Optional[str] = None,
+ source: t.Optional[t.Union[str, t.Mapping[str, t.Any]]] = None,
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
@@ -4352,7 +4053,7 @@ async def render_search_template(
Render a search template as a search request body.
- ``_
+ ``_
:param id: The ID of the search template to render. If no `source` is specified,
this or the `id` request body parameter is required.
@@ -4446,7 +4147,7 @@ async def scripts_painless_execute(
Each context requires a script, but additional parameters depend on the context you're using for that script.
- ``_
+ ``_
:param context: The context that the script should run in. NOTE: Result ordering
in the field contexts is not guaranteed.
@@ -4519,7 +4220,7 @@ async def scroll(
IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests.
- ``_
+ ``_
:param scroll_id: The scroll ID of the search.
:param rest_total_hits_as_int: If true, the API response’s hit.total property
@@ -4724,7 +4425,7 @@ async def search(
This situation can occur because the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index.
- ``_
+ ``_
:param index: A comma-separated list of data streams, indices, and aliases to
search. It supports wildcards (`*`). To search all data streams and indices,
@@ -4803,7 +4504,8 @@ async def search(
limit the impact of the search on the cluster in order to limit the number
of concurrent shard requests.
:param min_score: The minimum `_score` for matching documents. Documents with
- a lower `_score` are not included in the search results.
+ a lower `_score` are not included in search results and results collected
+ by aggregations.
:param pit: Limit the search to a point in time (PIT). If you provide a PIT,
you cannot specify an `` in the request path.
:param post_filter: Use the `post_filter` parameter to filter search results.
@@ -4830,11 +4532,11 @@ async def search(
of the specified nodes are available, select shards from any available node
using the default method. * `_prefer_nodes:,` to if possible,
run the search on the specified nodes IDs. If not, select shards using the
- default method. `_shards:,` to run the search only on the specified
- shards. You can combine this value with other `preference` values. However,
- the `_shards` value must come first. For example: `_shards:2,3|_local`. ``
- (any string that does not start with `_`) to route searches with the same
- `` to the same shards in the same order.
+ default method. * `_shards:,` to run the search only on the
+ specified shards. You can combine this value with other `preference` values.
+ However, the `_shards` value must come first. For example: `_shards:2,3|_local`.
+ * `` (any string that does not start with `_`) to route searches
+ with the same `` to the same shards in the same order.
:param profile: Set to `true` to return detailed timing information about the
execution of individual components in a search request. NOTE: This is a debugging
tool and adds significant overhead to search execution.
@@ -5170,51 +4872,6 @@ async def search_mvt(
Optionally, a geo_bounds
aggregation on the <field>
. The search only includes this aggregation if the exact_bounds
parameter is true
.
If the optional parameter with_labels
is true
, the internal search will include a dynamic runtime field that calls the getLabelPosition
function of the geometry doc value. This enables the generation of new point features containing suggested geometry labels, so that, for example, multi-polygons will have only one label.
- For example, Elasticsearch may translate a vector tile search API request with a grid_agg
argument of geotile
and an exact_bounds
argument of true
into the following search
- GET my-index/_search
- {
- "size": 10000,
- "query": {
- "geo_bounding_box": {
- "my-geo-field": {
- "top_left": {
- "lat": -40.979898069620134,
- "lon": -45
- },
- "bottom_right": {
- "lat": -66.51326044311186,
- "lon": 0
- }
- }
- }
- },
- "aggregations": {
- "grid": {
- "geotile_grid": {
- "field": "my-geo-field",
- "precision": 11,
- "size": 65536,
- "bounds": {
- "top_left": {
- "lat": -40.979898069620134,
- "lon": -45
- },
- "bottom_right": {
- "lat": -66.51326044311186,
- "lon": 0
- }
- }
- }
- },
- "bounds": {
- "geo_bounds": {
- "field": "my-geo-field",
- "wrap_longitude": false
- }
- }
- }
- }
-
The API returns results as a binary Mapbox vector tile.
Mapbox vector tiles are encoded as Google Protobufs (PBF). By default, the tile contains three layers:
@@ -5469,9 +5126,10 @@ async def search_mvt(
Some cells may intersect more than one vector tile.
To compute the H3 resolution for each precision, Elasticsearch compares the average density of hexagonal bins at each resolution with the average density of tile bins at each zoom level.
Elasticsearch uses the H3 resolution that is closest to the corresponding geotile density.
+ Learn how to use the vector tile search API with practical examples in the Vector tile search examples guide.
- ``_
+ ``_
:param index: Comma-separated list of data streams, indices, or aliases to search
:param field: Field containing geospatial data to return
@@ -5645,7 +5303,7 @@ async def search_shards(
If the Elasticsearch security features are enabled, you must have the view_index_metadata
or manage
index privilege for the target data stream, index, or alias.
- ``_
+ ``_
:param index: A comma-separated list of data streams, indices, and aliases to
search. It supports wildcards (`*`). To search all data streams and indices,
@@ -5658,7 +5316,7 @@ async def search_shards(
:param expand_wildcards: Type of index that wildcard patterns 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`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
+ as `open,hidden`.
:param ignore_unavailable: If `false`, the request returns an error if it targets
a missing or closed index.
:param local: If `true`, the request retrieves information from the local node
@@ -5746,7 +5404,7 @@ async def search_template(
search_type: t.Optional[
t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
] = None,
- source: t.Optional[str] = None,
+ source: t.Optional[t.Union[str, t.Mapping[str, t.Any]]] = None,
typed_keys: t.Optional[bool] = None,
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
@@ -5756,7 +5414,7 @@ async def search_template(
Run a search with a search template.
- ``_
+ ``_
:param index: A comma-separated list of data streams, indices, and aliases to
search. It supports wildcards (`*`).
@@ -5770,8 +5428,7 @@ async def search_template(
:param expand_wildcards: The type of index that wildcard patterns 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`. Valid values are: `all`, `open`, `closed`,
- `hidden`, `none`.
+ values, such as `open,hidden`.
:param explain: If `true`, returns detailed information about score calculation
as part of each hit. If you specify both this and the `explain` query parameter,
the API uses only the query parameter.
@@ -5899,7 +5556,7 @@ async def terms_enum(
- ``_
+ ``_
:param index: A comma-separated list of data streams, indices, and index aliases
to search. Wildcard (`*`) expressions are supported. To search all data streams
@@ -5969,7 +5626,20 @@ async def terms_enum(
)
@_rewrite_parameters(
- body_fields=("doc", "filter", "per_field_analyzer"),
+ body_fields=(
+ "doc",
+ "field_statistics",
+ "fields",
+ "filter",
+ "offsets",
+ "payloads",
+ "per_field_analyzer",
+ "positions",
+ "routing",
+ "term_statistics",
+ "version",
+ "version_type",
+ ),
)
async def termvectors(
self,
@@ -6032,10 +5702,11 @@ async def termvectors(
The information is only retrieved for the shard the requested document resides in.
The term and field statistics are therefore only useful as relative measures whereas the absolute numbers have no meaning in this context.
By default, when requesting term vectors of artificial documents, a shard to get the statistics from is randomly selected.
- Use routing
only to hit a particular shard.
+ Use routing
only to hit a particular shard.
+ Refer to the linked documentation for detailed examples of how to use this API.
- ``_
+ ``_
:param index: The name of the index that contains the document.
:param id: A unique identifier for the document.
@@ -6046,9 +5717,9 @@ async def termvectors(
(the sum of document frequencies for all terms in this field). * The sum
of total term frequencies (the sum of total term frequencies of each term
in this field).
- :param fields: A comma-separated list or wildcard expressions of fields to include
- in the statistics. It is used as the default list unless a specific field
- list is provided in the `completion_fields` or `fielddata_fields` parameters.
+ :param fields: A list of fields to include in the statistics. It is used as the
+ default list unless a specific field list is provided in the `completion_fields`
+ or `fielddata_fields` parameters.
:param filter: Filter terms based on their tf-idf scores. This could be useful
in order find out a good characteristic vector of a document. This feature
works in a similar manner to the second phase of the More Like This Query.
@@ -6086,41 +5757,41 @@ async def termvectors(
__body: t.Dict[str, t.Any] = body if body is not None else {}
if error_trace is not None:
__query["error_trace"] = error_trace
- if field_statistics is not None:
- __query["field_statistics"] = field_statistics
- if fields is not None:
- __query["fields"] = fields
if filter_path is not None:
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
- if offsets is not None:
- __query["offsets"] = offsets
- if payloads is not None:
- __query["payloads"] = payloads
- if positions is not None:
- __query["positions"] = positions
if preference is not None:
__query["preference"] = preference
if pretty is not None:
__query["pretty"] = pretty
if realtime is not None:
__query["realtime"] = realtime
- if routing is not None:
- __query["routing"] = routing
- if term_statistics is not None:
- __query["term_statistics"] = term_statistics
- if version is not None:
- __query["version"] = version
- if version_type is not None:
- __query["version_type"] = version_type
if not __body:
if doc is not None:
__body["doc"] = doc
+ if field_statistics is not None:
+ __body["field_statistics"] = field_statistics
+ if fields is not None:
+ __body["fields"] = fields
if filter is not None:
__body["filter"] = filter
+ if offsets is not None:
+ __body["offsets"] = offsets
+ if payloads is not None:
+ __body["payloads"] = payloads
if per_field_analyzer is not None:
__body["per_field_analyzer"] = per_field_analyzer
+ if positions is not None:
+ __body["positions"] = positions
+ if routing is not None:
+ __body["routing"] = routing
+ if term_statistics is not None:
+ __body["term_statistics"] = term_statistics
+ if version is not None:
+ __body["version"] = version
+ if version_type is not None:
+ __body["version_type"] = version_type
if not __body:
__body = None # type: ignore[assignment]
__headers = {"accept": "application/json"}
@@ -6203,10 +5874,11 @@ async def update(
The document must still be reindexed, but using this API removes some network roundtrips and reduces chances of version conflicts between the GET and the index operation.
The _source
field must be enabled to use this API.
- In addition to _source
, you can access the following variables through the ctx
map: _index
, _type
, _id
, _version
, _routing
, and _now
(the current timestamp).
+ In addition to _source
, you can access the following variables through the ctx
map: _index
, _type
, _id
, _version
, _routing
, and _now
(the current timestamp).
+ For usage examples such as partial updates, upserts, and scripted updates, see the External documentation.
- ``_
+ ``_
:param index: The name of the target index. By default, the index is created
automatically if it doesn't exist.
@@ -6396,6 +6068,24 @@ async def update_by_query(
A bulk update request is performed for each batch of matching documents.
Any query or update failures cause the update by query request to fail and the failures are shown in the response.
Any update requests that completed successfully still stick, they are not rolled back.
+ Refreshing shards
+ Specifying the refresh
parameter refreshes all shards once the request completes.
+ This is different to the update API's refresh
parameter, which causes only the shard
+ that received the request to be refreshed. Unlike the update API, it does not support
+ wait_for
.
+ Running update by query asynchronously
+ If the request contains wait_for_completion=false
, Elasticsearch
+ performs some preflight checks, launches the request, and returns a
+ task you can use to cancel or get the status of the task.
+ Elasticsearch creates a record of this task as a document at .tasks/task/${taskId}
.
+ Waiting for active shards
+ wait_for_active_shards
controls how many copies of a shard must be active
+ before proceeding with the request. See wait_for_active_shards
+ for details. timeout
controls how long each write request waits for unavailable
+ shards to become available. Both work exactly the way they work in the
+ Bulk API. Update by query uses scrolled searches, so you can also
+ specify the scroll
parameter to control how long it keeps the search context
+ alive, for example ?scroll=10m
. The default is 5 minutes.
Throttling update requests
To control the rate at which update by query issues batches of update operations, you can set requests_per_second
to any positive decimal number.
This pads each batch with a wait time to throttle the rate.
@@ -6430,21 +6120,11 @@ async def update_by_query(
Query performance is most efficient when the number of slices is equal to the number of shards in the index or backing index. If that number is large (for example, 500), choose a lower number as too many slices hurts performance. Setting slices higher than the number of shards generally does not improve efficiency and adds overhead.
Update performance scales linearly across available resources with the number of slices.
- Whether query or update performance dominates the runtime depends on the documents being reindexed and cluster resources.
- Update the document source
- Update by query supports scripts to update the document source.
- As with the update API, you can set ctx.op
to change the operation that is performed.
- Set ctx.op = "noop"
if your script decides that it doesn't have to make any changes.
- The update by query operation skips updating the document and increments the noop
counter.
- Set ctx.op = "delete"
if your script decides that the document should be deleted.
- The update by query operation deletes the document and increments the deleted
counter.
- Update by query supports only index
, noop
, and delete
.
- Setting ctx.op
to anything else is an error.
- Setting any other field in ctx
is an error.
- This API enables you to only modify the source of matching documents; you cannot move them.
-
-
- ``_
+ Whether query or update performance dominates the runtime depends on the documents being reindexed and cluster resources.
+ Refer to the linked documentation for examples of how to update documents using the _update_by_query
API:
+
+
+ ``_
:param index: A comma-separated list of data streams, indices, and aliases to
search. It supports wildcards (`*`). To search all data streams or indices,
@@ -6469,9 +6149,8 @@ async def update_by_query(
:param expand_wildcards: The type of index that wildcard patterns can match.
If the request can target data streams, this argument determines whether
wildcard expressions match hidden data streams. It supports comma-separated
- values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`,
- `hidden`, `none`.
- :param from_: Starting offset (default: 0)
+ values, such as `open,hidden`.
+ :param from_: Skips the specified number of documents.
:param ignore_unavailable: If `false`, the request returns an error if it targets
a missing or closed index.
:param lenient: If `true`, format-based query failures (such as providing text
@@ -6664,7 +6343,7 @@ async def update_by_query_rethrottle(
Rethrottling that speeds up the query takes effect immediately but rethrotting that slows down the query takes effect after completing the current batch to prevent scroll timeouts.
- ``_
+ ``_
:param task_id: The ID for the task.
:param requests_per_second: The throttle for this request in sub-requests per
diff --git a/elasticsearch/_async/client/_base.py b/elasticsearch/_async/client/_base.py
index dd0b0f44e..4e49e7156 100644
--- a/elasticsearch/_async/client/_base.py
+++ b/elasticsearch/_async/client/_base.py
@@ -174,7 +174,7 @@ async def sniff_callback(
"GET",
"/_nodes/_all/http",
headers={
- "accept": "application/vnd.elasticsearch+json; compatible-with=8"
+ "accept": "application/vnd.elasticsearch+json; compatible-with=9"
},
request_timeout=(
sniff_options.sniff_timeout
@@ -298,7 +298,6 @@ async def _perform_request(
def mimetype_header_to_compat(header: str) -> None:
# Converts all parts of a Accept/Content-Type headers
# from application/X -> application/vnd.elasticsearch+X
- nonlocal request_headers
mimetype = request_headers.get(header, None)
if mimetype:
request_headers[header] = _COMPAT_MIMETYPE_RE.sub(
diff --git a/elasticsearch/_async/client/async_search.py b/elasticsearch/_async/client/async_search.py
index b667d9463..7b7a76144 100644
--- a/elasticsearch/_async/client/async_search.py
+++ b/elasticsearch/_async/client/async_search.py
@@ -44,7 +44,7 @@ async def delete(
If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the cancel_task
cluster privilege.
- ``_
+ ``_
:param id: A unique identifier for the async search.
"""
@@ -94,7 +94,7 @@ async def get(
If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it.
- ``_
+ ``_
:param id: A unique identifier for the async search.
:param keep_alive: The length of time that the async search should be available
@@ -164,7 +164,7 @@ async def status(
- ``_
+ ``_
:param id: A unique identifier for the async search.
:param keep_alive: The length of time that the async search needs to be available.
@@ -345,7 +345,7 @@ async def submit(
The maximum allowed size for a stored async search response can be set by changing the search.max_async_search_response_size
cluster level setting.
- ``_
+ ``_
:param index: A comma-separated list of index names to search; use `_all` or
empty string to perform the operation on all indices
@@ -401,7 +401,7 @@ async def submit(
limit the impact of the search on the cluster in order to limit the number
of concurrent shard requests
:param min_score: Minimum _score for matching documents. Documents with a lower
- _score are not included in the search results.
+ _score are not included in search results and results collected by aggregations.
:param pit: Limits the search to a point in time (PIT). If you provide a PIT,
you cannot specify an in the request path.
:param post_filter:
diff --git a/elasticsearch/_async/client/autoscaling.py b/elasticsearch/_async/client/autoscaling.py
index 5b41caa38..f0a3dd1a9 100644
--- a/elasticsearch/_async/client/autoscaling.py
+++ b/elasticsearch/_async/client/autoscaling.py
@@ -44,7 +44,7 @@ async def delete_autoscaling_policy(
NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.
- ``_
+ ``_
:param name: the name of the autoscaling policy
:param master_timeout: Period to wait for a connection to the master node. If
@@ -104,7 +104,7 @@ async def get_autoscaling_capacity(
Do not use this information to make autoscaling decisions.
- ``_
+ ``_
:param master_timeout: Period to wait for a connection to the master node. If
no response is received before the timeout expires, the request fails and
@@ -151,7 +151,7 @@ async def get_autoscaling_policy(
NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.
- ``_
+ ``_
:param name: the name of the autoscaling policy
:param master_timeout: Period to wait for a connection to the master node. If
@@ -206,7 +206,7 @@ async def put_autoscaling_policy(
NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.
- ``_
+ ``_
:param name: the name of the autoscaling policy
:param policy:
diff --git a/elasticsearch/_async/client/cat.py b/elasticsearch/_async/client/cat.py
index 299ee83ac..55aaded74 100644
--- a/elasticsearch/_async/client/cat.py
+++ b/elasticsearch/_async/client/cat.py
@@ -64,7 +64,7 @@ async def aliases(
IMPORTANT: CAT APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API.
- ``_
+ ``_
:param name: A comma-separated list of aliases to retrieve. Supports wildcards
(`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`.
@@ -154,7 +154,7 @@ async def allocation(
IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.
- ``_
+ ``_
:param node_id: A comma-separated list of node identifiers or names used to limit
the returned information.
@@ -243,7 +243,7 @@ async def component_templates(
They are not intended for use by applications. For application consumption, use the get component template API.
- ``_
+ ``_
:param name: The name of the component template. It accepts wildcard expressions.
If it is omitted, all component templates are returned.
@@ -327,7 +327,7 @@ async def count(
They are not intended for use by applications. For application consumption, use the count API.
- ``_
+ ``_
:param index: A comma-separated list of data streams, indices, and aliases used
to limit the request. It supports wildcards (`*`). To target all data streams
@@ -405,7 +405,7 @@ async def fielddata(
They are not intended for use by applications. For application consumption, use the nodes stats API.
- ``_
+ ``_
:param fields: Comma-separated list of fields used to limit returned information.
To retrieve all fields, omit this parameter.
@@ -491,7 +491,7 @@ async def health(
You also can use the API to track the recovery of a large cluster over a longer period of time.
- ``_
+ ``_
:param format: Specifies the format to return the columnar data in, can be set
to `text`, `json`, `cbor`, `yaml`, or `smile`.
@@ -549,7 +549,7 @@ async def help(self) -> TextApiResponse:
Get help for the CAT APIs.
- ``_
+ ``_
"""
__path_parts: t.Dict[str, str] = {}
__path = "/_cat"
@@ -584,7 +584,9 @@ async def indices(
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
format: t.Optional[str] = None,
h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
- health: t.Optional[t.Union[str, t.Literal["green", "red", "yellow"]]] = None,
+ health: t.Optional[
+ t.Union[str, t.Literal["green", "red", "unavailable", "unknown", "yellow"]]
+ ] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
include_unloaded_segments: t.Optional[bool] = None,
@@ -616,7 +618,7 @@ async def indices(
They are not intended for use by applications. For application consumption, use an index endpoint.
- ``_
+ ``_
:param index: Comma-separated list of data streams, indices, and aliases used
to limit the request. Supports wildcards (`*`). To target all data streams
@@ -714,7 +716,7 @@ async def master(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.
- ``_
+ ``_
:param format: Specifies the format to return the columnar data in, can be set
to `text`, `json`, `cbor`, `yaml`, or `smile`.
@@ -892,7 +894,7 @@ async def ml_data_frame_analytics(
application consumption, use the get data frame analytics jobs statistics API.
- ``_
+ ``_
:param id: The ID of the data frame analytics to fetch
:param allow_no_match: Whether to ignore if a wildcard expression matches no
@@ -1060,7 +1062,7 @@ async def ml_datafeeds(
application consumption, use the get datafeed statistics API.
- ``_
+ ``_
:param datafeed_id: A numerical character string that uniquely identifies the
datafeed.
@@ -1426,7 +1428,7 @@ async def ml_jobs(
application consumption, use the get anomaly detection job statistics API.
- ``_
+ ``_
:param job_id: Identifier for the anomaly detection job.
:param allow_no_match: Specifies what to do when the request: * Contains wildcard
@@ -1611,7 +1613,7 @@ async def ml_trained_models(
application consumption, use the get trained models statistics API.
- ``_
+ ``_
:param model_id: A unique identifier for the trained model.
:param allow_no_match: Specifies what to do when the request: contains wildcard
@@ -1704,7 +1706,7 @@ async def nodeattrs(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.
- ``_
+ ``_
:param format: Specifies the format to return the columnar data in, can be set
to `text`, `json`, `cbor`, `yaml`, or `smile`.
@@ -1767,7 +1769,200 @@ async def nodes(
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
format: t.Optional[str] = None,
full_id: t.Optional[t.Union[bool, str]] = None,
- h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
+ h: t.Optional[
+ t.Union[
+ t.Sequence[
+ t.Union[
+ str,
+ t.Literal[
+ "build",
+ "completion.size",
+ "cpu",
+ "disk.avail",
+ "disk.total",
+ "disk.used",
+ "disk.used_percent",
+ "fielddata.evictions",
+ "fielddata.memory_size",
+ "file_desc.current",
+ "file_desc.max",
+ "file_desc.percent",
+ "flush.total",
+ "flush.total_time",
+ "get.current",
+ "get.exists_time",
+ "get.exists_total",
+ "get.missing_time",
+ "get.missing_total",
+ "get.time",
+ "get.total",
+ "heap.current",
+ "heap.max",
+ "heap.percent",
+ "http_address",
+ "id",
+ "indexing.delete_current",
+ "indexing.delete_time",
+ "indexing.delete_total",
+ "indexing.index_current",
+ "indexing.index_failed",
+ "indexing.index_failed_due_to_version_conflict",
+ "indexing.index_time",
+ "indexing.index_total",
+ "ip",
+ "jdk",
+ "load_15m",
+ "load_1m",
+ "load_5m",
+ "mappings.total_count",
+ "mappings.total_estimated_overhead_in_bytes",
+ "master",
+ "merges.current",
+ "merges.current_docs",
+ "merges.current_size",
+ "merges.total",
+ "merges.total_docs",
+ "merges.total_size",
+ "merges.total_time",
+ "name",
+ "node.role",
+ "pid",
+ "port",
+ "query_cache.evictions",
+ "query_cache.hit_count",
+ "query_cache.memory_size",
+ "query_cache.miss_count",
+ "ram.current",
+ "ram.max",
+ "ram.percent",
+ "refresh.time",
+ "refresh.total",
+ "request_cache.evictions",
+ "request_cache.hit_count",
+ "request_cache.memory_size",
+ "request_cache.miss_count",
+ "script.cache_evictions",
+ "script.compilations",
+ "search.fetch_current",
+ "search.fetch_time",
+ "search.fetch_total",
+ "search.open_contexts",
+ "search.query_current",
+ "search.query_time",
+ "search.query_total",
+ "search.scroll_current",
+ "search.scroll_time",
+ "search.scroll_total",
+ "segments.count",
+ "segments.fixed_bitset_memory",
+ "segments.index_writer_memory",
+ "segments.memory",
+ "segments.version_map_memory",
+ "shard_stats.total_count",
+ "suggest.current",
+ "suggest.time",
+ "suggest.total",
+ "uptime",
+ "version",
+ ],
+ ]
+ ],
+ t.Union[
+ str,
+ t.Literal[
+ "build",
+ "completion.size",
+ "cpu",
+ "disk.avail",
+ "disk.total",
+ "disk.used",
+ "disk.used_percent",
+ "fielddata.evictions",
+ "fielddata.memory_size",
+ "file_desc.current",
+ "file_desc.max",
+ "file_desc.percent",
+ "flush.total",
+ "flush.total_time",
+ "get.current",
+ "get.exists_time",
+ "get.exists_total",
+ "get.missing_time",
+ "get.missing_total",
+ "get.time",
+ "get.total",
+ "heap.current",
+ "heap.max",
+ "heap.percent",
+ "http_address",
+ "id",
+ "indexing.delete_current",
+ "indexing.delete_time",
+ "indexing.delete_total",
+ "indexing.index_current",
+ "indexing.index_failed",
+ "indexing.index_failed_due_to_version_conflict",
+ "indexing.index_time",
+ "indexing.index_total",
+ "ip",
+ "jdk",
+ "load_15m",
+ "load_1m",
+ "load_5m",
+ "mappings.total_count",
+ "mappings.total_estimated_overhead_in_bytes",
+ "master",
+ "merges.current",
+ "merges.current_docs",
+ "merges.current_size",
+ "merges.total",
+ "merges.total_docs",
+ "merges.total_size",
+ "merges.total_time",
+ "name",
+ "node.role",
+ "pid",
+ "port",
+ "query_cache.evictions",
+ "query_cache.hit_count",
+ "query_cache.memory_size",
+ "query_cache.miss_count",
+ "ram.current",
+ "ram.max",
+ "ram.percent",
+ "refresh.time",
+ "refresh.total",
+ "request_cache.evictions",
+ "request_cache.hit_count",
+ "request_cache.memory_size",
+ "request_cache.miss_count",
+ "script.cache_evictions",
+ "script.compilations",
+ "search.fetch_current",
+ "search.fetch_time",
+ "search.fetch_total",
+ "search.open_contexts",
+ "search.query_current",
+ "search.query_time",
+ "search.query_total",
+ "search.scroll_current",
+ "search.scroll_time",
+ "search.scroll_total",
+ "segments.count",
+ "segments.fixed_bitset_memory",
+ "segments.index_writer_memory",
+ "segments.memory",
+ "segments.version_map_memory",
+ "shard_stats.total_count",
+ "suggest.current",
+ "suggest.time",
+ "suggest.total",
+ "uptime",
+ "version",
+ ],
+ ],
+ ]
+ ] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
include_unloaded_segments: t.Optional[bool] = None,
@@ -1787,23 +1982,24 @@ async def nodes(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.
- ``_
+ ``_
:param bytes: The unit used to display byte values.
:param format: Specifies the format to return the columnar data in, can be set
to `text`, `json`, `cbor`, `yaml`, or `smile`.
:param full_id: If `true`, return the full node ID. If `false`, return the shortened
node ID.
- :param h: List of columns to appear in the response. Supports simple wildcards.
+ :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 include_unloaded_segments: If true, the response includes information
from segments that are not loaded into memory.
- :param master_timeout: Period to wait for a connection to the master node.
- :param s: List of columns that determine how the table should be sorted. Sorting
- defaults to ascending and can be changed by setting `:asc` or `:desc` as
- a suffix to the column name.
- :param time: Unit used to display time values.
+ :param master_timeout: The period to wait for a connection to the master node.
+ :param s: A comma-separated list of column names or aliases that determines the
+ sort order. Sorting defaults to ascending and can be changed by setting `:asc`
+ or `:desc` as a suffix to the column name.
+ :param time: The unit used to display time values.
:param v: When set to `true` will enable verbose output.
"""
__path_parts: t.Dict[str, str] = {}
@@ -1874,7 +2070,7 @@ async def pending_tasks(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the pending cluster tasks API.
- ``_
+ ``_
:param format: Specifies the format to return the columnar data in, can be set
to `text`, `json`, `cbor`, `yaml`, or `smile`.
@@ -1954,7 +2150,7 @@ async def plugins(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.
- ``_
+ ``_
:param format: Specifies the format to return the columnar data in, can be set
to `text`, `json`, `cbor`, `yaml`, or `smile`.
@@ -2022,7 +2218,74 @@ async def recovery(
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
format: t.Optional[str] = None,
- h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
+ h: t.Optional[
+ t.Union[
+ t.Sequence[
+ t.Union[
+ str,
+ t.Literal[
+ "bytes",
+ "bytes_percent",
+ "bytes_recovered",
+ "bytes_total",
+ "files",
+ "files_percent",
+ "files_recovered",
+ "files_total",
+ "index",
+ "repository",
+ "shard",
+ "snapshot",
+ "source_host",
+ "source_node",
+ "stage",
+ "start_time",
+ "start_time_millis",
+ "stop_time",
+ "stop_time_millis",
+ "target_host",
+ "target_node",
+ "time",
+ "translog_ops",
+ "translog_ops_percent",
+ "translog_ops_recovered",
+ "type",
+ ],
+ ]
+ ],
+ t.Union[
+ str,
+ t.Literal[
+ "bytes",
+ "bytes_percent",
+ "bytes_recovered",
+ "bytes_total",
+ "files",
+ "files_percent",
+ "files_recovered",
+ "files_total",
+ "index",
+ "repository",
+ "shard",
+ "snapshot",
+ "source_host",
+ "source_node",
+ "stage",
+ "start_time",
+ "start_time_millis",
+ "stop_time",
+ "stop_time_millis",
+ "target_host",
+ "target_node",
+ "time",
+ "translog_ops",
+ "translog_ops_percent",
+ "translog_ops_recovered",
+ "type",
+ ],
+ ],
+ ]
+ ] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
@@ -2042,7 +2305,7 @@ async def recovery(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index recovery API.
- ``_
+ ``_
:param index: A comma-separated list of data streams, indices, and aliases used
to limit the request. Supports wildcards (`*`). To target all data streams
@@ -2053,13 +2316,14 @@ async def recovery(
shard recoveries.
:param format: Specifies the format to return the columnar data in, can be set
to `text`, `json`, `cbor`, `yaml`, or `smile`.
- :param h: List of columns to appear in the response. Supports simple wildcards.
+ :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 s: List of columns that determine how the table should be sorted. Sorting
- defaults to ascending and can be changed by setting `:asc` or `:desc` as
- a suffix to the column name.
- :param time: Unit used to display time values.
+ :param s: A comma-separated list of column names or aliases that determines the
+ sort order. Sorting defaults to ascending and can be changed by setting `:asc`
+ or `:desc` as a suffix to the column name.
+ :param time: The unit used to display time values.
:param v: When set to `true` will enable verbose output.
"""
__path_parts: t.Dict[str, str]
@@ -2130,7 +2394,7 @@ async def repositories(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot repository API.
- ``_
+ ``_
:param format: Specifies the format to return the columnar data in, can be set
to `text`, `json`, `cbor`, `yaml`, or `smile`.
@@ -2193,7 +2457,52 @@ async def segments(
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
format: t.Optional[str] = None,
- h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
+ h: t.Optional[
+ t.Union[
+ t.Sequence[
+ t.Union[
+ str,
+ t.Literal[
+ "committed",
+ "compound",
+ "docs.count",
+ "docs.deleted",
+ "generation",
+ "id",
+ "index",
+ "ip",
+ "prirep",
+ "searchable",
+ "segment",
+ "shard",
+ "size",
+ "size.memory",
+ "version",
+ ],
+ ]
+ ],
+ t.Union[
+ str,
+ t.Literal[
+ "committed",
+ "compound",
+ "docs.count",
+ "docs.deleted",
+ "generation",
+ "id",
+ "index",
+ "ip",
+ "prirep",
+ "searchable",
+ "segment",
+ "shard",
+ "size",
+ "size.memory",
+ "version",
+ ],
+ ],
+ ]
+ ] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
local: t.Optional[bool] = None,
@@ -2211,7 +2520,7 @@ async def segments(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index segments API.
- ``_
+ ``_
:param index: A comma-separated list of data streams, indices, and aliases used
to limit the request. Supports wildcards (`*`). To target all data streams
@@ -2219,7 +2528,8 @@ async def segments(
:param bytes: The unit used to display byte values.
:param format: Specifies the format to return the columnar data in, can be set
to `text`, `json`, `cbor`, `yaml`, or `smile`.
- :param h: List of columns to appear in the response. Supports simple wildcards.
+ :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 local: If `true`, the request computes the list of selected nodes from
@@ -2227,9 +2537,9 @@ async def segments(
from the cluster state of the master node. In both cases the coordinating
node will send requests for further information to each selected node.
:param master_timeout: Period to wait for a connection to the master node.
- :param s: List of columns that determine how the table should be sorted. Sorting
- defaults to ascending and can be changed by setting `:asc` or `:desc` as
- a suffix to the column name.
+ :param s: A comma-separated list of column names or aliases that determines the
+ sort order. Sorting defaults to ascending and can be changed by setting `:asc`
+ or `:desc` as a suffix to the column name.
:param v: When set to `true` will enable verbose output.
"""
__path_parts: t.Dict[str, str]
@@ -2285,7 +2595,162 @@ async def shards(
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
format: t.Optional[str] = None,
- h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
+ h: t.Optional[
+ t.Union[
+ t.Sequence[
+ t.Union[
+ str,
+ t.Literal[
+ "completion.size",
+ "dataset.size",
+ "dense_vector.value_count",
+ "docs",
+ "dsparse_vector.value_count",
+ "fielddata.evictions",
+ "fielddata.memory_size",
+ "flush.total",
+ "flush.total_time",
+ "get.current",
+ "get.exists_time",
+ "get.exists_total",
+ "get.missing_time",
+ "get.missing_total",
+ "get.time",
+ "get.total",
+ "id",
+ "index",
+ "indexing.delete_current",
+ "indexing.delete_time",
+ "indexing.delete_total",
+ "indexing.index_current",
+ "indexing.index_failed",
+ "indexing.index_failed_due_to_version_conflict",
+ "indexing.index_time",
+ "indexing.index_total",
+ "ip",
+ "merges.current",
+ "merges.current_docs",
+ "merges.current_size",
+ "merges.total",
+ "merges.total_docs",
+ "merges.total_size",
+ "merges.total_time",
+ "node",
+ "prirep",
+ "query_cache.evictions",
+ "query_cache.memory_size",
+ "recoverysource.type",
+ "refresh.time",
+ "refresh.total",
+ "search.fetch_current",
+ "search.fetch_time",
+ "search.fetch_total",
+ "search.open_contexts",
+ "search.query_current",
+ "search.query_time",
+ "search.query_total",
+ "search.scroll_current",
+ "search.scroll_time",
+ "search.scroll_total",
+ "segments.count",
+ "segments.fixed_bitset_memory",
+ "segments.index_writer_memory",
+ "segments.memory",
+ "segments.version_map_memory",
+ "seq_no.global_checkpoint",
+ "seq_no.local_checkpoint",
+ "seq_no.max",
+ "shard",
+ "state",
+ "store",
+ "suggest.current",
+ "suggest.time",
+ "suggest.total",
+ "sync_id",
+ "unassigned.at",
+ "unassigned.details",
+ "unassigned.for",
+ "unassigned.reason",
+ ],
+ ]
+ ],
+ t.Union[
+ str,
+ t.Literal[
+ "completion.size",
+ "dataset.size",
+ "dense_vector.value_count",
+ "docs",
+ "dsparse_vector.value_count",
+ "fielddata.evictions",
+ "fielddata.memory_size",
+ "flush.total",
+ "flush.total_time",
+ "get.current",
+ "get.exists_time",
+ "get.exists_total",
+ "get.missing_time",
+ "get.missing_total",
+ "get.time",
+ "get.total",
+ "id",
+ "index",
+ "indexing.delete_current",
+ "indexing.delete_time",
+ "indexing.delete_total",
+ "indexing.index_current",
+ "indexing.index_failed",
+ "indexing.index_failed_due_to_version_conflict",
+ "indexing.index_time",
+ "indexing.index_total",
+ "ip",
+ "merges.current",
+ "merges.current_docs",
+ "merges.current_size",
+ "merges.total",
+ "merges.total_docs",
+ "merges.total_size",
+ "merges.total_time",
+ "node",
+ "prirep",
+ "query_cache.evictions",
+ "query_cache.memory_size",
+ "recoverysource.type",
+ "refresh.time",
+ "refresh.total",
+ "search.fetch_current",
+ "search.fetch_time",
+ "search.fetch_total",
+ "search.open_contexts",
+ "search.query_current",
+ "search.query_time",
+ "search.query_total",
+ "search.scroll_current",
+ "search.scroll_time",
+ "search.scroll_total",
+ "segments.count",
+ "segments.fixed_bitset_memory",
+ "segments.index_writer_memory",
+ "segments.memory",
+ "segments.version_map_memory",
+ "seq_no.global_checkpoint",
+ "seq_no.local_checkpoint",
+ "seq_no.max",
+ "shard",
+ "state",
+ "store",
+ "suggest.current",
+ "suggest.time",
+ "suggest.total",
+ "sync_id",
+ "unassigned.at",
+ "unassigned.details",
+ "unassigned.for",
+ "unassigned.reason",
+ ],
+ ],
+ ]
+ ] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -2305,7 +2770,7 @@ async def shards(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.
- ``_
+ ``_
:param index: A comma-separated list of data streams, indices, and aliases used
to limit the request. Supports wildcards (`*`). To target all data streams
@@ -2316,11 +2781,11 @@ async def shards(
:param h: List of columns to appear in the response. 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 master_timeout: Period to wait for a connection to the master node.
- :param s: List of columns that determine how the table should be sorted. Sorting
- defaults to ascending and can be changed by setting `:asc` or `:desc` as
- a suffix to the column name.
- :param time: Unit used to display time values.
+ :param master_timeout: The period to wait for a connection to the master node.
+ :param s: A comma-separated list of column names or aliases that determines the
+ sort order. Sorting defaults to ascending and can be changed by setting `:asc`
+ or `:desc` as a suffix to the column name.
+ :param time: The unit used to display time values.
:param v: When set to `true` will enable verbose output.
"""
__path_parts: t.Dict[str, str]
@@ -2373,7 +2838,48 @@ async def snapshots(
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
format: t.Optional[str] = None,
- h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
+ h: t.Optional[
+ t.Union[
+ t.Sequence[
+ t.Union[
+ str,
+ t.Literal[
+ "duration",
+ "end_epoch",
+ "end_time",
+ "failed_shards",
+ "id",
+ "indices",
+ "reason",
+ "repository",
+ "start_epoch",
+ "start_time",
+ "status",
+ "successful_shards",
+ "total_shards",
+ ],
+ ]
+ ],
+ t.Union[
+ str,
+ t.Literal[
+ "duration",
+ "end_epoch",
+ "end_time",
+ "failed_shards",
+ "id",
+ "indices",
+ "reason",
+ "repository",
+ "start_epoch",
+ "start_time",
+ "status",
+ "successful_shards",
+ "total_shards",
+ ],
+ ],
+ ]
+ ] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
ignore_unavailable: t.Optional[bool] = None,
@@ -2394,14 +2900,15 @@ async def snapshots(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot API.
- ``_
+ ``_
:param repository: A comma-separated list of snapshot repositories used to limit
the request. Accepts wildcard expressions. `_all` returns all repositories.
If any repository fails during the request, Elasticsearch returns an error.
:param format: Specifies the format to return the columnar data in, can be set
to `text`, `json`, `cbor`, `yaml`, or `smile`.
- :param h: List of columns to appear in the response. Supports simple wildcards.
+ :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_unavailable: If `true`, the response does not include information
@@ -2487,7 +2994,7 @@ async def tasks(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the task management API.
- ``_
+ ``_
:param actions: The task action names, which are used to limit the response.
:param detailed: If `true`, the response includes detailed information about
@@ -2581,7 +3088,7 @@ async def templates(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get index template API.
- ``_
+ ``_
:param name: The name of the template to return. Accepts wildcard expressions.
If omitted, all templates are returned.
@@ -2648,7 +3155,62 @@ async def thread_pool(
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
format: t.Optional[str] = None,
- h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
+ h: t.Optional[
+ t.Union[
+ t.Sequence[
+ t.Union[
+ str,
+ t.Literal[
+ "active",
+ "completed",
+ "core",
+ "ephemeral_id",
+ "host",
+ "ip",
+ "keep_alive",
+ "largest",
+ "max",
+ "name",
+ "node_id",
+ "node_name",
+ "pid",
+ "pool_size",
+ "port",
+ "queue",
+ "queue_size",
+ "rejected",
+ "size",
+ "type",
+ ],
+ ]
+ ],
+ t.Union[
+ str,
+ t.Literal[
+ "active",
+ "completed",
+ "core",
+ "ephemeral_id",
+ "host",
+ "ip",
+ "keep_alive",
+ "largest",
+ "max",
+ "name",
+ "node_id",
+ "node_name",
+ "pid",
+ "pool_size",
+ "port",
+ "queue",
+ "queue_size",
+ "rejected",
+ "size",
+ "type",
+ ],
+ ],
+ ]
+ ] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
local: t.Optional[bool] = None,
@@ -2669,7 +3231,7 @@ async def thread_pool(
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.
- ``_
+ ``_
:param thread_pool_patterns: A comma-separated list of thread pool names used
to limit the request. Accepts wildcard expressions.
@@ -2682,10 +3244,10 @@ async def thread_pool(
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
node will send requests for further information to each selected node.
- :param master_timeout: Period to wait for a connection to the master node.
- :param s: List of columns that determine how the table should be sorted. Sorting
- defaults to ascending and can be changed by setting `:asc` or `:desc` as
- a suffix to the column name.
+ :param master_timeout: The period to wait for a connection to the master node.
+ :param s: A comma-separated list of column names or aliases that determines the
+ sort order. Sorting defaults to ascending and can be changed by setting `:asc`
+ or `:desc` as a suffix to the column name.
:param time: The unit used to display time values.
:param v: When set to `true` will enable verbose output.
"""
@@ -2926,7 +3488,7 @@ async def transforms(
application consumption, use the get transform statistics API.
- ``_
+ ``_
:param transform_id: A transform identifier or a wildcard expression. If you
do not specify one of these options, the API returns information for all
diff --git a/elasticsearch/_async/client/ccr.py b/elasticsearch/_async/client/ccr.py
index a98428ffb..6617f2403 100644
--- a/elasticsearch/_async/client/ccr.py
+++ b/elasticsearch/_async/client/ccr.py
@@ -43,7 +43,7 @@ async def delete_auto_follow_pattern(
Delete a collection of cross-cluster replication auto-follow patterns.
- ``_
+ ``_
:param name: The auto-follow pattern collection to delete.
:param master_timeout: The period to wait for a connection to the master node.
@@ -130,7 +130,7 @@ async def follow(
When the API returns, the follower index exists and cross-cluster replication starts replicating operations from the leader index to the follower index.
- ``_
+ ``_
:param index: The name of the follower index.
:param leader_index: The name of the index in the leader cluster to follow.
@@ -259,7 +259,7 @@ async def follow_info(
For example, the results include follower index names, leader index names, replication options, and whether the follower indices are active or paused.
- ``_
+ ``_
:param index: A comma-delimited list of follower index patterns.
:param master_timeout: The period to wait for a connection to the master node.
@@ -311,7 +311,7 @@ async def follow_stats(
The API returns shard-level stats about the "following tasks" associated with each shard for the specified indices.
- ``_
+ ``_
:param index: A comma-delimited list of index patterns.
:param timeout: The period to wait for a response. If no response is received
@@ -380,7 +380,7 @@ async def forget_follower(
The only purpose of this API is to handle the case of failure to remove the following retention leases after the unfollow API is invoked.
- ``_
+ ``_
:param index: the name of the leader index for which specified follower retention
leases should be removed
@@ -445,7 +445,7 @@ async def get_auto_follow_pattern(
Get cross-cluster replication auto-follow patterns.
- ``_
+ ``_
:param name: The auto-follow pattern collection that you want to retrieve. If
you do not specify a name, the API returns information for all collections.
@@ -505,7 +505,7 @@ async def pause_auto_follow_pattern(
Remote indices that were created while the pattern was paused will also be followed, unless they have been deleted or closed in the interim.
- ``_
+ ``_
:param name: The name of the auto-follow pattern to pause.
:param master_timeout: The period to wait for a connection to the master node.
@@ -559,7 +559,7 @@ async def pause_follow(
You can pause and resume a follower index to change the configuration of the following task.
- ``_
+ ``_
:param index: The name of the follower index.
:param master_timeout: The period to wait for a connection to the master node.
@@ -648,7 +648,7 @@ async def put_auto_follow_pattern(
NOTE: Follower indices that were configured automatically before updating an auto-follow pattern will remain unchanged even if they do not match against the new patterns.
- ``_
+ ``_
:param name: The name of the collection of auto-follow patterns.
:param remote_cluster: The remote cluster containing the leader indices to match
@@ -782,7 +782,7 @@ async def resume_auto_follow_pattern(
Remote indices created while the pattern was paused will also be followed unless they have been deleted or closed in the interim.
- ``_
+ ``_
:param name: The name of the auto-follow pattern to resume.
:param master_timeout: The period to wait for a connection to the master node.
@@ -860,7 +860,7 @@ async def resume_follow(
When this API returns, the follower index will resume fetching operations from the leader index.
- ``_
+ ``_
:param index: The name of the follow index to resume following.
:param master_timeout: Period to wait for a connection to the master node.
@@ -951,7 +951,7 @@ async def stats(
This API returns stats about auto-following and the same shard-level stats as the get follower stats API.
- ``_
+ ``_
:param master_timeout: The period to wait for a connection to the master node.
If the master node is not available before the timeout expires, the request
@@ -1009,7 +1009,7 @@ async def unfollow(
- ``_
+ ``_
:param index: The name of the follower index.
:param master_timeout: The period to wait for a connection to the master node.
diff --git a/elasticsearch/_async/client/cluster.py b/elasticsearch/_async/client/cluster.py
index 074bdc0e8..ee8036536 100644
--- a/elasticsearch/_async/client/cluster.py
+++ b/elasticsearch/_async/client/cluster.py
@@ -51,10 +51,11 @@ async def allocation_explain(
Get explanations for shard allocations in the cluster.
For unassigned shards, it provides an explanation for why the shard is unassigned.
For assigned shards, it provides an explanation for why the shard is remaining on its current node and has not moved or rebalanced to another node.
- This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise.
+ This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise.
+ Refer to the linked documentation for examples of how to troubleshoot allocation issues using this API.
- ``_
+ ``_
:param current_node: Specifies the node ID or the name of the node to only explain
a shard that is currently located on the specified node.
@@ -130,7 +131,7 @@ async def delete_component_template(
Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
- ``_
+ ``_
:param name: Comma-separated list or wildcard expression of component template
names used to limit the request.
@@ -185,7 +186,7 @@ async def delete_voting_config_exclusions(
Remove master-eligible nodes from the voting configuration exclusion list.
- ``_
+ ``_
:param master_timeout: Period to wait for a connection to the master node.
:param wait_for_removal: Specifies whether to wait for all excluded nodes to
@@ -239,7 +240,7 @@ async def exists_component_template(
Returns information about whether a particular component template exists.
- ``_
+ ``_
:param name: Comma-separated list of component template names used to limit the
request. Wildcard (*) expressions are supported.
@@ -290,6 +291,7 @@ async def get_component_template(
local: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
+ settings_filter: t.Optional[t.Union[str, t.Sequence[str]]] = None,
) -> ObjectApiResponse[t.Any]:
"""
.. raw:: html
@@ -298,7 +300,7 @@ async def get_component_template(
Get information about component templates.
- ``_
+ ``_
:param name: Comma-separated list of component template names used to limit the
request. Wildcard (`*`) expressions are supported.
@@ -310,6 +312,8 @@ async def get_component_template(
:param master_timeout: Period to wait for a connection to the master node. If
no response is received before the timeout expires, the request fails and
returns an error.
+ :param settings_filter: Filter out results, for example to filter out sensitive
+ information. Supports wildcards or full settings keys
"""
__path_parts: t.Dict[str, str]
if name not in SKIP_IN_PATH:
@@ -335,6 +339,8 @@ async def get_component_template(
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
+ if settings_filter is not None:
+ __query["settings_filter"] = settings_filter
__headers = {"accept": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"GET",
@@ -365,7 +371,7 @@ async def get_settings(
By default, it returns only settings that have been explicitly defined.
- ``_
+ ``_
:param flat_settings: If `true`, returns settings in flat format.
:param include_defaults: If `true`, returns default cluster settings from the
@@ -441,7 +447,7 @@ async def health(
wait_for_no_relocating_shards: t.Optional[bool] = None,
wait_for_nodes: t.Optional[t.Union[int, str]] = None,
wait_for_status: t.Optional[
- t.Union[str, t.Literal["green", "red", "yellow"]]
+ t.Union[str, t.Literal["green", "red", "unavailable", "unknown", "yellow"]]
] = None,
) -> ObjectApiResponse[t.Any]:
"""
@@ -457,7 +463,7 @@ async def health(
The cluster status is controlled by the worst index status.
- ``_
+ ``_
:param index: Comma-separated list of data streams, indices, and index aliases
used to limit the request. Wildcard expressions (`*`) are supported. To target
@@ -565,7 +571,7 @@ async def info(
Returns basic information about the cluster.
- ``_
+ ``_
:param target: Limits the information returned to the specific target. Supports
a comma-separated list, such as http,ingest.
@@ -614,7 +620,7 @@ async def pending_tasks(
However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API.
- ``_
+ ``_
:param local: If `true`, the request retrieves information from the local node
only. If `false`, information is retrieved from the master node.
@@ -680,7 +686,7 @@ async def post_voting_config_exclusions(
They are not required when removing master-ineligible nodes or when removing fewer than half of the master-eligible nodes.
- ``_
+ ``_
:param master_timeout: Period to wait for a connection to the master node.
:param node_ids: A comma-separated list of the persistent ids of the nodes to
@@ -731,6 +737,7 @@ 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,
@@ -761,7 +768,7 @@ async def put_component_template(
To be applied, a component template must be included in an index template's composed_of
list.
- ``_
+ ``_
:param name: Name of the component template to create. Elasticsearch includes
the following built-in component templates: `logs-mappings`; `logs-settings`;
@@ -774,6 +781,7 @@ async def put_component_template(
update settings API.
:param template: The template to be applied which includes mappings, settings,
or aliases configuration.
+ :param cause: User defined reason for create the component template.
:param create: If `true`, this request cannot replace or update existing component
templates.
:param deprecated: Marks this index template as deprecated. When creating or
@@ -798,6 +806,8 @@ 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:
@@ -866,13 +876,13 @@ async def put_settings(
If a cluster becomes unstable, transient settings can clear unexpectedly, resulting in a potentially undesired cluster configuration.
- ``_
+ ``_
:param flat_settings: Return settings in flat format (default: false)
:param master_timeout: Explicit operation timeout for connection to master node
- :param persistent:
+ :param persistent: The settings that persist after the cluster restarts.
:param timeout: Explicit operation timeout
- :param transient:
+ :param transient: The settings that do not persist after the cluster restarts.
"""
__path_parts: t.Dict[str, str] = {}
__path = "/_cluster/settings"
@@ -932,7 +942,7 @@ async def remote_info(
- ``_
+ ``_
"""
__path_parts: t.Dict[str, str] = {}
__path = "/_remote/info"
@@ -989,7 +999,7 @@ async def reroute(
Once the problem has been corrected, allocation can be manually retried by calling the reroute API with the ?retry_failed
URI query parameter, which will attempt a single retry round for these shards.
- ``_
+ ``_
:param commands: Defines the commands to perform.
:param dry_run: If true, then the request simulates the operation. It will calculate
@@ -1094,7 +1104,7 @@ async def state(
Instead, obtain the information you require using other more stable cluster APIs.
- ``_
+ ``_
:param metric: Limit the information returned to the specified metrics
:param index: A comma-separated list of index names; use `_all` or empty string
@@ -1182,7 +1192,7 @@ async def stats(
Get basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins).
- ``_
+ `