elasticsearch 8.17.0__py3-none-any.whl → 8.17.1__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 (68) hide show
  1. elasticsearch/_async/client/__init__.py +153 -51
  2. elasticsearch/_async/client/cat.py +64 -195
  3. elasticsearch/_async/client/cluster.py +19 -19
  4. elasticsearch/_async/client/connector.py +337 -0
  5. elasticsearch/_async/client/dangling_indices.py +3 -3
  6. elasticsearch/_async/client/ilm.py +6 -6
  7. elasticsearch/_async/client/indices.py +360 -81
  8. elasticsearch/_async/client/inference.py +94 -1
  9. elasticsearch/_async/client/ingest.py +175 -2
  10. elasticsearch/_async/client/logstash.py +9 -6
  11. elasticsearch/_async/client/migration.py +16 -7
  12. elasticsearch/_async/client/ml.py +12 -6
  13. elasticsearch/_async/client/monitoring.py +2 -1
  14. elasticsearch/_async/client/nodes.py +3 -3
  15. elasticsearch/_async/client/query_rules.py +33 -12
  16. elasticsearch/_async/client/rollup.py +88 -13
  17. elasticsearch/_async/client/search_application.py +130 -1
  18. elasticsearch/_async/client/searchable_snapshots.py +32 -23
  19. elasticsearch/_async/client/security.py +676 -55
  20. elasticsearch/_async/client/shutdown.py +38 -15
  21. elasticsearch/_async/client/simulate.py +151 -0
  22. elasticsearch/_async/client/slm.py +138 -19
  23. elasticsearch/_async/client/snapshot.py +307 -23
  24. elasticsearch/_async/client/sql.py +66 -46
  25. elasticsearch/_async/client/synonyms.py +39 -19
  26. elasticsearch/_async/client/tasks.py +68 -28
  27. elasticsearch/_async/client/text_structure.py +466 -46
  28. elasticsearch/_async/client/transform.py +9 -2
  29. elasticsearch/_async/client/watcher.py +207 -41
  30. elasticsearch/_async/client/xpack.py +11 -6
  31. elasticsearch/_sync/client/__init__.py +153 -51
  32. elasticsearch/_sync/client/cat.py +64 -195
  33. elasticsearch/_sync/client/cluster.py +19 -19
  34. elasticsearch/_sync/client/connector.py +337 -0
  35. elasticsearch/_sync/client/dangling_indices.py +3 -3
  36. elasticsearch/_sync/client/ilm.py +6 -6
  37. elasticsearch/_sync/client/indices.py +360 -81
  38. elasticsearch/_sync/client/inference.py +94 -1
  39. elasticsearch/_sync/client/ingest.py +175 -2
  40. elasticsearch/_sync/client/logstash.py +9 -6
  41. elasticsearch/_sync/client/migration.py +16 -7
  42. elasticsearch/_sync/client/ml.py +12 -6
  43. elasticsearch/_sync/client/monitoring.py +2 -1
  44. elasticsearch/_sync/client/nodes.py +3 -3
  45. elasticsearch/_sync/client/query_rules.py +33 -12
  46. elasticsearch/_sync/client/rollup.py +88 -13
  47. elasticsearch/_sync/client/search_application.py +130 -1
  48. elasticsearch/_sync/client/searchable_snapshots.py +32 -23
  49. elasticsearch/_sync/client/security.py +676 -55
  50. elasticsearch/_sync/client/shutdown.py +38 -15
  51. elasticsearch/_sync/client/simulate.py +151 -0
  52. elasticsearch/_sync/client/slm.py +138 -19
  53. elasticsearch/_sync/client/snapshot.py +307 -23
  54. elasticsearch/_sync/client/sql.py +66 -46
  55. elasticsearch/_sync/client/synonyms.py +39 -19
  56. elasticsearch/_sync/client/tasks.py +68 -28
  57. elasticsearch/_sync/client/text_structure.py +466 -46
  58. elasticsearch/_sync/client/transform.py +9 -2
  59. elasticsearch/_sync/client/watcher.py +207 -41
  60. elasticsearch/_sync/client/xpack.py +11 -6
  61. elasticsearch/_version.py +1 -1
  62. elasticsearch/client.py +2 -0
  63. {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.1.dist-info}/METADATA +1 -1
  64. elasticsearch-8.17.1.dist-info/RECORD +119 -0
  65. elasticsearch-8.17.0.dist-info/RECORD +0 -117
  66. {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.1.dist-info}/WHEEL +0 -0
  67. {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.1.dist-info}/licenses/LICENSE +0 -0
  68. {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.1.dist-info}/licenses/NOTICE +0 -0
@@ -143,8 +143,12 @@ class IndicesClient(NamespacedClient):
143
143
  body: t.Optional[t.Dict[str, t.Any]] = None,
144
144
  ) -> ObjectApiResponse[t.Any]:
145
145
  """
146
- Get tokens from text analysis. The analyze API performs [analysis](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis.html)
147
- on a text string and returns the resulting tokens.
146
+ Get tokens from text analysis. The analyze API performs analysis on a text string
147
+ and returns the resulting tokens. Generating excessive amount of tokens may cause
148
+ a node to run out of memory. The `index.analyze.max_token_count` setting enables
149
+ you to limit the number of tokens that can be produced. If more than this limit
150
+ of tokens gets generated, an error occurs. The `_analyze` endpoint without a
151
+ specified index will always use `10000` as its limit.
148
152
 
149
153
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-analyze.html>`_
150
154
 
@@ -246,7 +250,10 @@ class IndicesClient(NamespacedClient):
246
250
  ) -> ObjectApiResponse[t.Any]:
247
251
  """
248
252
  Clear the cache. Clear the cache of one or more indices. For data streams, the
