elasticsearch9 9.0.1__py3-none-any.whl → 9.0.3__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.
Files changed (52) hide show
  1. elasticsearch9/_async/client/__init__.py +47 -203
  2. elasticsearch9/_async/client/cat.py +594 -32
  3. elasticsearch9/_async/client/cluster.py +14 -4
  4. elasticsearch9/_async/client/eql.py +10 -2
  5. elasticsearch9/_async/client/esql.py +17 -4
  6. elasticsearch9/_async/client/indices.py +100 -47
  7. elasticsearch9/_async/client/inference.py +110 -75
  8. elasticsearch9/_async/client/ingest.py +0 -7
  9. elasticsearch9/_async/client/license.py +4 -4
  10. elasticsearch9/_async/client/ml.py +6 -17
  11. elasticsearch9/_async/client/monitoring.py +1 -1
  12. elasticsearch9/_async/client/rollup.py +1 -22
  13. elasticsearch9/_async/client/security.py +11 -17
  14. elasticsearch9/_async/client/snapshot.py +6 -0
  15. elasticsearch9/_async/client/synonyms.py +1 -0
  16. elasticsearch9/_async/client/watcher.py +4 -2
  17. elasticsearch9/_sync/client/__init__.py +47 -203
  18. elasticsearch9/_sync/client/cat.py +594 -32
  19. elasticsearch9/_sync/client/cluster.py +14 -4
  20. elasticsearch9/_sync/client/eql.py +10 -2
  21. elasticsearch9/_sync/client/esql.py +17 -4
  22. elasticsearch9/_sync/client/indices.py +100 -47
  23. elasticsearch9/_sync/client/inference.py +110 -75
  24. elasticsearch9/_sync/client/ingest.py +0 -7
  25. elasticsearch9/_sync/client/license.py +4 -4
  26. elasticsearch9/_sync/client/ml.py +6 -17
  27. elasticsearch9/_sync/client/monitoring.py +1 -1
  28. elasticsearch9/_sync/client/rollup.py +1 -22
  29. elasticsearch9/_sync/client/security.py +11 -17
  30. elasticsearch9/_sync/client/snapshot.py +6 -0
  31. elasticsearch9/_sync/client/synonyms.py +1 -0
  32. elasticsearch9/_sync/client/watcher.py +4 -2
  33. elasticsearch9/_version.py +1 -1
  34. elasticsearch9/compat.py +5 -0
  35. elasticsearch9/dsl/__init__.py +2 -1
  36. elasticsearch9/dsl/_async/document.py +1 -1
  37. elasticsearch9/dsl/_sync/document.py +1 -1
  38. elasticsearch9/dsl/document_base.py +176 -16
  39. elasticsearch9/dsl/field.py +223 -38
  40. elasticsearch9/dsl/query.py +49 -4
  41. elasticsearch9/dsl/types.py +107 -16
  42. elasticsearch9/dsl/utils.py +1 -1
  43. elasticsearch9/esql/__init__.py +18 -0
  44. elasticsearch9/esql/esql.py +1105 -0
  45. elasticsearch9/esql/functions.py +1738 -0
  46. {elasticsearch9-9.0.1.dist-info → elasticsearch9-9.0.3.dist-info}/METADATA +1 -3
  47. {elasticsearch9-9.0.1.dist-info → elasticsearch9-9.0.3.dist-info}/RECORD +50 -49
  48. elasticsearch9-9.0.1.dist-info/licenses/LICENSE.txt +0 -175
  49. elasticsearch9-9.0.1.dist-info/licenses/NOTICE.txt +0 -559
  50. {elasticsearch9-9.0.1.dist-info → elasticsearch9-9.0.3.dist-info}/WHEEL +0 -0
  51. {elasticsearch9-9.0.1.dist-info → elasticsearch9-9.0.3.dist-info}/licenses/LICENSE +0 -0
  52. {elasticsearch9-9.0.1.dist-info → elasticsearch9-9.0.3.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.</p>
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:
@@ -31,6 +31,8 @@ class EsqlClient(NamespacedClient):
31
31
  "columnar",
32
32
  "filter",
33
33
  "include_ccs_metadata",
34
+ "keep_alive",
35
+ "keep_on_completion",
34
36
  "locale",
35
37
  "params",
36
38
  "profile",
@@ -145,10 +147,6 @@ class EsqlClient(NamespacedClient):
145
147
  __query["format"] = format
146
148
  if human is not None:
147
149
  __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
150
  if pretty is not None:
153
151
  __query["pretty"] = pretty
154
152
  if not __body:
@@ -160,6 +158,10 @@ class EsqlClient(NamespacedClient):
160
158
  __body["filter"] = filter
161
159
  if include_ccs_metadata is not None:
162
160
  __body["include_ccs_metadata"] = include_ccs_metadata
161
+ if keep_alive is not None:
162
+ __body["keep_alive"] = keep_alive
163
+ if keep_on_completion is not None:
164
+ __body["keep_on_completion"] = keep_on_completion
163
165
  if locale is not None:
164
166
  __body["locale"] = locale
165
167
  if params is not None:
@@ -242,6 +244,14 @@ class EsqlClient(NamespacedClient):
242
244
  drop_null_columns: t.Optional[bool] = None,
243
245
  error_trace: t.Optional[bool] = None,
244
246
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
247
+ format: t.Optional[
248
+ t.Union[
249
+ str,
250
+ t.Literal[
251
+ "arrow", "cbor", "csv", "json", "smile", "tsv", "txt", "yaml"
252
+ ],
253
+ ]
254
+ ] = None,
245
255
  human: t.Optional[bool] = None,
246
256
  keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
247
257
  pretty: t.Optional[bool] = None,
@@ -267,6 +277,7 @@ class EsqlClient(NamespacedClient):
267
277
  will be removed from the `columns` and `values` portion of the results. If
268
278
  `true`, the response will include an extra section under the name `all_columns`
269
279
  which has the name of all the columns.
280
+ :param format: A short version of the Accept header, for example `json` or `yaml`.
270
281
  :param keep_alive: The period for which the query and its results are stored
271
282
  in the cluster. When this period expires, the query and its results are deleted,
272
283
  even if the query is still ongoing.
@@ -287,6 +298,8 @@ class EsqlClient(NamespacedClient):
287
298
  __query["error_trace"] = error_trace
288
299
  if filter_path is not None:
289
300
  __query["filter_path"] = filter_path
301
+ if format is not None:
302
+ __query["format"] = format
290
303
  if human is not None:
291
304
  __query["human"] = human
292
305
  if keep_alive 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`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
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`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
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
@@ -656,7 +656,15 @@ class IndicesClient(NamespacedClient):
656
656
 
657
657
  `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-create>`_
658
658
 
659
- :param index: Name of the index you wish to create.
659
+ :param index: Name of the index you wish to create. Index names must meet the
660
+ following criteria: * Lowercase only * Cannot include `\\`, `/`, `*`, `?`,
661
+ `"`, `<`, `>`, `|`, ` ` (space character), `,`, or `#` * Indices prior to
662
+ 7.0 could contain a colon (`:`), but that has been deprecated and will not
663
+ be supported in later versions * Cannot start with `-`, `_`, or `+` * Cannot
664
+ be `.` or `..` * Cannot be longer than 255 bytes (note thtat it is bytes,
665
+ so multi-byte characters will reach the limit faster) * Names starting with
666
+ `.` are deprecated, except for hidden indices and internal indices managed
667
+ by plugins
660
668
  :param aliases: Aliases for the index.
661
669
  :param mappings: Mapping for fields in the index. If specified, this mapping
662
670
  can include: - Field names - Field data types - Mapping parameters
@@ -942,7 +950,7 @@ class IndicesClient(NamespacedClient):
942
950
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
943
951
  request can target data streams, this argument determines whether wildcard
944
952
  expressions match hidden data streams. Supports comma-separated values, such
945
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
953
+ as `open,hidden`.
946
954
  :param ignore_unavailable: If `false`, the request returns an error if it targets
947
955
  a missing or closed index.
948
956
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -1246,7 +1254,8 @@ class IndicesClient(NamespacedClient):
1246
1254
  """
1247
1255
  .. raw:: html
1248
1256
 
1249
- <p>Delete a legacy index template.</p>
1257
+ <p>Delete a legacy index template.
1258
+ IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.</p>
1250
1259
 
1251
1260
 
1252
1261
  `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-delete-template>`_
@@ -1486,7 +1495,7 @@ class IndicesClient(NamespacedClient):
1486
1495
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
1487
1496
  request can target data streams, this argument determines whether wildcard
1488
1497
  expressions match hidden data streams. Supports comma-separated values, such
1489
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
1498
+ as `open,hidden`.
1490
1499
  :param flat_settings: If `true`, returns settings in flat format.
1491
1500
  :param ignore_unavailable: If `false`, the request returns an error if it targets
1492
1501
  a missing or closed index.
@@ -1570,7 +1579,7 @@ class IndicesClient(NamespacedClient):
1570
1579
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
1571
1580
  request can target data streams, this argument determines whether wildcard
1572
1581
  expressions match hidden data streams. Supports comma-separated values, such
1573
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
1582
+ as `open,hidden`.
1574
1583
  :param ignore_unavailable: If `false`, requests that include a missing data stream
1575
1584
  or index in the target indices or data streams return an error.
1576
1585
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -1919,7 +1928,7 @@ class IndicesClient(NamespacedClient):
1919
1928
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
1920
1929
  request can target data streams, this argument determines whether wildcard
1921
1930
  expressions match hidden data streams. Supports comma-separated values, such
1922
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
1931
+ as `open,hidden`.
1923
1932
  :param force: If `true`, the request forces a flush even if there are no changes
1924
1933
  to commit to the index.
1925
1934
  :param ignore_unavailable: If `false`, the request returns an error if it targets
@@ -2237,7 +2246,7 @@ class IndicesClient(NamespacedClient):
2237
2246
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
2238
2247
  request can target data streams, this argument determines whether wildcard
2239
2248
  expressions match hidden data streams. Supports comma-separated values, such
2240
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
2249
+ as `open,hidden`.
2241
2250
  :param ignore_unavailable: If `false`, the request returns an error if it targets
2242
2251
  a missing or closed index.
2243
2252
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -2317,8 +2326,7 @@ class IndicesClient(NamespacedClient):
2317
2326
  wildcards (`*`). To target all data streams, omit this parameter or use `*`
2318
2327
  or `_all`.
2319
2328
  :param expand_wildcards: Type of data stream that wildcard patterns can match.
2320
- Supports comma-separated values, such as `open,hidden`. Valid values are:
2321
- `all`, `open`, `closed`, `hidden`, `none`.
2329
+ Supports comma-separated values, such as `open,hidden`.
2322
2330
  :param include_defaults: If `true`, return all default settings in the response.
2323
2331
  :param master_timeout: Period to wait for a connection to the master node. If
2324
2332
  no response is received before the timeout expires, the request fails and
@@ -2514,7 +2522,7 @@ class IndicesClient(NamespacedClient):
2514
2522
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
2515
2523
  request can target data streams, this argument determines whether wildcard
2516
2524
  expressions match hidden data streams. Supports comma-separated values, such
2517
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
2525
+ as `open,hidden`.
2518
2526
  :param ignore_unavailable: If `false`, the request returns an error if it targets
2519
2527
  a missing or closed index.
2520
2528
  :param include_defaults: If `true`, return all default settings in the response.
@@ -2670,7 +2678,7 @@ class IndicesClient(NamespacedClient):
2670
2678
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
2671
2679
  request can target data streams, this argument determines whether wildcard
2672
2680
  expressions match hidden data streams. Supports comma-separated values, such
2673
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
2681
+ as `open,hidden`.
2674
2682
  :param ignore_unavailable: If `false`, the request returns an error if it targets
2675
2683
  a missing or closed index.
2676
2684
  :param local: If `true`, the request retrieves information from the local node
@@ -2880,7 +2888,7 @@ class IndicesClient(NamespacedClient):
2880
2888
  """
2881
2889
  .. raw:: html
2882
2890
 
2883
- <p>Get index templates.
2891
+ <p>Get legacy index templates.
2884
2892
  Get information about one or more index templates.</p>
2885
2893
  <p>IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.</p>
2886
2894
 
@@ -3162,7 +3170,7 @@ class IndicesClient(NamespacedClient):
3162
3170
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
3163
3171
  request can target data streams, this argument determines whether wildcard
3164
3172
  expressions match hidden data streams. Supports comma-separated values, such
3165
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
3173
+ as `open,hidden`.
3166
3174
  :param ignore_unavailable: If `false`, the request returns an error if it targets
3167
3175
  a missing or closed index.
3168
3176
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -3421,8 +3429,7 @@ class IndicesClient(NamespacedClient):
3421
3429
  for this data stream. A data stream lifecycle that's disabled (enabled: `false`)
3422
3430
  will have no effect on the data stream.
3423
3431
  :param expand_wildcards: Type of data stream that wildcard patterns can match.
3424
- Supports comma-separated values, such as `open,hidden`. Valid values are:
3425
- `all`, `hidden`, `open`, `closed`, `none`.
3432
+ Supports comma-separated values, such as `open,hidden`.
3426
3433
  :param master_timeout: Period to wait for a connection to the master node. If
3427
3434
  no response is received before the timeout expires, the request fails and
3428
3435
  returns an error.
@@ -3698,24 +3705,17 @@ class IndicesClient(NamespacedClient):
3698
3705
 
3699
3706
  <p>Update field mappings.
3700
3707
  Add new fields to an existing data stream or index.
3701
- You can also use this API to change the search settings of existing fields and add new properties to existing object fields.
3702
- For data streams, these changes are applied to all backing indices by default.</p>
3703
- <p><strong>Add multi-fields to an existing field</strong></p>
3704
- <p>Multi-fields let you index the same field in different ways.
3705
- You can use this API to update the fields mapping parameter and enable multi-fields for an existing field.
3706
- WARNING: If an index (or data stream) contains documents when you add a multi-field, those documents will not have values for the new multi-field.
3707
- You can populate the new multi-field with the update by query API.</p>
3708
- <p><strong>Change supported mapping parameters for an existing field</strong></p>
3709
- <p>The documentation for each mapping parameter indicates whether you can update it for an existing field using this API.
3710
- For example, you can use the update mapping API to update the <code>ignore_above</code> parameter.</p>
3711
- <p><strong>Change the mapping of an existing field</strong></p>
3712
- <p>Except for supported mapping parameters, you can't change the mapping or field type of an existing field.
3713
- Changing an existing field could invalidate data that's already indexed.</p>
3714
- <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.
3715
- 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>
3716
- <p><strong>Rename a field</strong></p>
3717
- <p>Renaming a field would invalidate data already indexed under the old field name.
3718
- 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>
3719
3719
 
3720
3720
 
3721
3721
  `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-mapping>`_
@@ -3734,7 +3734,7 @@ class IndicesClient(NamespacedClient):
3734
3734
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
3735
3735
  request can target data streams, this argument determines whether wildcard
3736
3736
  expressions match hidden data streams. Supports comma-separated values, such
3737
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
3737
+ as `open,hidden`.
3738
3738
  :param field_names: Control whether field names are enabled for the index.
3739
3739
  :param ignore_unavailable: If `false`, the request returns an error if it targets
3740
3740
  a missing or closed index.
@@ -3852,8 +3852,36 @@ class IndicesClient(NamespacedClient):
3852
3852
  Changes dynamic index settings in real time.
3853
3853
  For data streams, index setting changes are applied to all backing indices by default.</p>
3854
3854
  <p>To revert a setting to the default value, use a null value.
3855
- The list of per-index settings that can be updated dynamically on live indices can be found in index module documentation.
3855
+ The list of per-index settings that can be updated dynamically on live indices can be found in index settings documentation.
3856
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
+ &quot;number_of_replicas&quot;: 1
3862
+ }
3863
+ </code></pre>
3864
+ <p>Or you can use an <code>index</code> setting object:</p>
3865
+ <pre><code>{
3866
+ &quot;index&quot;: {
3867
+ &quot;number_of_replicas&quot;: 1
3868
+ }
3869
+ }
3870
+ </code></pre>
3871
+ <p>Or you can use dot annotation:</p>
3872
+ <pre><code>{
3873
+ &quot;index.number_of_replicas&quot;: 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
+ &quot;settings&quot;: {
3879
+ &quot;index&quot;: {
3880
+ &quot;number_of_replicas&quot;: 1
3881
+ }
3882
+ }
3883
+ }
3884
+ </code></pre>
3857
3885
  <p>NOTE: You can only define new analyzers on closed indices.
