Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions elasticsearch/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ async def bulk(
<li>JavaScript: Check out <code>client.helpers.*</code></li>
<li>.NET: Check out <code>BulkAllObservable</code></li>
<li>PHP: Check out bulk indexing.</li>
<li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
</ul>
<p><strong>Submitting bulk requests with cURL</strong></p>
<p>If you're providing text file input to <code>curl</code>, you must use the <code>--data-binary</code> flag instead of plain <code>-d</code>.
Expand Down Expand Up @@ -1416,7 +1417,7 @@ async def delete(
)

@_rewrite_parameters(
body_fields=("max_docs", "query", "slice"),
body_fields=("max_docs", "query", "slice", "sort"),
parameter_aliases={"from": "from_"},
)
async def delete_by_query(
Expand Down Expand Up @@ -1460,7 +1461,12 @@ async def delete_by_query(
] = None,
slice: t.Optional[t.Mapping[str, t.Any]] = None,
slices: t.Optional[t.Union[int, t.Union[str, t.Literal["auto"]]]] = None,
sort: t.Optional[t.Sequence[str]] = None,
sort: t.Optional[
t.Union[
t.Sequence[t.Union[str, t.Mapping[str, t.Any]]],
t.Union[str, t.Mapping[str, t.Any]],
]
] = None,
stats: t.Optional[t.Sequence[str]] = None,
terminate_after: t.Optional[int] = None,
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
Expand Down Expand Up @@ -1592,7 +1598,7 @@ async def delete_by_query(
:param slice: Slice the request manually using the provided slice ID and total
number of slices.
:param slices: The number of slices this task should be divided into.
:param sort: A comma-separated list of `<field>:<direction>` pairs.
:param sort: A sort object that specifies the order of deleted documents.
:param stats: The specific `tag` of the request for logging and statistical purposes.
:param terminate_after: The maximum number of documents to collect for each shard.
If a query reaches this limit, Elasticsearch terminates the query early.
Expand Down Expand Up @@ -1682,8 +1688,6 @@ async def delete_by_query(
__query["search_type"] = search_type
if slices is not None:
__query["slices"] = slices
if sort is not None:
__query["sort"] = sort
if stats is not None:
__query["stats"] = stats
if terminate_after is not None:
Expand All @@ -1703,6 +1707,8 @@ async def delete_by_query(
__body["query"] = query
if slice is not None:
__body["slice"] = slice
if sort is not None:
__body["sort"] = sort
__headers = {"accept": "application/json", "content-type": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"POST",
Expand Down Expand Up @@ -6010,7 +6016,7 @@ async def termvectors(
doc: t.Optional[t.Mapping[str, t.Any]] = None,
error_trace: t.Optional[bool] = None,
field_statistics: t.Optional[bool] = None,
fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
fields: t.Optional[t.Sequence[str]] = None,
filter: t.Optional[t.Mapping[str, t.Any]] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
Expand Down
134 changes: 124 additions & 10 deletions elasticsearch/_async/client/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,34 @@ async def aliases(
] = 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[
"alias",
"filter",
"index",
"is_write_index",
"routing.index",
"routing.search",
],
]
],
t.Union[
str,
t.Literal[
"alias",
"filter",
"index",
"is_write_index",
"routing.index",
"routing.search",
],
],
]
] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
local: t.Optional[bool] = None,
Expand All @@ -74,7 +101,8 @@ async def aliases(
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: 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
Expand Down Expand Up @@ -137,7 +165,48 @@ async def allocation(
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[
"disk.avail",
"disk.indices",
"disk.indices.forecast",
"disk.percent",
"disk.total",
"disk.used",
"host",
"ip",
"node",
"node.role",
"shards",
"shards.undesired",
"write_load.forecast",
],
]
],
t.Union[
str,
t.Literal[
"disk.avail",
"disk.indices",
"disk.indices.forecast",
"disk.percent",
"disk.total",
"disk.used",
"host",
"ip",
"node",
"node.role",
"shards",
"shards.undesired",
"write_load.forecast",
],
],
]
] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
local: t.Optional[bool] = None,
Expand All @@ -161,7 +230,8 @@ async def allocation(
: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
Expand Down Expand Up @@ -224,7 +294,36 @@ async def component_templates(
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[
"alias_count",
"included_in",
"mapping_count",
"metadata_count",
"name",
"settings_count",
"version",
],
]
],
t.Union[
str,
t.Literal[
"alias_count",
"included_in",
"mapping_count",
"metadata_count",
"name",
"settings_count",
"version",
],
],
]
] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
local: t.Optional[bool] = None,
Expand All @@ -249,7 +348,8 @@ async def component_templates(
If it is omitted, all component templates are returned.
: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
Expand Down Expand Up @@ -310,7 +410,12 @@ async def count(
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["count", "epoch", "timestamp"]]],
t.Union[str, t.Literal["count", "epoch", "timestamp"]],
]
] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
Expand All @@ -334,7 +439,8 @@ async def count(
and indices, omit this parameter or use `*` or `_all`.
: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
Expand Down Expand Up @@ -389,7 +495,14 @@ async def fielddata(
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["field", "host", "id", "ip", "node", "size"]]
],
t.Union[str, t.Literal["field", "host", "id", "ip", "node", "size"]],
]
] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
Expand All @@ -412,7 +525,8 @@ async def fielddata(
: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 s: List of columns that determine how the table should be sorted. Sorting
Expand Down
9 changes: 7 additions & 2 deletions elasticsearch/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,13 @@ async def get_settings(
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.19/cluster-get-settings.html>`_
:param flat_settings: If `true`, returns settings in flat format.
:param include_defaults: If `true`, returns default cluster settings from the
local node.
:param include_defaults: If `true`, also returns default values for all other
cluster settings, reflecting the values in the `elasticsearch.yml` file of
one of the nodes in the cluster. If the nodes in your cluster do not all
have the same values in their `elasticsearch.yml` config files then the values
returned by this API may vary from invocation to invocation and may not reflect
the values that Elasticsearch uses in all situations. Use the `GET _nodes/settings`
API to fetch the settings for each individual node in your cluster.
: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.
Expand Down
19 changes: 13 additions & 6 deletions elasticsearch/_async/client/esql.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class EsqlClient(NamespacedClient):
async def async_query(
self,
*,
query: t.Optional[str] = None,
query: t.Optional[t.Union[str, "ESQLBase"]] = None,
allow_partial_results: t.Optional[bool] = None,
columnar: t.Optional[bool] = None,
delimiter: t.Optional[str] = None,
Expand Down Expand Up @@ -107,7 +107,12 @@ async def async_query(
which has the name of all the columns.
:param filter: Specify a Query DSL query in the filter parameter to filter the
set of documents that an ES|QL query runs on.
:param format: A short version of the Accept header, for example `json` or `yaml`.
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
`tsv`, and `txt` formats will return results in a tabular format, excluding
other metadata fields from the response. For async requests, nothing will
be returned if the async query doesn't finish within the timeout. The query
ID and running status are available in the `X-Elasticsearch-Async-Id` and
`X-Elasticsearch-Async-Is-Running` HTTP headers of the response, respectively.
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
query, the response will include an extra `_clusters` object with information
about the clusters that participated in the search along with info such as
Expand Down Expand Up @@ -161,7 +166,7 @@ async def async_query(
__query["pretty"] = pretty
if not __body:
if query is not None:
__body["query"] = query
__body["query"] = str(query)
if columnar is not None:
__body["columnar"] = columnar
if filter is not None:
Expand Down Expand Up @@ -399,7 +404,7 @@ async def async_query_stop(
async def query(
self,
*,
query: t.Optional[str] = None,
query: t.Optional[t.Union[str, "ESQLBase"]] = None,
allow_partial_results: t.Optional[bool] = None,
columnar: t.Optional[bool] = None,
delimiter: t.Optional[str] = None,
Expand Down Expand Up @@ -456,7 +461,9 @@ async def query(
`all_columns` which has the name of all columns.
:param filter: Specify a Query DSL query in the filter parameter to filter the
set of documents that an ES|QL query runs on.
:param format: A short version of the Accept header, e.g. json, yaml.
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
`tsv`, and `txt` formats will return results in a tabular format, excluding
other metadata fields from the response.
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
query, the response will include an extra `_clusters` object with information
about the clusters that participated in the search along with info such as
Expand Down Expand Up @@ -496,7 +503,7 @@ async def query(
__query["pretty"] = pretty
if not __body:
if query is not None:
__body["query"] = query
__body["query"] = str(query)
if columnar is not None:
__body["columnar"] = columnar
if filter is not None:
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch/_async/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -4581,7 +4581,7 @@ async def rollover(
.. raw:: html

<p>Roll over to a new index.
TIP: It is recommended to use the index lifecycle rollover action to automate rollovers.</p>
TIP: We recommend using the index lifecycle rollover action to automate rollovers. However, Serverless does not support Index Lifecycle Management (ILM), so don't use this approach in the Serverless context.</p>
<p>The rollover API creates a new index for a data stream or index alias.
The API behavior depends on the rollover target.</p>
<p><strong>Roll over a data stream</strong></p>
Expand Down
Loading
Loading