249
- API clears the caches of the stream's backing indices.
253
+ API clears the caches of the stream's backing indices. By default, the clear
254
+ cache API clears all caches. To clear only specific caches, use the `fielddata`,
255
+ `query`, or `request` parameters. To clear the cache only of specific fields,
256
+ use the `fields` parameter.
250
257
 
251
258
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-clearcache.html>`_
252
259
 
@@ -347,10 +354,28 @@ class IndicesClient(NamespacedClient):
347
354
  the new index, which is a much more time consuming process. * Finally, it recovers
348
355
  the target index as though it were a closed index which had just been re-opened.
349
356
  IMPORTANT: Indices can only be cloned if they meet the following requirements:
357
+ * The index must be marked as read-only and have a cluster health status of green.
350
358
  * The target index must not exist. * The source index must have the same number
351
359
  of primary shards as the target index. * The node handling the clone process
352
360
  must have sufficient free disk space to accommodate a second copy of the existing
353
- index.
361
+ index. The current write index on a data stream cannot be cloned. In order to
362
+ clone the current write index, the data stream must first be rolled over so that
363
+ a new write index is created and then the previous write index can be cloned.
364
+ NOTE: Mappings cannot be specified in the `_clone` request. The mappings of the
365
+ source index will be used for the target index. **Monitor the cloning process**
366
+ The cloning process can be monitored with the cat recovery API or the cluster
367
+ health API can be used to wait until all primary shards have been allocated by
368
+ setting the `wait_for_status` parameter to `yellow`. The `_clone` API returns
369
+ as soon as the target index has been added to the cluster state, before any shards
370
+ have been allocated. At this point, all shards are in the state unassigned. If,
371
+ for any reason, the target index can't be allocated, its primary shard will remain
372
+ unassigned until it can be allocated on that node. Once the primary shard is
373
+ allocated, it moves to state initializing, and the clone process begins. When
374
+ the clone operation completes, the shard will become active. At that point, Elasticsearch
375
+ will try to allocate any replicas and may decide to relocate the primary shard
376
+ to another node. **Wait for active shards** Because the clone operation creates
377
+ a new index to clone the shards to, the wait for active shards setting on index
378
+ creation applies to the clone index action as well.
354
379
 
355
380
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-clone-index.html>`_
356
381
 
@@ -536,7 +561,26 @@ class IndicesClient(NamespacedClient):
536
561
  body: t.Optional[t.Dict[str, t.Any]] = None,
537
562
  ) -> ObjectApiResponse[t.Any]:
538
563
  """
539
- Create an index. Creates a new index.
564
+ Create an index. You can use the create index API to add a new index to an Elasticsearch
565
+ cluster. When creating an index, you can specify the following: * Settings for
566
+ the index. * Mappings for fields in the index. * Index aliases **Wait for active
567
+ shards** By default, index creation will only return a response to the client
568
+ when the primary copies of each shard have been started, or the request times
569
+ out. The index creation response will indicate what happened. For example, `acknowledged`
570
+ indicates whether the index was successfully created in the cluster, `while shards_acknowledged`
571
+ indicates whether the requisite number of shard copies were started for each
572
+ shard in the index before timing out. Note that it is still possible for either
573
+ `acknowledged` or `shards_acknowledged` to be `false`, but for the index creation
574
+ to be successful. These values simply indicate whether the operation completed
575
+ before the timeout. If `acknowledged` is false, the request timed out before
576
+ the cluster state was updated with the newly created index, but it probably will
577
+ be created sometime soon. If `shards_acknowledged` is false, then the request
578
+ timed out before the requisite number of shards were started (by default just
579
+ the primaries), even if the cluster state was successfully updated to reflect
580
+ the newly created index (that is to say, `acknowledged` is `true`). You can change
581
+ the default of only waiting for the primary shards to start through the index
582
+ setting `index.write.wait_for_active_shards`. Note that changing this setting
583
+ will also affect the `wait_for_active_shards` value on all subsequent write operations.
540
584
 
541
585
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-create-index.html>`_
542
586
 
@@ -732,7 +776,11 @@ class IndicesClient(NamespacedClient):
732
776
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
733
777
  ) -> ObjectApiResponse[t.Any]:
734
778
  """
735
- Delete indices. Deletes one or more indices.
779
+ Delete indices. Deleting an index deletes its documents, shards, and metadata.
780
+ It does not delete related Kibana components, such as data views, visualizations,
781
+ or dashboards. You cannot delete the current write index of a data stream. To
782
+ delete the index, you must roll over the data stream so a new write index is
783
+ created. You can then use the delete index API to delete the previous write index.
736
784
 
737
785
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-index.html>`_
738
786
 
@@ -804,7 +852,7 @@ class IndicesClient(NamespacedClient):
804
852
  """
805
853
  Delete an alias. Removes a data stream or index from an alias.
806
854
 
807
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html>`_
855
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-alias.html>`_
808
856
 
809
857
  :param index: Comma-separated list of data streams or indices used to limit the
810
858
  request. Supports wildcards (`*`).
@@ -1034,7 +1082,7 @@ class IndicesClient(NamespacedClient):
1034
1082
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1035
1083
  ) -> ObjectApiResponse[t.Any]:
1036
1084
  """
1037
- Deletes a legacy index template.
1085
+ Delete a legacy index template.
1038
1086
 
1039
1087
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-template-v1.html>`_
1040
1088
 
@@ -1100,7 +1148,13 @@ class IndicesClient(NamespacedClient):
1100
1148
  Analyze the index disk usage. Analyze the disk usage of each field of an index
1101
1149
  or data stream. This API might not support indices created in previous Elasticsearch
1102
1150
  versions. The result of a small index can be inaccurate as some parts of an index