3858
3886
  To add an analyzer, you must close the index, define the analyzer, and reopen the index.
3859
3887
  You cannot close the write index of a data stream.
@@ -3861,7 +3889,8 @@ class IndicesClient(NamespacedClient):
3861
3889
  Then roll over the data stream to apply the new analyzer to the stream's write index and future backing indices.
3862
3890
  This affects searches and any new data added to the stream after the rollover.
3863
3891
  However, it does not affect the data stream's backing indices or their existing data.
3864
- To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.</p>
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>
3865
3894
 
3866
3895
 
3867
3896
  `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-settings>`_
@@ -3973,7 +4002,7 @@ class IndicesClient(NamespacedClient):
3973
4002
  """
3974
4003
  .. raw:: html
3975
4004
 
3976
- <p>Create or update an index template.
4005
+ <p>Create or update a legacy index template.
3977
4006
  Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
3978
4007
  Elasticsearch applies templates to new indices based on an index pattern that matches the index name.</p>
3979
4008
  <p>IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.</p>
@@ -4062,10 +4091,20 @@ class IndicesClient(NamespacedClient):
4062
4091
  *,
4063
4092
  index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4064
4093
  active_only: t.Optional[bool] = None,
4094
+ allow_no_indices: t.Optional[bool] = None,
4065
4095
  detailed: t.Optional[bool] = None,
4066
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,
4067
4105
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4068
4106
  human: t.Optional[bool] = None,
4107
+ ignore_unavailable: t.Optional[bool] = None,
4069
4108
  pretty: t.Optional[bool] = None,
4070
4109
  ) -> ObjectApiResponse[t.Any]:
4071
4110
  """
