elasticsearch 9.0.2__py3-none-any.whl → 9.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- elasticsearch/_async/client/__init__.py +59 -202
- elasticsearch/_async/client/cat.py +1011 -59
- elasticsearch/_async/client/cluster.py +14 -4
- elasticsearch/_async/client/eql.py +10 -2
- elasticsearch/_async/client/esql.py +33 -10
- elasticsearch/_async/client/indices.py +88 -44
- elasticsearch/_async/client/inference.py +108 -3
- elasticsearch/_async/client/ingest.py +0 -7
- elasticsearch/_async/client/license.py +4 -4
- elasticsearch/_async/client/ml.py +6 -17
- elasticsearch/_async/client/monitoring.py +1 -1
- elasticsearch/_async/client/rollup.py +1 -22
- elasticsearch/_async/client/security.py +11 -17
- elasticsearch/_async/client/snapshot.py +6 -0
- elasticsearch/_async/client/sql.py +1 -1
- elasticsearch/_async/client/synonyms.py +1 -0
- elasticsearch/_async/client/transform.py +60 -0
- elasticsearch/_async/client/watcher.py +4 -2
- elasticsearch/_sync/client/__init__.py +59 -202
- elasticsearch/_sync/client/cat.py +1011 -59
- elasticsearch/_sync/client/cluster.py +14 -4
- elasticsearch/_sync/client/eql.py +10 -2
- elasticsearch/_sync/client/esql.py +33 -10
- elasticsearch/_sync/client/indices.py +88 -44
- elasticsearch/_sync/client/inference.py +108 -3
- elasticsearch/_sync/client/ingest.py +0 -7
- elasticsearch/_sync/client/license.py +4 -4
- elasticsearch/_sync/client/ml.py +6 -17
- elasticsearch/_sync/client/monitoring.py +1 -1
- elasticsearch/_sync/client/rollup.py +1 -22
- elasticsearch/_sync/client/security.py +11 -17
- elasticsearch/_sync/client/snapshot.py +6 -0
- elasticsearch/_sync/client/sql.py +1 -1
- elasticsearch/_sync/client/synonyms.py +1 -0
- elasticsearch/_sync/client/transform.py +60 -0
- elasticsearch/_sync/client/watcher.py +4 -2
- elasticsearch/_version.py +1 -1
- elasticsearch/compat.py +5 -0
- elasticsearch/dsl/__init__.py +2 -1
- elasticsearch/dsl/_async/document.py +84 -0
- elasticsearch/dsl/_sync/document.py +84 -0
- elasticsearch/dsl/document_base.py +219 -16
- elasticsearch/dsl/field.py +245 -57
- elasticsearch/dsl/query.py +7 -4
- elasticsearch/dsl/response/aggs.py +1 -1
- elasticsearch/dsl/types.py +125 -88
- elasticsearch/dsl/utils.py +2 -2
- elasticsearch/{dsl/_sync/_sync_check → esql}/__init__.py +3 -0
- elasticsearch/esql/esql.py +1156 -0
- elasticsearch/esql/functions.py +1750 -0
- {elasticsearch-9.0.2.dist-info → elasticsearch-9.0.4.dist-info}/METADATA +1 -3
- {elasticsearch-9.0.2.dist-info → elasticsearch-9.0.4.dist-info}/RECORD +55 -59
- elasticsearch/dsl/_sync/_sync_check/document.py +0 -514
- elasticsearch/dsl/_sync/_sync_check/faceted_search.py +0 -50
- elasticsearch/dsl/_sync/_sync_check/index.py +0 -597
- elasticsearch/dsl/_sync/_sync_check/mapping.py +0 -49
- elasticsearch/dsl/_sync/_sync_check/search.py +0 -230
- elasticsearch/dsl/_sync/_sync_check/update_by_query.py +0 -45
- {elasticsearch-9.0.2.dist-info → elasticsearch-9.0.4.dist-info}/WHEEL +0 -0
- {elasticsearch-9.0.2.dist-info → elasticsearch-9.0.4.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-9.0.2.dist-info → elasticsearch-9.0.4.dist-info}/licenses/NOTICE +0 -0
|
@@ -51,7 +51,8 @@ class ClusterClient(NamespacedClient):
|
|
|
51
51
|
Get explanations for shard allocations in the cluster.
|
|
52
52
|
For unassigned shards, it provides an explanation for why the shard is unassigned.
|
|
53
53
|
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.
|
|
54
|
-
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
|
|
54
|
+
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.
|
|
55
|
+
Refer to the linked documentation for examples of how to troubleshoot allocation issues using this API.</p>
|
|
55
56
|
|
|
56
57
|
|
|
57
58
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cluster-allocation-explain>`_
|
|
@@ -290,6 +291,7 @@ class ClusterClient(NamespacedClient):
|
|
|
290
291
|
local: t.Optional[bool] = None,
|
|
291
292
|
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
292
293
|
pretty: t.Optional[bool] = None,
|
|
294
|
+
settings_filter: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
293
295
|
) -> ObjectApiResponse[t.Any]:
|
|
294
296
|
"""
|
|
295
297
|
.. raw:: html
|
|
@@ -310,6 +312,8 @@ class ClusterClient(NamespacedClient):
|
|
|
310
312
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
311
313
|
no response is received before the timeout expires, the request fails and
|
|
312
314
|
returns an error.
|
|
315
|
+
:param settings_filter: Filter out results, for example to filter out sensitive
|
|
316
|
+
information. Supports wildcards or full settings keys
|
|
313
317
|
"""
|
|
314
318
|
__path_parts: t.Dict[str, str]
|
|
315
319
|
if name not in SKIP_IN_PATH:
|
|
@@ -335,6 +339,8 @@ class ClusterClient(NamespacedClient):
|
|
|
335
339
|
__query["master_timeout"] = master_timeout
|
|
336
340
|
if pretty is not None:
|
|
337
341
|
__query["pretty"] = pretty
|
|
342
|
+
if settings_filter is not None:
|
|
343
|
+
__query["settings_filter"] = settings_filter
|
|
338
344
|
__headers = {"accept": "application/json"}
|
|
339
345
|
return self.perform_request( # type: ignore[return-value]
|
|
340
346
|
"GET",
|
|
@@ -441,7 +447,7 @@ class ClusterClient(NamespacedClient):
|
|
|
441
447
|
wait_for_no_relocating_shards: t.Optional[bool] = None,
|
|
442
448
|
wait_for_nodes: t.Optional[t.Union[int, str]] = None,
|
|
443
449
|
wait_for_status: t.Optional[
|
|
444
|
-
t.Union[str, t.Literal["green", "red", "yellow"]]
|
|
450
|
+
t.Union[str, t.Literal["green", "red", "unavailable", "unknown", "yellow"]]
|
|
445
451
|
] = None,
|
|
446
452
|
) -> ObjectApiResponse[t.Any]:
|
|
447
453
|
"""
|
|
@@ -731,6 +737,7 @@ class ClusterClient(NamespacedClient):
|
|
|
731
737
|
*,
|
|
732
738
|
name: str,
|
|
733
739
|
template: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
740
|
+
cause: t.Optional[str] = None,
|
|
734
741
|
create: t.Optional[bool] = None,
|
|
735
742
|
deprecated: t.Optional[bool] = None,
|
|
736
743
|
error_trace: t.Optional[bool] = None,
|
|
@@ -774,6 +781,7 @@ class ClusterClient(NamespacedClient):
|
|
|
774
781
|
update settings API.
|
|
775
782
|
:param template: The template to be applied which includes mappings, settings,
|
|
776
783
|
or aliases configuration.
|
|
784
|
+
:param cause: User defined reason for create the component template.
|
|
777
785
|
:param create: If `true`, this request cannot replace or update existing component
|
|
778
786
|
templates.
|
|
779
787
|
:param deprecated: Marks this index template as deprecated. When creating or
|
|
@@ -798,6 +806,8 @@ class ClusterClient(NamespacedClient):
|
|
|
798
806
|
__path = f'/_component_template/{__path_parts["name"]}'
|
|
799
807
|
__query: t.Dict[str, t.Any] = {}
|
|
800
808
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
809
|
+
if cause is not None:
|
|
810
|
+
__query["cause"] = cause
|
|
801
811
|
if create is not None:
|
|
802
812
|
__query["create"] = create
|
|
803
813
|
if error_trace is not None:
|
|
@@ -870,9 +880,9 @@ class ClusterClient(NamespacedClient):
|
|
|
870
880
|
|
|
871
881
|
:param flat_settings: Return settings in flat format (default: false)
|
|
872
882
|
:param master_timeout: Explicit operation timeout for connection to master node
|
|
873
|
-
:param persistent:
|
|
883
|
+
:param persistent: The settings that persist after the cluster restarts.
|
|
874
884
|
:param timeout: Explicit operation timeout
|
|
875
|
-
:param transient:
|
|
885
|
+
:param transient: The settings that do not persist after the cluster restarts.
|
|
876
886
|
"""
|
|
877
887
|
__path_parts: t.Dict[str, str] = {}
|
|
878
888
|
__path = "/_cluster/settings"
|
|
@@ -204,6 +204,7 @@ class EqlClient(NamespacedClient):
|
|
|
204
204
|
allow_partial_search_results: t.Optional[bool] = None,
|
|
205
205
|
allow_partial_sequence_results: t.Optional[bool] = None,
|
|
206
206
|
case_sensitive: t.Optional[bool] = None,
|
|
207
|
+
ccs_minimize_roundtrips: t.Optional[bool] = None,
|
|
207
208
|
error_trace: t.Optional[bool] = None,
|
|
208
209
|
event_category_field: t.Optional[str] = None,
|
|
209
210
|
expand_wildcards: t.Optional[
|
|
@@ -250,7 +251,9 @@ class EqlClient(NamespacedClient):
|
|
|
250
251
|
|
|
251
252
|
:param index: The name of the index to scope the operation
|
|
252
253
|
:param query: EQL query you wish to run.
|
|
253
|
-
:param allow_no_indices:
|
|
254
|
+
:param allow_no_indices: Whether to ignore if a wildcard indices expression resolves
|
|
255
|
+
into no concrete indices. (This includes `_all` string or when no indices
|
|
256
|
+
have been specified)
|
|
254
257
|
:param allow_partial_search_results: Allow query execution also in case of shard
|
|
255
258
|
failures. If true, the query will keep running and will return results based
|
|
256
259
|
on the available shards. For sequences, the behavior can be further refined
|
|
@@ -261,9 +264,12 @@ class EqlClient(NamespacedClient):
|
|
|
261
264
|
If false, the sequence query will return successfully, but will always have
|
|
262
265
|
empty results.
|
|
263
266
|
:param case_sensitive:
|
|
267
|
+
:param ccs_minimize_roundtrips: Indicates whether network round-trips should
|
|
268
|
+
be minimized as part of cross-cluster search requests execution
|
|
264
269
|
:param event_category_field: Field containing the event classification, such
|
|
265
270
|
as process, file, or network.
|
|
266
|
-
:param expand_wildcards:
|
|
271
|
+
:param expand_wildcards: Whether to expand wildcard expression to concrete indices
|
|
272
|
+
that are open, closed or both.
|
|
267
273
|
:param fetch_size: Maximum number of events to search at a time for sequence
|
|
268
274
|
queries.
|
|
269
275
|
:param fields: Array of wildcard (*) patterns. The response returns values for
|
|
@@ -298,6 +304,8 @@ class EqlClient(NamespacedClient):
|
|
|
298
304
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
299
305
|
if allow_no_indices is not None:
|
|
300
306
|
__query["allow_no_indices"] = allow_no_indices
|
|
307
|
+
if ccs_minimize_roundtrips is not None:
|
|
308
|
+
__query["ccs_minimize_roundtrips"] = ccs_minimize_roundtrips
|
|
301
309
|
if error_trace is not None:
|
|
302
310
|
__query["error_trace"] = error_trace
|
|
303
311
|
if expand_wildcards is not None:
|
|
@@ -22,6 +22,9 @@ from elastic_transport import ObjectApiResponse
|
|
|
22
22
|
from ._base import NamespacedClient
|
|
23
23
|
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
|
|
24
24
|
|
|
25
|
+
if t.TYPE_CHECKING:
|
|
26
|
+
from elasticsearch.esql import ESQLBase
|
|
27
|
+
|
|
25
28
|
|
|
26
29
|
class EsqlClient(NamespacedClient):
|
|
27
30
|
|
|
@@ -31,6 +34,8 @@ class EsqlClient(NamespacedClient):
|
|
|
31
34
|
"columnar",
|
|
32
35
|
"filter",
|
|
33
36
|
"include_ccs_metadata",
|
|
37
|
+
"keep_alive",
|
|
38
|
+
"keep_on_completion",
|
|
34
39
|
"locale",
|
|
35
40
|
"params",
|
|
36
41
|
"profile",
|
|
@@ -42,7 +47,7 @@ class EsqlClient(NamespacedClient):
|
|
|
42
47
|
def async_query(
|
|
43
48
|
self,
|
|
44
49
|
*,
|
|
45
|
-
query: t.Optional[str] = None,
|
|
50
|
+
query: t.Optional[t.Union[str, "ESQLBase"]] = None,
|
|
46
51
|
columnar: t.Optional[bool] = None,
|
|
47
52
|
delimiter: t.Optional[str] = None,
|
|
48
53
|
drop_null_columns: t.Optional[bool] = None,
|
|
@@ -97,7 +102,12 @@ class EsqlClient(NamespacedClient):
|
|
|
97
102
|
which has the name of all the columns.
|
|
98
103
|
:param filter: Specify a Query DSL query in the filter parameter to filter the
|
|
99
104
|
set of documents that an ES|QL query runs on.
|
|
100
|
-
:param format: A short version of the Accept header,
|
|
105
|
+
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
|
|
106
|
+
`tsv`, and `txt` formats will return results in a tabular format, excluding
|
|
107
|
+
other metadata fields from the response. For async requests, nothing will
|
|
108
|
+
be returned if the async query doesn't finish within the timeout. The query
|
|
109
|
+
ID and running status are available in the `X-Elasticsearch-Async-Id` and
|
|
110
|
+
`X-Elasticsearch-Async-Is-Running` HTTP headers of the response, respectively.
|
|
101
111
|
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
|
|
102
112
|
query, the response will include an extra `_clusters` object with information
|
|
103
113
|
about the clusters that participated in the search along with info such as
|
|
@@ -145,21 +155,21 @@ class EsqlClient(NamespacedClient):
|
|
|
145
155
|
__query["format"] = format
|
|
146
156
|
if human is not None:
|
|
147
157
|
__query["human"] = human
|
|
148
|
-
if keep_alive is not None:
|
|
149
|
-
__query["keep_alive"] = keep_alive
|
|
150
|
-
if keep_on_completion is not None:
|
|
151
|
-
__query["keep_on_completion"] = keep_on_completion
|
|
152
158
|
if pretty is not None:
|
|
153
159
|
__query["pretty"] = pretty
|
|
154
160
|
if not __body:
|
|
155
161
|
if query is not None:
|
|
156
|
-
__body["query"] = query
|
|
162
|
+
__body["query"] = str(query)
|
|
157
163
|
if columnar is not None:
|
|
158
164
|
__body["columnar"] = columnar
|
|
159
165
|
if filter is not None:
|
|
160
166
|
__body["filter"] = filter
|
|
161
167
|
if include_ccs_metadata is not None:
|
|
162
168
|
__body["include_ccs_metadata"] = include_ccs_metadata
|
|
169
|
+
if keep_alive is not None:
|
|
170
|
+
__body["keep_alive"] = keep_alive
|
|
171
|
+
if keep_on_completion is not None:
|
|
172
|
+
__body["keep_on_completion"] = keep_on_completion
|
|
163
173
|
if locale is not None:
|
|
164
174
|
__body["locale"] = locale
|
|
165
175
|
if params is not None:
|
|
@@ -242,6 +252,14 @@ class EsqlClient(NamespacedClient):
|
|
|
242
252
|
drop_null_columns: t.Optional[bool] = None,
|
|
243
253
|
error_trace: t.Optional[bool] = None,
|
|
244
254
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
255
|
+
format: t.Optional[
|
|
256
|
+
t.Union[
|
|
257
|
+
str,
|
|
258
|
+
t.Literal[
|
|
259
|
+
"arrow", "cbor", "csv", "json", "smile", "tsv", "txt", "yaml"
|
|
260
|
+
],
|
|
261
|
+
]
|
|
262
|
+
] = None,
|
|
245
263
|
human: t.Optional[bool] = None,
|
|
246
264
|
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
247
265
|
pretty: t.Optional[bool] = None,
|
|
@@ -267,6 +285,7 @@ class EsqlClient(NamespacedClient):
|
|
|
267
285
|
will be removed from the `columns` and `values` portion of the results. If
|
|
268
286
|
`true`, the response will include an extra section under the name `all_columns`
|
|
269
287
|
which has the name of all the columns.
|
|
288
|
+
:param format: A short version of the Accept header, for example `json` or `yaml`.
|
|
270
289
|
:param keep_alive: The period for which the query and its results are stored
|
|
271
290
|
in the cluster. When this period expires, the query and its results are deleted,
|
|
272
291
|
even if the query is still ongoing.
|
|
@@ -287,6 +306,8 @@ class EsqlClient(NamespacedClient):
|
|
|
287
306
|
__query["error_trace"] = error_trace
|
|
288
307
|
if filter_path is not None:
|
|
289
308
|
__query["filter_path"] = filter_path
|
|
309
|
+
if format is not None:
|
|
310
|
+
__query["format"] = format
|
|
290
311
|
if human is not None:
|
|
291
312
|
__query["human"] = human
|
|
292
313
|
if keep_alive is not None:
|
|
@@ -376,7 +397,7 @@ class EsqlClient(NamespacedClient):
|
|
|
376
397
|
def query(
|
|
377
398
|
self,
|
|
378
399
|
*,
|
|
379
|
-
query: t.Optional[str] = None,
|
|
400
|
+
query: t.Optional[t.Union[str, "ESQLBase"]] = None,
|
|
380
401
|
columnar: t.Optional[bool] = None,
|
|
381
402
|
delimiter: t.Optional[str] = None,
|
|
382
403
|
drop_null_columns: t.Optional[bool] = None,
|
|
@@ -425,7 +446,9 @@ class EsqlClient(NamespacedClient):
|
|
|
425
446
|
`all_columns` which has the name of all columns.
|
|
426
447
|
:param filter: Specify a Query DSL query in the filter parameter to filter the
|
|
427
448
|
set of documents that an ES|QL query runs on.
|
|
428
|
-
:param format: A short version of the Accept header, e.g. json, yaml.
|
|
449
|
+
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
|
|
450
|
+
`tsv`, and `txt` formats will return results in a tabular format, excluding
|
|
451
|
+
other metadata fields from the response.
|
|
429
452
|
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
|
|
430
453
|
query, the response will include an extra `_clusters` object with information
|
|
431
454
|
about the clusters that participated in the search along with info such as
|
|
@@ -463,7 +486,7 @@ class EsqlClient(NamespacedClient):
|
|
|
463
486
|
__query["pretty"] = pretty
|
|
464
487
|
if not __body:
|
|
465
488
|
if query is not None:
|
|
466
|
-
__body["query"] = query
|
|
489
|
+
__body["query"] = str(query)
|
|
467
490
|
if columnar is not None:
|
|
468
491
|
__body["columnar"] = columnar
|
|
469
492
|
if filter is not None:
|
|
@@ -338,7 +338,7 @@ class IndicesClient(NamespacedClient):
|
|
|
338
338
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
339
339
|
request can target data streams, this argument determines whether wildcard
|
|
340
340
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
341
|
-
as `open,hidden`.
|
|
341
|
+
as `open,hidden`.
|
|
342
342
|
:param fielddata: If `true`, clears the fields cache. Use the `fields` parameter
|
|
343
343
|
to clear the cache of specific fields only.
|
|
344
344
|
:param fields: Comma-separated list of field names used to limit the `fielddata`
|
|
@@ -563,7 +563,7 @@ class IndicesClient(NamespacedClient):
|
|
|
563
563
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
564
564
|
request can target data streams, this argument determines whether wildcard
|
|
565
565
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
566
|
-
as `open,hidden`.
|
|
566
|
+
as `open,hidden`.
|
|
567
567
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
568
568
|
a missing or closed index.
|
|
569
569
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -950,7 +950,7 @@ class IndicesClient(NamespacedClient):
|
|
|
950
950
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
951
951
|
request can target data streams, this argument determines whether wildcard
|
|
952
952
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
953
|
-
as `open,hidden`.
|
|
953
|
+
as `open,hidden`.
|
|
954
954
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
955
955
|
a missing or closed index.
|
|
956
956
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -1495,7 +1495,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1495
1495
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
1496
1496
|
request can target data streams, this argument determines whether wildcard
|
|
1497
1497
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
1498
|
-
as `open,hidden`.
|
|
1498
|
+
as `open,hidden`.
|
|
1499
1499
|
:param flat_settings: If `true`, returns settings in flat format.
|
|
1500
1500
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
1501
1501
|
a missing or closed index.
|
|
@@ -1579,7 +1579,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1579
1579
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
1580
1580
|
request can target data streams, this argument determines whether wildcard
|
|
1581
1581
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
1582
|
-
as `open,hidden`.
|
|
1582
|
+
as `open,hidden`.
|
|
1583
1583
|
:param ignore_unavailable: If `false`, requests that include a missing data stream
|
|
1584
1584
|
or index in the target indices or data streams return an error.
|
|
1585
1585
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -1928,7 +1928,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1928
1928
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
1929
1929
|
request can target data streams, this argument determines whether wildcard
|
|
1930
1930
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
1931
|
-
as `open,hidden`.
|
|
1931
|
+
as `open,hidden`.
|
|
1932
1932
|
:param force: If `true`, the request forces a flush even if there are no changes
|
|
1933
1933
|
to commit to the index.
|
|
1934
1934
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
@@ -2246,7 +2246,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2246
2246
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
2247
2247
|
request can target data streams, this argument determines whether wildcard
|
|
2248
2248
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
2249
|
-
as `open,hidden`.
|
|
2249
|
+
as `open,hidden`.
|
|
2250
2250
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
2251
2251
|
a missing or closed index.
|
|
2252
2252
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -2326,8 +2326,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2326
2326
|
wildcards (`*`). To target all data streams, omit this parameter or use `*`
|
|
2327
2327
|
or `_all`.
|
|
2328
2328
|
:param expand_wildcards: Type of data stream that wildcard patterns can match.
|
|
2329
|
-
Supports comma-separated values, such as `open,hidden`.
|
|
2330
|
-
`all`, `open`, `closed`, `hidden`, `none`.
|
|
2329
|
+
Supports comma-separated values, such as `open,hidden`.
|
|
2331
2330
|
:param include_defaults: If `true`, return all default settings in the response.
|
|
2332
2331
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
2333
2332
|
no response is received before the timeout expires, the request fails and
|
|
@@ -2523,7 +2522,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2523
2522
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
2524
2523
|
request can target data streams, this argument determines whether wildcard
|
|
2525
2524
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
2526
|
-
as `open,hidden`.
|
|
2525
|
+
as `open,hidden`.
|
|
2527
2526
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
2528
2527
|
a missing or closed index.
|
|
2529
2528
|
:param include_defaults: If `true`, return all default settings in the response.
|
|
@@ -2679,7 +2678,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2679
2678
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
2680
2679
|
request can target data streams, this argument determines whether wildcard
|
|
2681
2680
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
2682
|
-
as `open,hidden`.
|
|
2681
|
+
as `open,hidden`.
|
|
2683
2682
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
2684
2683
|
a missing or closed index.
|
|
2685
2684
|
:param local: If `true`, the request retrieves information from the local node
|
|
@@ -3171,7 +3170,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3171
3170
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
3172
3171
|
request can target data streams, this argument determines whether wildcard
|
|
3173
3172
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
3174
|
-
as `open,hidden`.
|
|
3173
|
+
as `open,hidden`.
|
|
3175
3174
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
3176
3175
|
a missing or closed index.
|
|
3177
3176
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -3430,8 +3429,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3430
3429
|
for this data stream. A data stream lifecycle that's disabled (enabled: `false`)
|
|
3431
3430
|
will have no effect on the data stream.
|
|
3432
3431
|
:param expand_wildcards: Type of data stream that wildcard patterns can match.
|
|
3433
|
-
Supports comma-separated values, such as `open,hidden`.
|
|
3434
|
-
`all`, `hidden`, `open`, `closed`, `none`.
|
|
3432
|
+
Supports comma-separated values, such as `open,hidden`.
|
|
3435
3433
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
3436
3434
|
no response is received before the timeout expires, the request fails and
|
|
3437
3435
|
returns an error.
|
|
@@ -3707,24 +3705,17 @@ class IndicesClient(NamespacedClient):
|
|
|
3707
3705
|
|
|
3708
3706
|
<p>Update field mappings.
|
|
3709
3707
|
Add new fields to an existing data stream or index.
|
|
3710
|
-
You can
|
|
3711
|
-
|
|
3712
|
-
<
|
|
3713
|
-
<
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
<
|
|
3718
|
-
<
|
|
3719
|
-
|
|
3720
|
-
<p
|
|
3721
|
-
<p>Except for supported mapping parameters, you can't change the mapping or field type of an existing field.
|
|
3722
|
-
Changing an existing field could invalidate data that's already indexed.</p>
|
|
3723
|
-
<p>If you need to change the mapping of a field in a data stream's backing indices, refer to documentation about modifying data streams.
|
|
3724
|
-
If you need to change the mapping of a field in other indices, create a new index with the correct mapping and reindex your data into that index.</p>
|
|
3725
|
-
<p><strong>Rename a field</strong></p>
|
|
3726
|
-
<p>Renaming a field would invalidate data already indexed under the old field name.
|
|
3727
|
-
Instead, add an alias field to create an alternate field name.</p>
|
|
3708
|
+
You can use the update mapping API to:</p>
|
|
3709
|
+
<ul>
|
|
3710
|
+
<li>Add a new field to an existing index</li>
|
|
3711
|
+
<li>Update mappings for multiple indices in a single request</li>
|
|
3712
|
+
<li>Add new properties to an object field</li>
|
|
3713
|
+
<li>Enable multi-fields for an existing field</li>
|
|
3714
|
+
<li>Update supported mapping parameters</li>
|
|
3715
|
+
<li>Change a field's mapping using reindexing</li>
|
|
3716
|
+
<li>Rename a field using a field alias</li>
|
|
3717
|
+
</ul>
|
|
3718
|
+
<p>Learn how to use the update mapping API with practical examples in the <a href="https://www.elastic.co/docs/manage-data/data-store/mapping/update-mappings-examples">Update mapping API examples</a> guide.</p>
|
|
3728
3719
|
|
|
3729
3720
|
|
|
3730
3721
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-mapping>`_
|
|
@@ -3743,7 +3734,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3743
3734
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
3744
3735
|
request can target data streams, this argument determines whether wildcard
|
|
3745
3736
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
3746
|
-
as `open,hidden`.
|
|
3737
|
+
as `open,hidden`.
|
|
3747
3738
|
:param field_names: Control whether field names are enabled for the index.
|
|
3748
3739
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
3749
3740
|
a missing or closed index.
|
|
@@ -3861,8 +3852,36 @@ class IndicesClient(NamespacedClient):
|
|
|
3861
3852
|
Changes dynamic index settings in real time.
|
|
3862
3853
|
For data streams, index setting changes are applied to all backing indices by default.</p>
|
|
3863
3854
|
<p>To revert a setting to the default value, use a null value.
|
|
3864
|
-
The list of per-index settings that can be updated dynamically on live indices can be found in index
|
|
3855
|
+
The list of per-index settings that can be updated dynamically on live indices can be found in index settings documentation.
|
|
3865
3856
|
To preserve existing settings from being updated, set the <code>preserve_existing</code> parameter to <code>true</code>.</p>
|
|
3857
|
+
<p>For performance optimization during bulk indexing, you can disable the refresh interval.
|
|
3858
|
+
Refer to <a href="https://www.elastic.co/docs/deploy-manage/production-guidance/optimize-performance/indexing-speed#disable-refresh-interval">disable refresh interval</a> for an example.
|
|
3859
|
+
There are multiple valid ways to represent index settings in the request body. You can specify only the setting, for example:</p>
|
|
3860
|
+
<pre><code>{
|
|
3861
|
+
"number_of_replicas": 1
|
|
3862
|
+
}
|
|
3863
|
+
</code></pre>
|
|
3864
|
+
<p>Or you can use an <code>index</code> setting object:</p>
|
|
3865
|
+
<pre><code>{
|
|
3866
|
+
"index": {
|
|
3867
|
+
"number_of_replicas": 1
|
|
3868
|
+
}
|
|
3869
|
+
}
|
|
3870
|
+
</code></pre>
|
|
3871
|
+
<p>Or you can use dot annotation:</p>
|
|
3872
|
+
<pre><code>{
|
|
3873
|
+
"index.number_of_replicas": 1
|
|
3874
|
+
}
|
|
3875
|
+
</code></pre>
|
|
3876
|
+
<p>Or you can embed any of the aforementioned options in a <code>settings</code> object. For example:</p>
|
|
3877
|
+
<pre><code>{
|
|
3878
|
+
"settings": {
|
|
3879
|
+
"index": {
|
|
3880
|
+
"number_of_replicas": 1
|
|
3881
|
+
}
|
|
3882
|
+
}
|
|
3883
|
+
}
|
|
3884
|
+
</code></pre>
|
|
3866
3885
|
<p>NOTE: You can only define new analyzers on closed indices.
|
|
3867
3886
|
To add an analyzer, you must close the index, define the analyzer, and reopen the index.
|
|
3868
3887
|
You cannot close the write index of a data stream.
|
|
@@ -3870,7 +3889,8 @@ class IndicesClient(NamespacedClient):
|
|
|
3870
3889
|
Then roll over the data stream to apply the new analyzer to the stream's write index and future backing indices.
|
|
3871
3890
|
This affects searches and any new data added to the stream after the rollover.
|
|
3872
3891
|
However, it does not affect the data stream's backing indices or their existing data.
|
|
3873
|
-
To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it
|
|
3892
|
+
To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.
|
|
3893
|
+
Refer to <a href="https://www.elastic.co/docs/manage-data/data-store/text-analysis/specify-an-analyzer#update-analyzers-on-existing-indices">updating analyzers on existing indices</a> for step-by-step examples.</p>
|
|
3874
3894
|
|
|
3875
3895
|
|
|
3876
3896
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-settings>`_
|
|
@@ -4071,10 +4091,20 @@ class IndicesClient(NamespacedClient):
|
|
|
4071
4091
|
*,
|
|
4072
4092
|
index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
4073
4093
|
active_only: t.Optional[bool] = None,
|
|
4094
|
+
allow_no_indices: t.Optional[bool] = None,
|
|
4074
4095
|
detailed: t.Optional[bool] = None,
|
|
4075
4096
|
error_trace: t.Optional[bool] = None,
|
|
4097
|
+
expand_wildcards: t.Optional[
|
|
4098
|
+
t.Union[
|
|
4099
|
+
t.Sequence[
|
|
4100
|
+
t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
|
|
4101
|
+
],
|
|
4102
|
+
t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
|
|
4103
|
+
]
|
|
4104
|
+
] = None,
|
|
4076
4105
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
4077
4106
|
human: t.Optional[bool] = None,
|
|
4107
|
+
ignore_unavailable: t.Optional[bool] = None,
|
|
4078
4108
|
pretty: t.Optional[bool] = None,
|
|
4079
4109
|
) -> ObjectApiResponse[t.Any]:
|
|
4080
4110
|
"""
|
|
@@ -4107,8 +4137,17 @@ class IndicesClient(NamespacedClient):
|
|
|
4107
4137
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
4108
4138
|
and indices, omit this parameter or use `*` or `_all`.
|
|
4109
4139
|
:param active_only: If `true`, the response only includes ongoing shard recoveries.
|
|
4140
|
+
:param allow_no_indices: If `false`, the request returns an error if any wildcard
|
|
4141
|
+
expression, index alias, or `_all` value targets only missing or closed indices.
|
|
4142
|
+
This behavior applies even if the request targets other open indices.
|
|
4110
4143
|
:param detailed: If `true`, the response includes detailed information about
|
|
4111
4144
|
shard recoveries.
|
|
4145
|
+
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
4146
|
+
request can target data streams, this argument determines whether wildcard
|
|
4147
|
+
expressions match hidden data streams. Supports comma-separated values, such
|
|
4148
|
+
as `open,hidden`.
|
|
4149
|
+
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
4150
|
+
a missing or closed index.
|
|
4112
4151
|
"""
|
|
4113
4152
|
__path_parts: t.Dict[str, str]
|
|
4114
4153
|
if index not in SKIP_IN_PATH:
|
|
@@ -4120,14 +4159,20 @@ class IndicesClient(NamespacedClient):
|
|
|
4120
4159
|
__query: t.Dict[str, t.Any] = {}
|
|
4121
4160
|
if active_only is not None:
|
|
4122
4161
|
__query["active_only"] = active_only
|
|
4162
|
+
if allow_no_indices is not None:
|
|
4163
|
+
__query["allow_no_indices"] = allow_no_indices
|
|
4123
4164
|
if detailed is not None:
|
|
4124
4165
|
__query["detailed"] = detailed
|
|
4125
4166
|
if error_trace is not None:
|
|
4126
4167
|
__query["error_trace"] = error_trace
|
|
4168
|
+
if expand_wildcards is not None:
|
|
4169
|
+
__query["expand_wildcards"] = expand_wildcards
|
|
4127
4170
|
if filter_path is not None:
|
|
4128
4171
|
__query["filter_path"] = filter_path
|
|
4129
4172
|
if human is not None:
|
|
4130
4173
|
__query["human"] = human
|
|
4174
|
+
if ignore_unavailable is not None:
|
|
4175
|
+
__query["ignore_unavailable"] = ignore_unavailable
|
|
4131
4176
|
if pretty is not None:
|
|
4132
4177
|
__query["pretty"] = pretty
|
|
4133
4178
|
__headers = {"accept": "application/json"}
|
|
@@ -4186,7 +4231,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4186
4231
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
4187
4232
|
request can target data streams, this argument determines whether wildcard
|
|
4188
4233
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
4189
|
-
as `open,hidden`.
|
|
4234
|
+
as `open,hidden`.
|
|
4190
4235
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
4191
4236
|
a missing or closed index.
|
|
4192
4237
|
"""
|
|
@@ -4385,10 +4430,9 @@ class IndicesClient(NamespacedClient):
|
|
|
4385
4430
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
4386
4431
|
request can target data streams, this argument determines whether wildcard
|
|
4387
4432
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
4388
|
-
as `open,hidden`.
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
API endpoint that takes no index expression.
|
|
4433
|
+
as `open,hidden`. NOTE: This option is only supported when specifying an
|
|
4434
|
+
index expression. You will get an error if you specify index options to the
|
|
4435
|
+
`_resolve/cluster` API endpoint that takes no index expression.
|
|
4392
4436
|
:param ignore_throttled: If true, concrete, expanded, or aliased indices are
|
|
4393
4437
|
ignored when frozen. NOTE: This option is only supported when specifying
|
|
4394
4438
|
an index expression. You will get an error if you specify index options to
|
|
@@ -4481,7 +4525,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4481
4525
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
4482
4526
|
request can target data streams, this argument determines whether wildcard
|
|
4483
4527
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
4484
|
-
as `open,hidden`.
|
|
4528
|
+
as `open,hidden`.
|
|
4485
4529
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
4486
4530
|
a missing or closed index.
|
|
4487
4531
|
"""
|
|
@@ -4543,7 +4587,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4543
4587
|
.. raw:: html
|
|
4544
4588
|
|
|
4545
4589
|
<p>Roll over to a new index.
|
|
4546
|
-
TIP:
|
|
4590
|
+
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>
|
|
4547
4591
|
<p>The rollover API creates a new index for a data stream or index alias.
|
|
4548
4592
|
The API behavior depends on the rollover target.</p>
|
|
4549
4593
|
<p><strong>Roll over a data stream</strong></p>
|
|
@@ -4695,7 +4739,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4695
4739
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
4696
4740
|
request can target data streams, this argument determines whether wildcard
|
|
4697
4741
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
4698
|
-
as `open,hidden`.
|
|
4742
|
+
as `open,hidden`.
|
|
4699
4743
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
4700
4744
|
a missing or closed index.
|
|
4701
4745
|
"""
|
|
@@ -5519,7 +5563,7 @@ class IndicesClient(NamespacedClient):
|
|
|
5519
5563
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
5520
5564
|
request can target data streams, this argument determines whether wildcard
|
|
5521
5565
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
5522
|
-
as `open,hidden`.
|
|
5566
|
+
as `open,hidden`.
|
|
5523
5567
|
:param explain: If `true`, the response returns detailed information if an error
|
|
5524
5568
|
has occurred.
|
|
5525
5569
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|