1103
- might not be analyzed by the API.
1151
+ might not be analyzed by the API. NOTE: The total size of fields of the analyzed
1152
+ shards of the index in the response is usually smaller than the index `store_size`
1153
+ value because some small metadata files are ignored and some parts of data files
1154
+ might not be scanned by the API. Since stored fields are stored together in a
1155
+ compressed format, the sizes of stored fields are also estimates and can be inaccurate.
1156
+ The stored size of the `_id` field is likely underestimated while the `_source`
1157
+ field is overestimated.
1104
1158
 
1105
1159
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-disk-usage.html>`_
1106
1160
 
@@ -1249,8 +1303,7 @@ class IndicesClient(NamespacedClient):
1249
1303
  pretty: t.Optional[bool] = None,
1250
1304
  ) -> HeadApiResponse:
1251
1305
  """
1252
- Check indices. Checks if one or more indices, index aliases, or data streams
1253
- exist.
1306
+ Check indices. Check if one or more indices, index aliases, or data streams exist.
1254
1307
 
1255
1308
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-exists.html>`_
1256
1309
 
@@ -1447,16 +1500,21 @@ class IndicesClient(NamespacedClient):
1447
1500
  pretty: t.Optional[bool] = None,
1448
1501
  ) -> HeadApiResponse:
1449
1502
  """
1450
- Check existence of index templates. Returns information about whether a particular
1451
- index template exists.
1503
+ Check existence of index templates. Get information about whether index templates
1504
+ exist. Index templates define settings, mappings, and aliases that can be applied
1505
+ automatically to new indices. IMPORTANT: This documentation is about legacy index
1506
+ templates, which are deprecated and will be replaced by the composable templates
1507
+ introduced in Elasticsearch 7.8.
1452
1508
 
1453
1509
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-template-exists-v1.html>`_
1454
1510
 
1455
- :param name: The comma separated names of the index templates
1456
- :param flat_settings: Return settings in flat format (default: false)
1457
- :param local: Return local information, do not retrieve the state from master
1458
- node (default: false)
1459
- :param master_timeout: Explicit operation timeout for connection to master node
1511
+ :param name: A comma-separated list of index template names used to limit the
1512
+ request. Wildcard (`*`) expressions are supported.
1513
+ :param flat_settings: Indicates whether to use a flat format for the response.
1514
+ :param local: Indicates whether to get information from the local node only.
1515
+ :param master_timeout: The period to wait for the master node. If the master
1516
+ node is not available before the timeout expires, the request fails and returns
1517
+ an error. To indicate that the request should never timeout, set it to `-1`.
1460
1518
  """
1461
1519
  if name in SKIP_IN_PATH:
1462
1520
  raise ValueError("Empty value passed for parameter 'name'")
@@ -1570,7 +1628,10 @@ class IndicesClient(NamespacedClient):
1570
1628
  Get field usage stats. Get field usage information for each shard and field of
1571
1629
  an index. Field usage statistics are automatically captured when queries are
1572
1630
  running on a cluster. A shard-level search request that accesses a given field,
1573
- even if multiple times during that request, is counted as a single use.
1631
+ even if multiple times during that request, is counted as a single use. The response
1632
+ body reports the per-shard usage count of the data structures that back the fields
1633
+ in the index. A given request will increment each count by a maximum value of
1634
+ 1, even if the request accesses the same field multiple times.
1574
1635
 
1575
1636
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/field-usage-stats.html>`_
1576
1637
 
@@ -1770,7 +1831,35 @@ class IndicesClient(NamespacedClient):
1770
1831
  merges. So the number of soft-deleted documents can then grow rapidly, resulting
1771
1832
  in higher disk usage and worse search performance. If you regularly force merge
1772
1833
  an index receiving writes, this can also make snapshots more expensive, since
1773
- the new documents can't be backed up incrementally.
1834
+ the new documents can't be backed up incrementally. **Blocks during a force merge**
1835
+ Calls to this API block until the merge is complete (unless request contains
1836
+ `wait_for_completion=false`). If the client connection is lost before completion
1837
+ then the force merge process will continue in the background. Any new requests
1838
+ to force merge the same indices will also block until the ongoing force merge
1839
+ is complete. **Running force merge asynchronously** If the request contains `wait_for_completion=false`,
1840
+ Elasticsearch performs some preflight checks, launches the request, and returns
1841
+ a task you can use to get the status of the task. However, you can not cancel
1842
+ this task as the force merge task is not cancelable. Elasticsearch creates a
1843
+ record of this task as a document at `_tasks/<task_id>`. When you are done with
1844
+ a task, you should delete the task document so Elasticsearch can reclaim the
1845
+ space. **Force merging multiple indices** You can force merge multiple indices
1846
+ with a single request by targeting: * One or more data streams that contain multiple
1847
+ backing indices * Multiple indices * One or more aliases * All data streams and
1848
+ indices in a cluster Each targeted shard is force-merged separately using the
1849
+ force_merge threadpool. By default each node only has a single `force_merge`
1850
+ thread which means that the shards on that node are force-merged one at a time.
1851
+ If you expand the `force_merge` threadpool on a node then it will force merge
1852
+ its shards in parallel Force merge makes the storage for the shard being merged
1853
+ temporarily increase, as it may require free space up to triple its size in case
1854
+ `max_num_segments parameter` is set to `1`, to rewrite all segments into a new
1855
+ one. **Data streams and time-based indices** Force-merging is useful for managing
1856
+ a data stream's older backing indices and other time-based indices, particularly
1857
+ after a rollover. In these cases, each index only receives indexing traffic for
1858
+ a certain period of time. Once an index receive no more writes, its shards can
1859
+ be force-merged to a single segment. This can be a good idea because single-segment
1860
+ shards can sometimes use simpler and more efficient data structures to perform
1861
+ searches. For example: ``` POST /.ds-my-data-stream-2099.03.07-000001/_forcemerge?max_num_segments=1
1862
+ ```
1774
1863
 
1775
1864
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-forcemerge.html>`_
1776
1865
 