@@ -4098,8 +4137,17 @@ class IndicesClient(NamespacedClient):
4098
4137
  to limit the request. Supports wildcards (`*`). To target all data streams
4099
4138
  and indices, omit this parameter or use `*` or `_all`.
4100
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.
4101
4143
  :param detailed: If `true`, the response includes detailed information about
4102
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.
4103
4151
  """
4104
4152
  __path_parts: t.Dict[str, str]
4105
4153
  if index not in SKIP_IN_PATH:
@@ -4111,14 +4159,20 @@ class IndicesClient(NamespacedClient):
4111
4159
  __query: t.Dict[str, t.Any] = {}
4112
4160
  if active_only is not None:
4113
4161
  __query["active_only"] = active_only
4162
+ if allow_no_indices is not None:
4163
+ __query["allow_no_indices"] = allow_no_indices
4114
4164
  if detailed is not None:
4115
4165
  __query["detailed"] = detailed
4116
4166
  if error_trace is not None:
4117
4167
  __query["error_trace"] = error_trace
4168
+ if expand_wildcards is not None:
4169
+ __query["expand_wildcards"] = expand_wildcards
4118
4170
  if filter_path is not None:
4119
4171
  __query["filter_path"] = filter_path
4120
4172
  if human is not None:
4121
4173
  __query["human"] = human
4174
+ if ignore_unavailable is not None:
4175
+ __query["ignore_unavailable"] = ignore_unavailable
4122
4176
  if pretty is not None:
4123
4177
  __query["pretty"] = pretty
4124
4178
  __headers = {"accept": "application/json"}
@@ -4177,7 +4231,7 @@ class IndicesClient(NamespacedClient):
4177
4231
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
4178
4232
  request can target data streams, this argument determines whether wildcard
4179
4233
  expressions match hidden data streams. Supports comma-separated values, such
4180
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
4234
+ as `open,hidden`.
4181
4235
  :param ignore_unavailable: If `false`, the request returns an error if it targets
4182
4236
  a missing or closed index.
4183
4237
  """