@@ -1863,8 +1952,8 @@ class IndicesClient(NamespacedClient):
1863
1952
  pretty: t.Optional[bool] = None,
1864
1953
  ) -> ObjectApiResponse[t.Any]:
1865
1954
  """
1866
- Get index information. Returns information about one or more indices. For data
1867
- streams, the API returns information about the stream’s backing indices.
1955
+ Get index information. Get information about one or more indices. For data streams,
1956
+ the API returns information about the stream’s backing indices.
1868
1957
 
1869
1958
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-index.html>`_
1870
1959
 
@@ -1955,7 +2044,7 @@ class IndicesClient(NamespacedClient):
1955
2044
  """
1956
2045
  Get aliases. Retrieves information for one or more data stream or index aliases.
1957
2046
 
1958
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html>`_
2047
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-alias.html>`_
1959
2048
 
1960
2049
  :param index: Comma-separated list of data streams or indices used to limit the
1961
2050
  request. Supports wildcards (`*`). To target all data streams and indices,
@@ -2080,6 +2169,42 @@ class IndicesClient(NamespacedClient):
2080
2169
  path_parts=__path_parts,
2081
2170
  )
2082
2171
 
2172
+ @_rewrite_parameters()
2173
+ def get_data_lifecycle_stats(
2174
+ self,
2175
+ *,
2176
+ error_trace: t.Optional[bool] = None,
2177
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2178
+ human: t.Optional[bool] = None,
2179
+ pretty: t.Optional[bool] = None,
2180
+ ) -> ObjectApiResponse[t.Any]:
2181
+ """
2182
+ Get data stream lifecycle stats. Get statistics about the data streams that are
2183
+ managed by a data stream lifecycle.
2184
+
2185
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-get-lifecycle-stats.html>`_
2186
+ """
2187
+ __path_parts: t.Dict[str, str] = {}
2188
+ __path = "/_lifecycle/stats"
2189
+ __query: t.Dict[str, t.Any] = {}
2190
+ if error_trace is not None:
2191
+ __query["error_trace"] = error_trace
2192
+ if filter_path is not None:
2193
+ __query["filter_path"] = filter_path
2194
+ if human is not None:
2195
+ __query["human"] = human
2196
+ if pretty is not None:
2197
+ __query["pretty"] = pretty
2198
+ __headers = {"accept": "application/json"}
2199
+ return self.perform_request( # type: ignore[return-value]
2200
+ "GET",
2201
+ __path,
2202
+ params=__query,
2203
+ headers=__headers,
2204
+ endpoint_id="indices.get_data_lifecycle_stats",
2205
+ path_parts=__path_parts,
2206
+ )
2207
+
2083
2208
  @_rewrite_parameters()
2084
2209
  def get_data_stream(
2085
2210
  self,
@@ -2179,11 +2304,13 @@ class IndicesClient(NamespacedClient):
2179
2304
  """
2180
2305
  Get mapping definitions. Retrieves mapping definitions for one or more fields.
2181
2306
  For data streams, the API retrieves field mappings for the stream’s backing indices.
2307
+ This API is useful if you don't need a complete mapping or if an index mapping
2308
+ contains a large number of fields.
2182
2309
 
2183
2310
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-field-mapping.html>`_
2184
2311
 
2185
2312
  :param fields: Comma-separated list or wildcard expression of fields used to
2186
- limit returned information.
2313
+ limit returned information. Supports wildcards (`*`).
2187
2314
  :param index: Comma-separated list of data streams, indices, and aliases used
2188
2315
  to limit the request. Supports wildcards (`*`). To target all data streams
2189
2316
  and indices, omit this parameter or use `*` or `_all`.
@@ -2255,7 +2382,7 @@ class IndicesClient(NamespacedClient):
2255
2382
  pretty: t.Optional[bool] = None,
2256
2383
  ) -> ObjectApiResponse[t.Any]:
2257
2384
  """
2258
- Get index templates. Returns information about one or more index templates.
2385
+ Get index templates. Get information about one or more index templates.
2259
2386
 
2260
2387
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-template.html>`_
2261
2388
 
@@ -2328,8 +2455,8 @@ class IndicesClient(NamespacedClient):
2328
2455
  pretty: t.Optional[bool] = None,
2329
2456
  ) -> ObjectApiResponse[t.Any]:
2330
2457
  """
2331
- Get mapping definitions. Retrieves mapping definitions for one or more indices.
2332
- For data streams, the API retrieves mappings for the stream’s backing indices.
2458
+ Get mapping definitions. For data streams, the API retrieves mappings for the
2459
+ stream’s backing indices.
2333
2460
 
2334
2461
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-mapping.html>`_
2335
2462
 
@@ -2413,8 +2540,8 @@ class IndicesClient(NamespacedClient):
2413
2540
  pretty: t.Optional[bool] = None,
2414
2541
  ) -> ObjectApiResponse[t.Any]:
2415
2542
  """
2416
- Get index settings. Returns setting information for one or more indices. For
2417
- data streams, returns setting information for the streams backing indices.
2543
+ Get index settings. Get setting information for one or more indices. For data
2544
+ streams, it returns setting information for the stream's backing indices.
2418
2545
 
2419
2546
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-settings.html>`_
2420
2547
 
@@ -2501,7 +2628,9 @@ class IndicesClient(NamespacedClient):
2501
2628
  pretty: t.Optional[bool] = None,
2502
2629
  ) -> ObjectApiResponse[t.Any]:
2503
2630
  """
2504
- Get index templates. Retrieves information about one or more index templates.
2631
+ Get index templates. Get information about one or more index templates. IMPORTANT:
2632
+ This documentation is about legacy index templates, which are deprecated and
2633
+ will be replaced by the composable templates introduced in Elasticsearch 7.8.
2505
2634
 
2506
2635
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-template-v1.html>`_
2507
2636
 
@@ -2680,7 +2809,27 @@ class IndicesClient(NamespacedClient):
2680
2809
  ] = None,
2681
2810
  ) -> ObjectApiResponse[t.Any]:
2682
2811
  """
2683
- Opens a closed index. For data streams, the API opens any closed backing indices.
2812
+ Open a closed index. For data streams, the API opens any closed backing indices.
2813
+ A closed index is blocked for read/write operations and does not allow all operations
2814
+ that opened indices allow. It is not possible to index documents or to search
2815
+ for documents in a closed index. This allows closed indices to not have to maintain
2816
+ internal data structures for indexing or searching documents, resulting in a
2817
+ smaller overhead on the cluster. When opening or closing an index, the master
2818
+ is responsible for restarting the index shards to reflect the new state of the
2819
+ index. The shards will then go through the normal recovery process. The data
2820
+ of opened or closed indices is automatically replicated by the cluster to ensure
2821
+ that enough shard copies are safely kept around at all times. You can open and
2822
+ close multiple indices. An error is thrown if the request explicitly refers to
2823
+ a missing index. This behavior can be turned off by using the `ignore_unavailable=true`
2824
+ parameter. By default, you must explicitly name the indices you are opening or
2825
+ closing. To open or close indices with `_all`, `*`, or other wildcard expressions,
2826
+ change the `action.destructive_requires_name` setting to `false`. This setting
2827
+ can also be changed with the cluster update settings API. Closed indices consume
2828
+ a significant amount of disk-space which can cause problems in managed environments.
2829
+ Closing indices can be turned off with the cluster settings API by setting `cluster.indices.close.enable`
2830
+ to `false`. Because opening or closing an index allocates its shards, the `wait_for_active_shards`
2831
+ setting on index creation applies to the `_open` and `_close` index actions as
2832
+ well.
2684
2833
 
2685
2834
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-open-close.html>`_
2686
2835
 
@@ -3033,7 +3182,33 @@ class IndicesClient(NamespacedClient):
3033
3182
  ) -> ObjectApiResponse[t.Any]:
3034
3183
  """
3035
3184
  Create or update an index template. Index templates define settings, mappings,
3036
- and aliases that can be applied automatically to new indices.
3185
+ and aliases that can be applied automatically to new indices. Elasticsearch applies
3186
+ templates to new indices based on an wildcard pattern that matches the index
3187
+ name. Index templates are applied during data stream or index creation. For data
3188
+ streams, these settings and mappings are applied when the stream's backing indices
3189
+ are created. Settings and mappings specified in a create index API request override
3190
+ any settings or mappings specified in an index template. Changes to index templates
3191
+ do not affect existing indices, including the existing backing indices of a data
3192
+ stream. You can use C-style `/* *\\/` block comments in index templates. You
3193
+ can include comments anywhere in the request body, except before the opening
3194
+ curly bracket. **Multiple matching templates** If multiple index templates match
3195
+ the name of a new index or data stream, the template with the highest priority
3196
+ is used. Multiple templates with overlapping index patterns at the same priority
3197
+ are not allowed and an error will be thrown when attempting to create a template
3198
+ matching an existing index template at identical priorities. **Composing aliases,
3199
+ mappings, and settings** When multiple component templates are specified in the
3200
+ `composed_of` field for an index template, they are merged in the order specified,
3201
+ meaning that later component templates override earlier component templates.
3202
+ Any mappings, settings, or aliases from the parent index template are merged
3203
+ in next. Finally, any configuration on the index request itself is merged. Mapping
3204
+ definitions are merged recursively, which means that later mapping components
3205
+ can introduce new field mappings and update the mapping configuration. If a field
3206
+ mapping is already contained in an earlier component, its definition will be
3207
+ completely overwritten by the later one. This recursive merging strategy applies
3208
+ not only to field mappings, but also root options like `dynamic_templates` and
3209
+ `meta`. If an earlier component contains a `dynamic_templates` block, then by
3210
+ default new `dynamic_templates` entries are appended onto the end. If an entry
3211
+ already exists with the same key, then it is overwritten by the new definition.
3037
3212
 
3038
3213
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-put-template.html>`_
3039
3214
 
@@ -3063,8 +3238,11 @@ class IndicesClient(NamespacedClient):
3063
3238
  :param master_timeout: Period to wait for a connection to the master node. If
3064
3239
  no response is received before the timeout expires, the request fails and
3065
3240
  returns an error.
3066
- :param meta: Optional user metadata about the index template. May have any contents.
3067
- This map is not automatically generated by Elasticsearch.
3241
+ :param meta: Optional user metadata about the index template. It may have any
3242
+ contents. It is not automatically generated or used by Elasticsearch. This
3243
+ user-defined object is stored in the cluster state, so keeping it short is
3244
+ preferable To unset the metadata, replace the template without specifying
3245
+ it.
3068
3246
  :param priority: Priority to determine index template precedence when a new data
3069
3247
  stream or index is created. The index template with the highest priority
3070
3248
  is chosen. If no priority is specified the template is treated as though
@@ -3073,7 +3251,9 @@ class IndicesClient(NamespacedClient):
3073
3251
  :param template: Template to be applied. It may optionally include an `aliases`,
3074
3252
  `mappings`, or `settings` configuration.
3075
3253
  :param version: Version number used to manage index templates externally. This
3076
- number is not automatically generated by Elasticsearch.
3254
+ number is not automatically generated by Elasticsearch. External systems
3255
+ can use these version numbers to simplify template management. To unset a
3256
+ version, replace the template without specifying one.
3077
3257
  """