@@ -4376,10 +4430,9 @@ class IndicesClient(NamespacedClient):
4376
4430
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
4377
4431
  request can target data streams, this argument determines whether wildcard
4378
4432
  expressions match hidden data streams. Supports comma-separated values, such
4379
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
4380
- NOTE: This option is only supported when specifying an index expression.
4381
- You will get an error if you specify index options to the `_resolve/cluster`
4382
- 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.
4383
4436
  :param ignore_throttled: If true, concrete, expanded, or aliased indices are
4384
4437
  ignored when frozen. NOTE: This option is only supported when specifying
4385
4438
  an index expression. You will get an error if you specify index options to
@@ -4472,7 +4525,7 @@ class IndicesClient(NamespacedClient):
4472
4525
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
4473
4526
  request can target data streams, this argument determines whether wildcard
4474
4527
  expressions match hidden data streams. Supports comma-separated values, such
4475
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
4528
+ as `open,hidden`.
4476
4529
  :param ignore_unavailable: If `false`, the request returns an error if it targets
4477
4530
  a missing or closed index.
4478
4531
  """
@@ -4686,7 +4739,7 @@ class IndicesClient(NamespacedClient):
4686
4739
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
4687
4740
  request can target data streams, this argument determines whether wildcard
4688
4741
  expressions match hidden data streams. Supports comma-separated values, such
4689
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
4742
+ as `open,hidden`.
4690
4743
  :param ignore_unavailable: If `false`, the request returns an error if it targets
4691
4744
  a missing or closed index.
4692
4745
  """
@@ -5510,7 +5563,7 @@ class IndicesClient(NamespacedClient):
5510
5563
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
5511
5564
  request can target data streams, this argument determines whether wildcard
5512
5565
  expressions match hidden data streams. Supports comma-separated values, such
5513
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
5566
+ as `open,hidden`.
5514
5567
  :param explain: If `true`, the response returns detailed information if an error
5515
5568
  has occurred.
5516
5569
  :param ignore_unavailable: If `false`, the request returns an error if it targets