3078
3258
  if name in SKIP_IN_PATH:
3079
3259
  raise ValueError("Empty value passed for parameter 'name'")
@@ -3192,9 +3372,27 @@ class IndicesClient(NamespacedClient):
3192
3372
  body: t.Optional[t.Dict[str, t.Any]] = None,
3193
3373
  ) -> ObjectApiResponse[t.Any]:
3194
3374
  """
3195
- Update field mappings. Adds new fields to an existing data stream or index. You
3196
- can also use this API to change the search settings of existing fields. For data
3197
- streams, these changes are applied to all backing indices by default.
3375
+ Update field mappings. Add new fields to an existing data stream or index. You
3376
+ can also use this API to change the search settings of existing fields and add
3377
+ new properties to existing object fields. For data streams, these changes are
3378
+ applied to all backing indices by default. **Add multi-fields to an existing
3379
+ field** Multi-fields let you index the same field in different ways. You can
3380
+ use this API to update the fields mapping parameter and enable multi-fields for
3381
+ an existing field. WARNING: If an index (or data stream) contains documents when
3382
+ you add a multi-field, those documents will not have values for the new multi-field.
3383
+ You can populate the new multi-field with the update by query API. **Change supported
3384
+ mapping parameters for an existing field** The documentation for each mapping
3385
+ parameter indicates whether you can update it for an existing field using this
3386
+ API. For example, you can use the update mapping API to update the `ignore_above`
3387
+ parameter. **Change the mapping of an existing field** Except for supported mapping
3388
+ parameters, you can't change the mapping or field type of an existing field.
3389
+ Changing an existing field could invalidate data that's already indexed. If you
3390
+ need to change the mapping of a field in a data stream's backing indices, refer
3391
+ to documentation about modifying data streams. If you need to change the mapping
3392
+ of a field in other indices, create a new index with the correct mapping and
3393
+ reindex your data into that index. **Rename a field** Renaming a field would
3394
+ invalidate data already indexed under the old field name. Instead, add an alias
3395
+ field to create an alternate field name.
3198
3396
 
3199
3397
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-put-mapping.html>`_
3200
3398
 
@@ -3325,6 +3523,19 @@ class IndicesClient(NamespacedClient):
3325
3523
  """
3326
3524
  Update index settings. Changes dynamic index settings in real time. For data
3327
3525
  streams, index setting changes are applied to all backing indices by default.
3526
+ To revert a setting to the default value, use a null value. The list of per-index
3527
+ settings that can be updated dynamically on live indices can be found in index
3528
+ module documentation. To preserve existing settings from being updated, set the
3529
+ `preserve_existing` parameter to `true`. NOTE: You can only define new analyzers
3530
+ on closed indices. To add an analyzer, you must close the index, define the analyzer,
3531
+ and reopen the index. You cannot close the write index of a data stream. To update
3532
+ the analyzer for a data stream's write index and future backing indices, update
3533
+ the analyzer in the index template used by the stream. Then roll over the data
3534
+ stream to apply the new analyzer to the stream's write index and future backing
3535
+ indices. This affects searches and any new data added to the stream after the
3536
+ rollover. However, it does not affect the data stream's backing indices or their
3537
+ existing data. To change the analyzer for existing backing indices, you must
3538
+ create a new data stream and reindex your data into it.
3328
3539
 
3329
3540
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-update-settings.html>`_
3330
3541
 
@@ -3438,7 +3649,14 @@ class IndicesClient(NamespacedClient):
3438
3649
  according to their order. Index templates are only applied during index creation.
3439
3650
  Changes to index templates do not affect existing indices. Settings and mappings
3440
3651
  specified in create index API requests override any settings or mappings specified
3441
- in an index template.
3652
+ in an index template. You can use C-style `/* *\\/` block comments in index templates.
3653
+ You can include comments anywhere in the request body, except before the opening
3654
+ curly bracket. **Indices matching multiple templates** Multiple index templates
3655
+ can potentially match an index, in this case, both the settings and mappings
3656
+ are merged into the final configuration of the index. The order of the merging
3657
+ can be controlled using the order parameter, with lower order being applied first,
3658
+ and higher orders overriding them. NOTE: Multiple matching templates with the
3659
+ same order value will result in a non-deterministic merging order.
3442
3660
 
3443
3661
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-templates-v1.html>`_
3444
3662
 
@@ -3459,7 +3677,8 @@ class IndicesClient(NamespacedClient):
3459
3677
  with lower values.
3460
3678
  :param settings: Configuration options for the index.
3461
3679
  :param version: Version number used to manage index templates externally. This
3462
- number is not automatically generated by Elasticsearch.
3680
+ number is not automatically generated by Elasticsearch. To unset a version,
3681
+ replace the template without specifying one.
3463
3682
  """
3464
3683
  if name in SKIP_IN_PATH:
3465
3684
  raise ValueError("Empty value passed for parameter 'name'")
@@ -3520,23 +3739,25 @@ class IndicesClient(NamespacedClient):
3520
3739
  """
3521
3740
  Get index recovery information. Get information about ongoing and completed shard
3522
3741
  recoveries for one or more indices. For data streams, the API returns information
3523
- for the stream's backing indices. Shard recovery is the process of initializing
3524
- a shard copy, such as restoring a primary shard from a snapshot or creating a
3525
- replica shard from a primary shard. When a shard recovery completes, the recovered
3526
- shard is available for search and indexing. Recovery automatically occurs during
3527
- the following processes: * When creating an index for the first time. * When
3528
- a node rejoins the cluster and starts up any missing primary shard copies using
3529
- the data that it holds in its data path. * Creation of new replica shard copies
3530
- from the primary. * Relocation of a shard copy to a different node in the same
3531
- cluster. * A snapshot restore operation. * A clone, shrink, or split operation.
3532
- You can determine the cause of a shard recovery using the recovery or cat recovery
3533
- APIs. The index recovery API reports information about completed recoveries only
3534
- for shard copies that currently exist in the cluster. It only reports the last
3535
- recovery for each shard copy and does not report historical information about
3536
- earlier recoveries, nor does it report information about the recoveries of shard
3537
- copies that no longer exist. This means that if a shard copy completes a recovery
3538
- and then Elasticsearch relocates it onto a different node then the information
3539
- about the original recovery will not be shown in the recovery API.
3742
+ for the stream's backing indices. All recoveries, whether ongoing or complete,
3743
+ are kept in the cluster state and may be reported on at any time. Shard recovery
3744
+ is the process of initializing a shard copy, such as restoring a primary shard
3745
+ from a snapshot or creating a replica shard from a primary shard. When a shard
3746
+ recovery completes, the recovered shard is available for search and indexing.
3747
+ Recovery automatically occurs during the following processes: * When creating
3748
+ an index for the first time. * When a node rejoins the cluster and starts up
3749
+ any missing primary shard copies using the data that it holds in its data path.
3750
+ * Creation of new replica shard copies from the primary. * Relocation of a shard
3751
+ copy to a different node in the same cluster. * A snapshot restore operation.
3752
+ * A clone, shrink, or split operation. You can determine the cause of a shard
3753
+ recovery using the recovery or cat recovery APIs. The index recovery API reports
3754
+ information about completed recoveries only for shard copies that currently exist
3755
+ in the cluster. It only reports the last recovery for each shard copy and does
3756
+ not report historical information about earlier recoveries, nor does it report
3757
+ information about the recoveries of shard copies that no longer exist. This means
3758
+ that if a shard copy completes a recovery and then Elasticsearch relocates it
3759
+ onto a different node then the information about the original recovery will not
3760
+ be shown in the recovery API.
3540
3761
 
3541
3762
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-recovery.html>`_
3542
3763
 
@@ -3600,7 +3821,17 @@ class IndicesClient(NamespacedClient):
3600
3821
  """
3601
3822
  Refresh an index. A refresh makes recent operations performed on one or more
3602
3823
  indices available for search. For data streams, the API runs the refresh operation
3603
- on the stream’s backing indices.
3824
+ on the stream’s backing indices. By default, Elasticsearch periodically refreshes
3825
+ indices every second, but only on indices that have received one search request
3826
+ or more in the last 30 seconds. You can change this default interval with the
3827
+ `index.refresh_interval` setting. Refresh requests are synchronous and do not
3828
+ return a response until the refresh operation completes. Refreshes are resource-intensive.
3829
+ To ensure good cluster performance, it's recommended to wait for Elasticsearch's
3830
+ periodic refresh rather than performing an explicit refresh when possible. If
3831
+ your application workflow indexes documents and then runs a search to retrieve
3832
+ the indexed document, it's recommended to use the index API's `refresh=wait_for`
3833
+ query parameter option. This option ensures the indexing operation waits for
3834
+ a periodic refresh before running the search.
3604
3835
 
3605
3836
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-refresh.html>`_
3606
3837
 
@@ -3762,6 +3993,24 @@ class IndicesClient(NamespacedClient):
3762
3993
  search is likely to have errors returned when you do the cross-cluster search
3763
3994
  (including any authorization errors if you do not have permission to query the
3764
3995
  index). * Cluster version information, including the Elasticsearch server version.
3996
+ For example, `GET /_resolve/cluster/my-index-*,cluster*:my-index-*` returns information
3997
+ about the local cluster and all remotely configured clusters that start with
3998
+ the alias `cluster*`. Each cluster returns information about whether it has any
3999
+ indices, aliases or data streams that match `my-index-*`. **Advantages of using
4000
+ this endpoint before a cross-cluster search** You may want to exclude a cluster
4001
+ or index from a search when: * A remote cluster is not currently connected and
4002
+ is configured with `skip_unavailable=false`. Running a cross-cluster search under
4003
+ those conditions will cause the entire search to fail. * A cluster has no matching
4004
+ indices, aliases or data streams for the index expression (or your user does
4005
+ not have permissions to search them). For example, suppose your index expression
4006
+ is `logs*,remote1:logs*` and the remote1 cluster has no indices, aliases or data
4007
+ streams that match `logs*`. In that case, that cluster will return no results
4008
+ from that cluster if you include it in a cross-cluster search. * The index expression
4009
+ (combined with any query parameters you specify) will likely cause an exception
4010
+ to be thrown when you do the search. In these cases, the "error" field in the
4011
+ `_resolve/cluster` response will be present. (This is also where security/permission
4012
+ errors will be shown.) * A remote cluster is an older version that does not support
4013
+ the feature you want to use in your search.
3765
4014
 
3766
4015
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-resolve-cluster-api.html>`_
3767
4016
 
@@ -3908,7 +4157,33 @@ class IndicesClient(NamespacedClient):
3908
4157
  body: t.Optional[t.Dict[str, t.Any]] = None,
3909
4158
  ) -> ObjectApiResponse[t.Any]:
3910
4159
  """
3911
- Roll over to a new index. Creates a new index for a data stream or index alias.
4160
+ Roll over to a new index. TIP: It is recommended to use the index lifecycle rollover
4161
+ action to automate rollovers. The rollover API creates a new index for a data
4162
+ stream or index alias. The API behavior depends on the rollover target. **Roll
4163
+ over a data stream** If you roll over a data stream, the API creates a new write
4164
+ index for the stream. The stream's previous write index becomes a regular backing
4165
+ index. A rollover also increments the data stream's generation. **Roll over an
4166
+ index alias with a write index** TIP: Prior to Elasticsearch 7.9, you'd typically
4167
+ use an index alias with a write index to manage time series data. Data streams
4168
+ replace this functionality, require less maintenance, and automatically integrate
4169
+ with data tiers. If an index alias points to multiple indices, one of the indices
4170
+ must be a write index. The rollover API creates a new write index for the alias
4171
+ with `is_write_index` set to `true`. The API also `sets is_write_index` to `false`
4172
+ for the previous write index. **Roll over an index alias with one index** If
4173
+ you roll over an index alias that points to only one index, the API creates a
4174
+ new index for the alias and removes the original index from the alias. NOTE:
4175
+ A rollover creates a new index and is subject to the `wait_for_active_shards`
4176
+ setting. **Increment index names for an alias** When you roll over an index alias,
4177
+ you can specify a name for the new index. If you don't specify a name and the
4178
+ current index ends with `-` and a number, such as `my-index-000001` or `my-index-3`,
4179
+ the new index name increments that number. For example, if you roll over an alias
4180
+ with a current index of `my-index-000001`, the rollover creates a new index named
4181
+ `my-index-000002`. This number is always six characters and zero-padded, regardless
4182
+ of the previous index's name. If you use an index alias for time series data,
4183
+ you can use date math in the index name to track the rollover date. For example,
4184
+ you can create an alias that points to an index named `<my-index-{now/d}-000001>`.
4185
+ If you create the index on May 6, 2099, the index's name is `my-index-2099.05.06-000001`.
4186
+ If you roll over the alias on May 7, 2099, the new index's name is `my-index-2099.05.07-000002`.
3912
4187
 
3913
4188
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-rollover-index.html>`_
3914
4189
 
@@ -4279,8 +4554,8 @@ class IndicesClient(NamespacedClient):
4279
4554
  pretty: t.Optional[bool] = None,
4280
4555
  ) -> ObjectApiResponse[t.Any]:
4281
4556
  """
4282
- Simulate an index. Returns the index configuration that would be applied to the
4283
- specified index from an existing index template.
4557
+ Simulate an index. Get the index configuration that would be applied to the specified
4558
+ index from an existing index template.
4284
4559
 
4285
4560
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-simulate-index.html>`_
4286
4561
 
@@ -4357,7 +4632,7 @@ class IndicesClient(NamespacedClient):
4357
4632
  body: t.Optional[t.Dict[str, t.Any]] = None,
4358
4633
  ) -> ObjectApiResponse[t.Any]:
4359
4634
  """
4360
- Simulate an index template. Returns the index configuration that would be applied
4635
+ Simulate an index template. Get the index configuration that would be applied
4361
4636
  by a particular index template.
4362
4637
 
4363
4638
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-simulate-template.html>`_
@@ -4491,25 +4766,29 @@ class IndicesClient(NamespacedClient):
4491
4766
  """
4492
4767
  Split an index. Split an index into a new index with more primary shards. * Before
4493
4768
  you can split an index: * The index must be read-only. * The cluster health status
4494
- must be green. The number of times the index can be split (and the number of
4495
- shards that each original shard can be split into) is determined by the `index.number_of_routing_shards`
4496
- setting. The number of routing shards specifies the hashing space that is used
4497
- internally to distribute documents across shards with consistent hashing. For
4498
- instance, a 5 shard index with `number_of_routing_shards` set to 30 (5 x 2 x
4499
- 3) could be split by a factor of 2 or 3. A split operation: * Creates a new target
4500
- index with the same definition as the source index, but with a larger number
4501
- of primary shards. * Hard-links segments from the source index into the target
4502
- index. If the file system doesn't support hard-linking, all segments are copied
4503
- into the new index, which is a much more time consuming process. * Hashes all
4504
- documents again, after low level files are created, to delete documents that
4505
- belong to a different shard. * Recovers the target index as though it were a
4506
- closed index which had just been re-opened. IMPORTANT: Indices can only be split
4507
- if they satisfy the following requirements: * The target index must not exist.
4508
- * The source index must have fewer primary shards than the target index. * The
4509
- number of primary shards in the target index must be a multiple of the number
4510
- of primary shards in the source index. * The node handling the split process
4511
- must have sufficient free disk space to accommodate a second copy of the existing
4512
- index.
4769
+ must be green. You can do make an index read-only with the following request
4770
+ using the add index block API: ``` PUT /my_source_index/_block/write ``` The
4771
+ current write index on a data stream cannot be split. In order to split the current
4772
+ write index, the data stream must first be rolled over so that a new write index
4773
+ is created and then the previous write index can be split. The number of times
4774
+ the index can be split (and the number of shards that each original shard can
4775
+ be split into) is determined by the `index.number_of_routing_shards` setting.
4776
+ The number of routing shards specifies the hashing space that is used internally
4777
+ to distribute documents across shards with consistent hashing. For instance,
4778
+ a 5 shard index with `number_of_routing_shards` set to 30 (5 x 2 x 3) could be
4779
+ split by a factor of 2 or 3. A split operation: * Creates a new target index
4780
+ with the same definition as the source index, but with a larger number of primary
4781
+ shards. * Hard-links segments from the source index into the target index. If
4782
+ the file system doesn't support hard-linking, all segments are copied into the
4783
+ new index, which is a much more time consuming process. * Hashes all documents
4784
+ again, after low level files are created, to delete documents that belong to
4785
+ a different shard. * Recovers the target index as though it were a closed index
4786
+ which had just been re-opened. IMPORTANT: Indices can only be split if they satisfy
4787
+ the following requirements: * The target index must not exist. * The source index
4788
+ must have fewer primary shards than the target index. * The number of primary
4789
+ shards in the target index must be a multiple of the number of primary shards
4790
+ in the source index. * The node handling the split process must have sufficient
4791
+ free disk space to accommodate a second copy of the existing index.
4513
4792
 
4514
4793
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-split-index.html>`_
4515
4794