elasticsearch 8.15.1__py3-none-any.whl → 8.16.0__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 (94) hide show
  1. elasticsearch/_async/client/__init__.py +198 -117
  2. elasticsearch/_async/client/async_search.py +25 -25
  3. elasticsearch/_async/client/autoscaling.py +24 -11
  4. elasticsearch/_async/client/cat.py +75 -66
  5. elasticsearch/_async/client/ccr.py +13 -13
  6. elasticsearch/_async/client/cluster.py +40 -37
  7. elasticsearch/_async/client/connector.py +112 -51
  8. elasticsearch/_async/client/dangling_indices.py +27 -12
  9. elasticsearch/_async/client/enrich.py +10 -10
  10. elasticsearch/_async/client/eql.py +4 -4
  11. elasticsearch/_async/client/esql.py +42 -4
  12. elasticsearch/_async/client/features.py +4 -3
  13. elasticsearch/_async/client/fleet.py +10 -2
  14. elasticsearch/_async/client/graph.py +1 -1
  15. elasticsearch/_async/client/ilm.py +16 -12
  16. elasticsearch/_async/client/indices.py +176 -108
  17. elasticsearch/_async/client/inference.py +15 -5
  18. elasticsearch/_async/client/ingest.py +28 -12
  19. elasticsearch/_async/client/license.py +10 -10
  20. elasticsearch/_async/client/logstash.py +3 -3
  21. elasticsearch/_async/client/migration.py +3 -3
  22. elasticsearch/_async/client/ml.py +294 -291
  23. elasticsearch/_async/client/monitoring.py +1 -1
  24. elasticsearch/_async/client/nodes.py +16 -8
  25. elasticsearch/_async/client/query_rules.py +61 -8
  26. elasticsearch/_async/client/rollup.py +23 -9
  27. elasticsearch/_async/client/search_application.py +35 -16
  28. elasticsearch/_async/client/searchable_snapshots.py +13 -5
  29. elasticsearch/_async/client/security.py +371 -180
  30. elasticsearch/_async/client/slm.py +9 -9
  31. elasticsearch/_async/client/snapshot.py +97 -12
  32. elasticsearch/_async/client/sql.py +11 -7
  33. elasticsearch/_async/client/ssl.py +18 -3
  34. elasticsearch/_async/client/synonyms.py +7 -7
  35. elasticsearch/_async/client/tasks.py +19 -9
  36. elasticsearch/_async/client/text_structure.py +2 -2
  37. elasticsearch/_async/client/transform.py +78 -72
  38. elasticsearch/_async/client/utils.py +4 -0
  39. elasticsearch/_async/client/watcher.py +11 -11
  40. elasticsearch/_async/client/xpack.py +5 -3
  41. elasticsearch/_async/helpers.py +19 -10
  42. elasticsearch/_otel.py +2 -2
  43. elasticsearch/_sync/client/__init__.py +198 -117
  44. elasticsearch/_sync/client/async_search.py +25 -25
  45. elasticsearch/_sync/client/autoscaling.py +24 -11
  46. elasticsearch/_sync/client/cat.py +75 -66
  47. elasticsearch/_sync/client/ccr.py +13 -13
  48. elasticsearch/_sync/client/cluster.py +40 -37
  49. elasticsearch/_sync/client/connector.py +112 -51
  50. elasticsearch/_sync/client/dangling_indices.py +27 -12
  51. elasticsearch/_sync/client/enrich.py +10 -10
  52. elasticsearch/_sync/client/eql.py +4 -4
  53. elasticsearch/_sync/client/esql.py +42 -4
  54. elasticsearch/_sync/client/features.py +4 -3
  55. elasticsearch/_sync/client/fleet.py +10 -2
  56. elasticsearch/_sync/client/graph.py +1 -1
  57. elasticsearch/_sync/client/ilm.py +16 -12
  58. elasticsearch/_sync/client/indices.py +176 -108
  59. elasticsearch/_sync/client/inference.py +15 -5
  60. elasticsearch/_sync/client/ingest.py +28 -12
  61. elasticsearch/_sync/client/license.py +10 -10
  62. elasticsearch/_sync/client/logstash.py +3 -3
  63. elasticsearch/_sync/client/migration.py +3 -3
  64. elasticsearch/_sync/client/ml.py +294 -291
  65. elasticsearch/_sync/client/monitoring.py +1 -1
  66. elasticsearch/_sync/client/nodes.py +16 -8
  67. elasticsearch/_sync/client/query_rules.py +61 -8
  68. elasticsearch/_sync/client/rollup.py +23 -9
  69. elasticsearch/_sync/client/search_application.py +35 -16
  70. elasticsearch/_sync/client/searchable_snapshots.py +13 -5
  71. elasticsearch/_sync/client/security.py +371 -180
  72. elasticsearch/_sync/client/slm.py +9 -9
  73. elasticsearch/_sync/client/snapshot.py +97 -12
  74. elasticsearch/_sync/client/sql.py +11 -7
  75. elasticsearch/_sync/client/ssl.py +18 -3
  76. elasticsearch/_sync/client/synonyms.py +7 -7
  77. elasticsearch/_sync/client/tasks.py +19 -9
  78. elasticsearch/_sync/client/text_structure.py +2 -2
  79. elasticsearch/_sync/client/transform.py +78 -72
  80. elasticsearch/_sync/client/utils.py +40 -0
  81. elasticsearch/_sync/client/watcher.py +11 -11
  82. elasticsearch/_sync/client/xpack.py +5 -3
  83. elasticsearch/_version.py +1 -1
  84. elasticsearch/exceptions.py +4 -0
  85. elasticsearch/helpers/actions.py +19 -10
  86. elasticsearch/helpers/errors.py +12 -4
  87. elasticsearch/helpers/vectorstore/_async/strategies.py +30 -9
  88. elasticsearch/helpers/vectorstore/_sync/strategies.py +30 -9
  89. {elasticsearch-8.15.1.dist-info → elasticsearch-8.16.0.dist-info}/METADATA +5 -6
  90. elasticsearch-8.16.0.dist-info/RECORD +117 -0
  91. {elasticsearch-8.15.1.dist-info → elasticsearch-8.16.0.dist-info}/WHEEL +1 -1
  92. elasticsearch-8.15.1.dist-info/RECORD +0 -117
  93. {elasticsearch-8.15.1.dist-info → elasticsearch-8.16.0.dist-info}/licenses/LICENSE +0 -0
  94. {elasticsearch-8.15.1.dist-info → elasticsearch-8.16.0.dist-info}/licenses/NOTICE +0 -0
@@ -82,8 +82,10 @@ from .utils import (
82
82
  _TYPE_HOSTS,
83
83
  CLIENT_META_SERVICE,
84
84
  SKIP_IN_PATH,
85
+ Stability,
85
86
  _quote,
86
87
  _rewrite_parameters,
88
+ _stability_warning,
87
89
  client_node_configs,
88
90
  is_requests_http_auth,
89
91
  is_requests_node_class,
@@ -638,10 +640,11 @@ class Elasticsearch(BaseClient):
638
640
  ] = None,
639
641
  ) -> ObjectApiResponse[t.Any]:
640
642
  """
641
- Performs multiple indexing or delete operations in a single API call. This reduces
642
- overhead and can greatly increase indexing speed.
643
+ Bulk index or delete documents. Performs multiple indexing or delete operations
644
+ in a single API call. This reduces overhead and can greatly increase indexing
645
+ speed.
643
646
 
644
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-bulk.html>`_
647
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-bulk.html>`_
645
648
 
646
649
  :param operations:
647
650
  :param index: Name of the data stream, index, or index alias to perform bulk
@@ -738,9 +741,10 @@ class Elasticsearch(BaseClient):
738
741
  body: t.Optional[t.Dict[str, t.Any]] = None,
739
742
  ) -> ObjectApiResponse[t.Any]:
740
743
  """
741
- Clears the search context and results for a scrolling search.
744
+ Clear a scrolling search. Clear the search context and results for a scrolling
745
+ search.
742
746
 
743
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/clear-scroll-api.html>`_
747
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/clear-scroll-api.html>`_
744
748
 
745
749
  :param scroll_id: Scroll IDs to clear. To clear all scroll IDs, use `_all`.
746
750
  """
@@ -788,9 +792,13 @@ class Elasticsearch(BaseClient):
788
792
  body: t.Optional[t.Dict[str, t.Any]] = None,
789
793
  ) -> ObjectApiResponse[t.Any]:
790
794
  """
791
- Closes a point-in-time.
795
+ Close a point in time. A point in time must be opened explicitly before being
796
+ used in search requests. The `keep_alive` parameter tells Elasticsearch how long
797
+ it should persist. A point in time is automatically closed when the `keep_alive`
798
+ period has elapsed. However, keeping points in time has a cost; close them as
799
+ soon as they are no longer required for search requests.
792
800
 
793
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/point-in-time-api.html>`_
801
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/point-in-time-api.html>`_
794
802
 
795
803
  :param id: The ID of the point-in-time.
796
804
  """
@@ -864,7 +872,7 @@ class Elasticsearch(BaseClient):
864
872
  """
865
873
  Returns number of documents matching a query.
866
874
 
867
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-count.html>`_
875
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-count.html>`_
868
876
 
869
877
  :param index: Comma-separated list of data streams, indices, and aliases to search.
870
878
  Supports wildcards (`*`). To search all data streams and indices, omit this
@@ -995,11 +1003,11 @@ class Elasticsearch(BaseClient):
995
1003
  ] = None,
996
1004
  ) -> ObjectApiResponse[t.Any]:
997
1005
  """
998
- Adds a JSON document to the specified data stream or index and makes it searchable.
999
- If the target is an index and the document already exists, the request updates
1000
- the document and increments its version.
1006
+ Index a document. Adds a JSON document to the specified data stream or index
1007
+ and makes it searchable. If the target is an index and the document already exists,
1008
+ the request updates the document and increments its version.
1001
1009
 
1002
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-index_.html>`_
1010
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-index_.html>`_
1003
1011
 
1004
1012
  :param index: Name of the data stream or index to target. If the target doesn’t
1005
1013
  exist and matches the name or wildcard (`*`) pattern of an index template
@@ -1101,9 +1109,9 @@ class Elasticsearch(BaseClient):
1101
1109
  ] = None,
1102
1110
  ) -> ObjectApiResponse[t.Any]:
1103
1111
  """
1104
- Removes a JSON document from the specified index.
1112
+ Delete a document. Removes a JSON document from the specified index.
1105
1113
 
1106
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-delete.html>`_
1114
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-delete.html>`_
1107
1115
 
1108
1116
  :param index: Name of the target index.
1109
1117
  :param id: Unique identifier for the document.
@@ -1223,9 +1231,9 @@ class Elasticsearch(BaseClient):
1223
1231
  body: t.Optional[t.Dict[str, t.Any]] = None,
1224
1232
  ) -> ObjectApiResponse[t.Any]:
1225
1233
  """
1226
- Deletes documents that match the specified query.
1234
+ Delete documents. Deletes documents that match the specified query.
1227
1235
 
1228
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-delete-by-query.html>`_
1236
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-delete-by-query.html>`_
1229
1237
 
1230
1238
  :param index: Comma-separated list of data streams, indices, and aliases to search.
1231
1239
  Supports wildcards (`*`). To search all data streams or indices, omit this
@@ -1401,9 +1409,12 @@ class Elasticsearch(BaseClient):
1401
1409
  requests_per_second: t.Optional[float] = None,
1402
1410
  ) -> ObjectApiResponse[t.Any]:
1403
1411
  """
1404
- Changes the number of requests per second for a particular Delete By Query operation.
1412
+ Throttle a delete by query operation. Change the number of requests per second
1413
+ for a particular delete by query operation. Rethrottling that speeds up the query
1414
+ takes effect immediately but rethrotting that slows down the query takes effect
1415
+ after completing the current batch to prevent scroll timeouts.
1405
1416
 
1406
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-delete-by-query.html>`_
1417
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-delete-by-query.html>`_
1407
1418
 
1408
1419
  :param task_id: The ID for the task.
1409
1420
  :param requests_per_second: The throttle for this request in sub-requests per
@@ -1447,9 +1458,9 @@ class Elasticsearch(BaseClient):
1447
1458
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1448
1459
  ) -> ObjectApiResponse[t.Any]:
1449
1460
  """
1450
- Deletes a stored script or search template.
1461
+ Delete a script or search template. Deletes a stored script or search template.
1451
1462
 
1452
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/modules-scripting.html>`_
1463
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/modules-scripting.html>`_
1453
1464
 
1454
1465
  :param id: Identifier for the stored script or search template.
1455
1466
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -1515,9 +1526,9 @@ class Elasticsearch(BaseClient):
1515
1526
  ] = None,
1516
1527
  ) -> HeadApiResponse:
1517
1528
  """
1518
- Checks if a document in an index exists.
1529
+ Check a document. Checks if a specified document exists.
1519
1530
 
1520
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-get.html>`_
1531
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-get.html>`_
1521
1532
 
1522
1533
  :param index: Comma-separated list of data streams, indices, and aliases. Supports
1523
1534
  wildcards (`*`).
@@ -1616,9 +1627,9 @@ class Elasticsearch(BaseClient):
1616
1627
  ] = None,
1617
1628
  ) -> HeadApiResponse:
1618
1629
  """
1619
- Checks if a document's `_source` is stored.
1630
+ Check for a document source. Checks if a document's `_source` is stored.
1620
1631
 
1621
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-get.html>`_
1632
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-get.html>`_
1622
1633
 
1623
1634
  :param index: Comma-separated list of data streams, indices, and aliases. Supports
1624
1635
  wildcards (`*`).
@@ -1716,10 +1727,10 @@ class Elasticsearch(BaseClient):
1716
1727
  body: t.Optional[t.Dict[str, t.Any]] = None,
1717
1728
  ) -> ObjectApiResponse[t.Any]:
1718
1729
  """
1719
- Returns information about why a specific document matches (or doesn’t match)
1720
- a query.
1730
+ Explain a document match result. Returns information about why a specific document
1731
+ matches, or doesn’t match, a query.
1721
1732
 
1722
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-explain.html>`_
1733
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-explain.html>`_
1723
1734
 
1724
1735
  :param index: Index names used to limit the request. Only a single index name
1725
1736
  can be provided to this parameter.
@@ -1836,12 +1847,13 @@ class Elasticsearch(BaseClient):
1836
1847
  body: t.Optional[t.Dict[str, t.Any]] = None,
1837
1848
  ) -> ObjectApiResponse[t.Any]:
1838
1849
  """
1839
- The field capabilities API returns the information about the capabilities of
1840
- fields among multiple indices. The field capabilities API returns runtime fields
1841
- like any other field. For example, a runtime field with a type of keyword is
1842
- returned as any other field that belongs to the `keyword` family.
1850
+ Get the field capabilities. Get information about the capabilities of fields
1851
+ among multiple indices. For data streams, the API returns field capabilities
1852
+ among the stream’s backing indices. It returns runtime fields like any other
1853
+ field. For example, a runtime field with a type of keyword is returned the same
1854
+ as any other field that belongs to the `keyword` family.
1843
1855
 
1844
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-field-caps.html>`_
1856
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-field-caps.html>`_
1845
1857
 
1846
1858
  :param index: Comma-separated list of data streams, indices, and aliases used
1847
1859
  to limit the request. Supports wildcards (*). To target all data streams
@@ -1955,9 +1967,10 @@ class Elasticsearch(BaseClient):
1955
1967
  ] = None,
1956
1968
  ) -> ObjectApiResponse[t.Any]:
1957
1969
  """
1958
- Returns a document.
1970
+ Get a document by its ID. Retrieves the document with the specified ID from an
1971
+ index.
1959
1972
 
1960
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-get.html>`_
1973
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-get.html>`_
1961
1974
 
1962
1975
  :param index: Name of the index that contains the document.
1963
1976
  :param id: Unique identifier of the document.
@@ -2044,9 +2057,9 @@ class Elasticsearch(BaseClient):
2044
2057
  pretty: t.Optional[bool] = None,
2045
2058
  ) -> ObjectApiResponse[t.Any]:
2046
2059
  """
2047
- Retrieves a stored script or search template.
2060
+ Get a script or search template. Retrieves a stored script or search template.
2048
2061
 
2049
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/modules-scripting.html>`_
2062
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/modules-scripting.html>`_
2050
2063
 
2051
2064
  :param id: Identifier for the stored script or search template.
2052
2065
  :param master_timeout: Specify timeout for connection to master
@@ -2086,9 +2099,9 @@ class Elasticsearch(BaseClient):
2086
2099
  pretty: t.Optional[bool] = None,
2087
2100
  ) -> ObjectApiResponse[t.Any]:
2088
2101
  """
2089
- Returns all script contexts.
2102
+ Get script contexts. Get a list of supported script contexts and their methods.
2090
2103
 
2091
- `<https://www.elastic.co/guide/en/elasticsearch/painless/8.15/painless-contexts.html>`_
2104
+ `<https://www.elastic.co/guide/en/elasticsearch/painless/8.16/painless-contexts.html>`_
2092
2105
  """
2093
2106
  __path_parts: t.Dict[str, str] = {}
2094
2107
  __path = "/_script_context"
@@ -2121,9 +2134,9 @@ class Elasticsearch(BaseClient):
2121
2134
  pretty: t.Optional[bool] = None,
2122
2135
  ) -> ObjectApiResponse[t.Any]:
2123
2136
  """
2124
- Returns available script types, languages and contexts
2137
+ Get script languages. Get a list of available script types, languages, and contexts.
2125
2138
 
2126
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/modules-scripting.html>`_
2139
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/modules-scripting.html>`_
2127
2140
  """
2128
2141
  __path_parts: t.Dict[str, str] = {}
2129
2142
  __path = "/_script_language"
@@ -2176,9 +2189,9 @@ class Elasticsearch(BaseClient):
2176
2189
  ] = None,
2177
2190
  ) -> ObjectApiResponse[t.Any]:
2178
2191
  """
2179
- Returns the source of a document.
2192
+ Get a document's source. Returns the source of a document.
2180
2193
 
2181
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-get.html>`_
2194
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-get.html>`_
2182
2195
 
2183
2196
  :param index: Name of the index that contains the document.
2184
2197
  :param id: Unique identifier of the document.
@@ -2261,7 +2274,7 @@ class Elasticsearch(BaseClient):
2261
2274
  """
2262
2275
  Returns the health of the cluster.
2263
2276
 
2264
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/health-api.html>`_
2277
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/health-api.html>`_
2265
2278
 
2266
2279
  :param feature: A feature of the cluster, as returned by the top-level health
2267
2280
  report API.
@@ -2334,11 +2347,11 @@ class Elasticsearch(BaseClient):
2334
2347
  ] = None,
2335
2348
  ) -> ObjectApiResponse[t.Any]:
2336
2349
  """
2337
- Adds a JSON document to the specified data stream or index and makes it searchable.
2338
- If the target is an index and the document already exists, the request updates
2339
- the document and increments its version.
2350
+ Index a document. Adds a JSON document to the specified data stream or index
2351
+ and makes it searchable. If the target is an index and the document already exists,
2352
+ the request updates the document and increments its version.
2340
2353
 
2341
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-index_.html>`_
2354
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-index_.html>`_
2342
2355
 
2343
2356
  :param index: Name of the data stream or index to target.
2344
2357
  :param document:
@@ -2445,9 +2458,9 @@ class Elasticsearch(BaseClient):
2445
2458
  pretty: t.Optional[bool] = None,
2446
2459
  ) -> ObjectApiResponse[t.Any]:
2447
2460
  """
2448
- Returns basic information about the cluster.
2461
+ Get cluster info. Returns basic information about the cluster.
2449
2462
 
2450
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/index.html>`_
2463
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/index.html>`_
2451
2464
  """
2452
2465
  __path_parts: t.Dict[str, str] = {}
2453
2466
  __path = "/"
@@ -2481,6 +2494,7 @@ class Elasticsearch(BaseClient):
2481
2494
  ),
2482
2495
  parameter_aliases={"_source": "source"},
2483
2496
  )
2497
+ @_stability_warning(Stability.EXPERIMENTAL)
2484
2498
  def knn_search(
2485
2499
  self,
2486
2500
  *,
@@ -2501,9 +2515,17 @@ class Elasticsearch(BaseClient):
2501
2515
  body: t.Optional[t.Dict[str, t.Any]] = None,
2502
2516
  ) -> ObjectApiResponse[t.Any]:
2503
2517
  """
2504
- Performs a kNN search.
2505
-
2506
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-search.html>`_
2518
+ Run a knn search. NOTE: The kNN search API has been replaced by the `knn` option
2519
+ in the search API. Perform a k-nearest neighbor (kNN) search on a dense_vector
2520
+ field and return the matching documents. Given a query vector, the API finds
2521
+ the k closest vectors and returns those documents as search hits. Elasticsearch
2522
+ uses the HNSW algorithm to support efficient kNN search. Like most kNN algorithms,
2523
+ HNSW is an approximate method that sacrifices result accuracy for improved search
2524
+ speed. This means the results returned are not always the true k closest neighbors.
2525
+ The kNN search API supports restricting the search using a filter. The search
2526
+ will return the top k documents that also match the filter query.
2527
+
2528
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-search.html>`_
2507
2529
 
2508
2530
  :param index: A comma-separated list of index names to search; use `_all` or
2509
2531
  to perform the operation on all indices
@@ -2602,9 +2624,12 @@ class Elasticsearch(BaseClient):
2602
2624
  body: t.Optional[t.Dict[str, t.Any]] = None,
2603
2625
  ) -> ObjectApiResponse[t.Any]:
2604
2626
  """
2605
- Allows to get multiple documents in one request.
2627
+ Get multiple documents. Get multiple JSON documents by ID from one or more indices.
2628
+ If you specify an index in the request URI, you only need to specify the document
2629
+ IDs in the request body. To ensure fast responses, this multi get (mget) API
2630
+ responds with partial results if one or more shards fail.
2606
2631
 
2607
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-multi-get.html>`_
2632
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-multi-get.html>`_
2608
2633
 
2609
2634
  :param index: Name of the index to retrieve documents from when `ids` are specified,
2610
2635
  or when a document in the `docs` array does not specify an index.
@@ -2723,9 +2748,15 @@ class Elasticsearch(BaseClient):
2723
2748
  typed_keys: t.Optional[bool] = None,
2724
2749
  ) -> ObjectApiResponse[t.Any]:
2725
2750
  """
2726
- Allows to execute several search operations in one request.
2751
+ Run multiple searches. The format of the request is similar to the bulk API format
2752
+ and makes use of the newline delimited JSON (NDJSON) format. The structure is
2753
+ as follows: ``` header\\n body\\n header\\n body\\n ``` This structure is specifically
2754
+ optimized to reduce parsing if a specific search ends up redirected to another
2755
+ node. IMPORTANT: The final line of data must end with a newline character `\\n`.
2756
+ Each newline character may be preceded by a carriage return `\\r`. When sending
2757
+ requests to this endpoint the `Content-Type` header should be set to `application/x-ndjson`.
2727
2758
 
2728
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-multi-search.html>`_
2759
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-multi-search.html>`_
2729
2760
 
2730
2761
  :param searches:
2731
2762
  :param index: Comma-separated list of data streams, indices, and index aliases
@@ -2855,9 +2886,9 @@ class Elasticsearch(BaseClient):
2855
2886
  typed_keys: t.Optional[bool] = None,
2856
2887
  ) -> ObjectApiResponse[t.Any]:
2857
2888
  """
2858
- Runs multiple templated searches with a single request.
2889
+ Run multiple templated searches.
2859
2890
 
2860
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-multi-search.html>`_
2891
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-multi-search.html>`_
2861
2892
 
2862
2893
  :param search_templates:
2863
2894
  :param index: Comma-separated list of data streams, indices, and aliases to search.
@@ -2950,9 +2981,13 @@ class Elasticsearch(BaseClient):
2950
2981
  body: t.Optional[t.Dict[str, t.Any]] = None,
2951
2982
  ) -> ObjectApiResponse[t.Any]:
2952
2983
  """
2953
- Returns multiple termvectors in one request.
2984
+ Get multiple term vectors. You can specify existing documents by index and ID
2985
+ or provide artificial documents in the body of the request. You can specify the
2986
+ index in the request body or request URI. The response contains a `docs` array
2987
+ with all the fetched termvectors. Each element has the structure provided by
2988
+ the termvectors API.
2954
2989
 
2955
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-multi-termvectors.html>`_
2990
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-multi-termvectors.html>`_
2956
2991
 
2957
2992
  :param index: Name of the index that contains the documents.
2958
2993
  :param docs: Array of existing or artificial documents.
@@ -3034,7 +3069,9 @@ class Elasticsearch(BaseClient):
3034
3069
  path_parts=__path_parts,
3035
3070
  )
3036
3071
 
3037
- @_rewrite_parameters()
3072
+ @_rewrite_parameters(
3073
+ body_fields=("index_filter",),
3074
+ )
3038
3075
  def open_point_in_time(
3039
3076
  self,
3040
3077
  *,
@@ -3052,20 +3089,24 @@ class Elasticsearch(BaseClient):
3052
3089
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3053
3090
  human: t.Optional[bool] = None,
3054
3091
  ignore_unavailable: t.Optional[bool] = None,
3092
+ index_filter: t.Optional[t.Mapping[str, t.Any]] = None,
3055
3093
  preference: t.Optional[str] = None,
3056
3094
  pretty: t.Optional[bool] = None,
3057
3095
  routing: t.Optional[str] = None,
3096
+ body: t.Optional[t.Dict[str, t.Any]] = None,
3058
3097
  ) -> ObjectApiResponse[t.Any]:
3059
3098
  """
3060
- A search request by default executes against the most recent visible data of
3061
- the target indices, which is called point in time. Elasticsearch pit (point in
3062
- time) is a lightweight view into the state of the data as it existed when initiated.
3063
- In some cases, it’s preferred to perform multiple search requests using the same
3064
- point in time. For example, if refreshes happen between `search_after` requests,
3065
- then the results of those requests might not be consistent as changes happening
3066
- between searches are only visible to the more recent point in time.
3067
-
3068
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/point-in-time-api.html>`_
3099
+ Open a point in time. A search request by default runs against the most recent
3100
+ visible data of the target indices, which is called point in time. Elasticsearch
3101
+ pit (point in time) is a lightweight view into the state of the data as it existed
3102
+ when initiated. In some cases, it’s preferred to perform multiple search requests
3103
+ using the same point in time. For example, if refreshes happen between `search_after`
3104
+ requests, then the results of those requests might not be consistent as changes
3105
+ happening between searches are only visible to the more recent point in time.
3106
+ A point in time must be opened explicitly before being used in search requests.
3107
+ The `keep_alive` parameter tells Elasticsearch how long it should persist.
3108
+
3109
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/point-in-time-api.html>`_
3069
3110
 
3070
3111
  :param index: A comma-separated list of index names to open point in time; use
3071
3112
  `_all` or empty string to perform the operation on all indices
@@ -3076,17 +3117,20 @@ class Elasticsearch(BaseClient):
3076
3117
  as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
3077
3118
  :param ignore_unavailable: If `false`, the request returns an error if it targets
3078
3119
  a missing or closed index.
3120
+ :param index_filter: Allows to filter indices if the provided query rewrites
3121
+ to `match_none` on every shard.
3079
3122
  :param preference: Specifies the node or shard the operation should be performed
3080
3123
  on. Random by default.
3081
3124
  :param routing: Custom value used to route operations to a specific shard.
3082
3125
  """
3083
3126
  if index in SKIP_IN_PATH:
3084
3127
  raise ValueError("Empty value passed for parameter 'index'")
3085
- if keep_alive is None:
3128
+ if keep_alive is None and body is None:
3086
3129
  raise ValueError("Empty value passed for parameter 'keep_alive'")
3087
3130
  __path_parts: t.Dict[str, str] = {"index": _quote(index)}
3088
3131
  __path = f'/{__path_parts["index"]}/_pit'
3089
3132
  __query: t.Dict[str, t.Any] = {}
3133
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
3090
3134
  if keep_alive is not None:
3091
3135
  __query["keep_alive"] = keep_alive
3092
3136
  if error_trace is not None:
@@ -3105,12 +3149,20 @@ class Elasticsearch(BaseClient):
3105
3149
  __query["pretty"] = pretty
3106
3150
  if routing is not None:
3107
3151
  __query["routing"] = routing
3152
+ if not __body:
3153
+ if index_filter is not None:
3154
+ __body["index_filter"] = index_filter
3155
+ if not __body:
3156
+ __body = None # type: ignore[assignment]
3108
3157
  __headers = {"accept": "application/json"}
3158
+ if __body is not None:
3159
+ __headers["content-type"] = "application/json"
3109
3160
  return self.perform_request( # type: ignore[return-value]
3110
3161
  "POST",
3111
3162
  __path,
3112
3163
  params=__query,
3113
3164
  headers=__headers,
3165
+ body=__body,
3114
3166
  endpoint_id="open_point_in_time",
3115
3167
  path_parts=__path_parts,
3116
3168
  )
@@ -3133,9 +3185,10 @@ class Elasticsearch(BaseClient):
3133
3185
  body: t.Optional[t.Dict[str, t.Any]] = None,
3134
3186
  ) -> ObjectApiResponse[t.Any]:
3135
3187
  """
3136
- Creates or updates a stored script or search template.
3188
+ Create or update a script or search template. Creates or updates a stored script
3189
+ or search template.
3137
3190
 
3138
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/modules-scripting.html>`_
3191
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/modules-scripting.html>`_
3139
3192
 
3140
3193
  :param id: Identifier for the stored script or search template. Must be unique
3141
3194
  within the cluster.
@@ -3218,10 +3271,10 @@ class Elasticsearch(BaseClient):
3218
3271
  body: t.Optional[t.Dict[str, t.Any]] = None,
3219
3272
  ) -> ObjectApiResponse[t.Any]:
3220
3273
  """
3221
- Enables you to evaluate the quality of ranked search results over a set of typical
3222
- search queries.
3274
+ Evaluate ranked search results. Evaluate the quality of ranked search results
3275
+ over a set of typical search queries.
3223
3276
 
3224
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-rank-eval.html>`_
3277
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-rank-eval.html>`_
3225
3278
 
3226
3279
  :param requests: A set of typical search requests, together with their provided
3227
3280
  ratings.
@@ -3313,11 +3366,11 @@ class Elasticsearch(BaseClient):
3313
3366
  body: t.Optional[t.Dict[str, t.Any]] = None,
3314
3367
  ) -> ObjectApiResponse[t.Any]:
3315
3368
  """
3316
- Allows to copy documents from one index to another, optionally filtering the
3317
- source documents by a query, changing the destination index settings, or fetching
3318
- the documents from a remote cluster.
3369
+ Reindex documents. Copies documents from a source to a destination. The source
3370
+ can be any existing index, alias, or data stream. The destination must differ
3371
+ from the source. For example, you cannot reindex a data stream into itself.
3319
3372
 
3320
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-reindex.html>`_
3373
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-reindex.html>`_
3321
3374
 
3322
3375
  :param dest: The destination you are copying to.
3323
3376
  :param source: The source you are copying from.
@@ -3411,9 +3464,10 @@ class Elasticsearch(BaseClient):
3411
3464
  requests_per_second: t.Optional[float] = None,
3412
3465
  ) -> ObjectApiResponse[t.Any]:
3413
3466
  """
3414
- Copies documents from a source to a destination.
3467
+ Throttle a reindex operation. Change the number of requests per second for a
3468
+ particular reindex operation.
3415
3469
 
3416
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-reindex.html>`_
3470
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-reindex.html>`_
3417
3471
 
3418
3472
  :param task_id: Identifier for the task.
3419
3473
  :param requests_per_second: The throttle for this request in sub-requests per
@@ -3462,9 +3516,9 @@ class Elasticsearch(BaseClient):
3462
3516
  body: t.Optional[t.Dict[str, t.Any]] = None,
3463
3517
  ) -> ObjectApiResponse[t.Any]:
3464
3518
  """
3465
- Renders a search template as a search request body.
3519
+ Render a search template. Render a search template as a search request body.
3466
3520
 
3467
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/render-search-template-api.html>`_
3521
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/render-search-template-api.html>`_
3468
3522
 
3469
3523
  :param id: ID of the search template to render. If no `source` is specified,
3470
3524
  this or the `id` request body parameter is required.
@@ -3517,6 +3571,7 @@ class Elasticsearch(BaseClient):
3517
3571
  @_rewrite_parameters(
3518
3572
  body_fields=("context", "context_setup", "script"),
3519
3573
  )
3574
+ @_stability_warning(Stability.EXPERIMENTAL)
3520
3575
  def scripts_painless_execute(
3521
3576
  self,
3522
3577
  *,
@@ -3530,9 +3585,9 @@ class Elasticsearch(BaseClient):
3530
3585
  body: t.Optional[t.Dict[str, t.Any]] = None,
3531
3586
  ) -> ObjectApiResponse[t.Any]:
3532
3587
  """
3533
- Runs a script and returns a result.
3588
+ Run a script. Runs a script and returns a result.
3534
3589
 
3535
- `<https://www.elastic.co/guide/en/elasticsearch/painless/8.15/painless-execute-api.html>`_
3590
+ `<https://www.elastic.co/guide/en/elasticsearch/painless/8.16/painless-execute-api.html>`_
3536
3591
 
3537
3592
  :param context: The context that the script should run in.
3538
3593
  :param context_setup: Additional parameters for the `context`.
@@ -3588,9 +3643,24 @@ class Elasticsearch(BaseClient):
3588
3643
  body: t.Optional[t.Dict[str, t.Any]] = None,
3589
3644
  ) -> ObjectApiResponse[t.Any]:
3590
3645
  """
3591
- Allows to retrieve a large numbers of results from a single search request.
3592
-
3593
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-request-body.html#request-body-search-scroll>`_
3646
+ Run a scrolling search. IMPORTANT: The scroll API is no longer recommend for
3647
+ deep pagination. If you need to preserve the index state while paging through
3648
+ more than 10,000 hits, use the `search_after` parameter with a point in time
3649
+ (PIT). The scroll API gets large sets of results from a single scrolling search
3650
+ request. To get the necessary scroll ID, submit a search API request that includes
3651
+ an argument for the `scroll` query parameter. The `scroll` parameter indicates
3652
+ how long Elasticsearch should retain the search context for the request. The
3653
+ search response returns a scroll ID in the `_scroll_id` response body parameter.
3654
+ You can then use the scroll ID with the scroll API to retrieve the next batch
3655
+ of results for the request. If the Elasticsearch security features are enabled,
3656
+ the access to the results of a specific scroll ID is restricted to the user or
3657
+ API key that submitted the search. You can also use the scroll API to specify
3658
+ a new scroll parameter that extends or shortens the retention period for the
3659
+ search context. IMPORTANT: Results from a scrolling search reflect the state
3660
+ of the index at the time of the initial search request. Subsequent indexing or
3661
+ document changes only affect later search and scroll requests.
3662
+
3663
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-request-body.html#request-body-search-scroll>`_
3594
3664
 
3595
3665
  :param scroll_id: Scroll ID of the search.
3596
3666
  :param rest_total_hits_as_int: If true, the API response’s hit.total property
@@ -3778,11 +3848,11 @@ class Elasticsearch(BaseClient):
3778
3848
  body: t.Optional[t.Dict[str, t.Any]] = None,
3779
3849
  ) -> ObjectApiResponse[t.Any]:
3780
3850
  """
3781
- Returns search hits that match the query defined in the request. You can provide
3782
- search queries using the `q` query string parameter or the request body. If both
3783
- are specified, only the query parameter is used.
3851
+ Run a search. Get search hits that match the query defined in the request. You
3852
+ can provide search queries using the `q` query string parameter or the request
3853
+ body. If both are specified, only the query parameter is used.
3784
3854
 
3785
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-search.html>`_
3855
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-search.html>`_
3786
3856
 
3787
3857
  :param index: Comma-separated list of data streams, indices, and aliases to search.
3788
3858
  Supports wildcards (`*`). To search all data streams and indices, omit this
@@ -4210,10 +4280,9 @@ class Elasticsearch(BaseClient):
4210
4280
  body: t.Optional[t.Dict[str, t.Any]] = None,
4211
4281
  ) -> BinaryApiResponse:
4212
4282
  """
4213
- Searches a vector tile for geospatial values. Returns results as a binary Mapbox
4214
- vector tile.
4283
+ Search a vector tile. Search a vector tile for geospatial values.
4215
4284
 
4216
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-vector-tile-api.html>`_
4285
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-vector-tile-api.html>`_
4217
4286
 
4218
4287
  :param index: Comma-separated list of data streams, indices, or aliases to search
4219
4288
  :param field: Field containing geospatial data to return
@@ -4365,10 +4434,12 @@ class Elasticsearch(BaseClient):
4365
4434
  routing: t.Optional[str] = None,
4366
4435
  ) -> ObjectApiResponse[t.Any]:
4367
4436
  """
4368
- Returns information about the indices and shards that a search request would
4369
- be executed against.
4437
+ Get the search shards. Get the indices and shards that a search request would
4438
+ be run against. This information can be useful for working out issues or planning
4439
+ optimizations with routing and shard preferences. When filtered aliases are used,
4440
+ the filter is returned as part of the indices section.
4370
4441
 
4371
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-shards.html>`_
4442
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-shards.html>`_
4372
4443
 
4373
4444
  :param index: Returns the indices and shards that a search request would be executed
4374
4445
  against.
@@ -4467,9 +4538,9 @@ class Elasticsearch(BaseClient):
4467
4538
  body: t.Optional[t.Dict[str, t.Any]] = None,
4468
4539
  ) -> ObjectApiResponse[t.Any]:
4469
4540
  """
4470
- Runs a search with a search template.
4541
+ Run a search with a search template.
4471
4542
 
4472
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-template.html>`_
4543
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-template.html>`_
4473
4544
 
4474
4545
  :param index: Comma-separated list of data streams, indices, and aliases to search.
4475
4546
  Supports wildcards (*).
@@ -4599,11 +4670,17 @@ class Elasticsearch(BaseClient):
4599
4670
  body: t.Optional[t.Dict[str, t.Any]] = None,
4600
4671
  ) -> ObjectApiResponse[t.Any]:
4601
4672
  """
4602
- The terms enum API can be used to discover terms in the index that begin with
4603
- the provided string. It is designed for low-latency look-ups used in auto-complete
4604
- scenarios.
4605
-
4606
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-terms-enum.html>`_
4673
+ Get terms in an index. Discover terms that match a partial string in an index.
4674
+ This "terms enum" API is designed for low-latency look-ups used in auto-complete
4675
+ scenarios. If the `complete` property in the response is false, the returned
4676
+ terms set may be incomplete and should be treated as approximate. This can occur
4677
+ due to a few reasons, such as a request timeout or a node error. NOTE: The terms
4678
+ enum API may return terms from deleted documents. Deleted documents are initially
4679
+ only marked as deleted. It is not until their segments are merged that documents
4680
+ are actually deleted. Until that happens, the terms enum API will return terms
4681
+ from these documents.
4682
+
4683
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-terms-enum.html>`_
4607
4684
 
4608
4685
  :param index: Comma-separated list of data streams, indices, and index aliases
4609
4686
  to search. Wildcard (*) expressions are supported.
@@ -4699,10 +4776,10 @@ class Elasticsearch(BaseClient):
4699
4776
  body: t.Optional[t.Dict[str, t.Any]] = None,
4700
4777
  ) -> ObjectApiResponse[t.Any]:
4701
4778
  """
4702
- Returns information and statistics about terms in the fields of a particular
4703
- document.
4779
+ Get term vector information. Get information and statistics about terms in the
4780
+ fields of a particular document.
4704
4781
 
4705
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-termvectors.html>`_
4782
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-termvectors.html>`_
4706
4783
 
4707
4784
  :param index: Name of the index that contains the document.
4708
4785
  :param id: Unique identifier of the document.
@@ -4842,9 +4919,10 @@ class Elasticsearch(BaseClient):
4842
4919
  body: t.Optional[t.Dict[str, t.Any]] = None,
4843
4920
  ) -> ObjectApiResponse[t.Any]:
4844
4921
  """
4845
- Updates a document with a script or partial document.
4922
+ Update a document. Updates a document by running a script or passing a partial
4923
+ document.
4846
4924
 
4847
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-update.html>`_
4925
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-update.html>`_
4848
4926
 
4849
4927
  :param index: The name of the index
4850
4928
  :param id: Document ID
@@ -5006,11 +5084,11 @@ class Elasticsearch(BaseClient):
5006
5084
  body: t.Optional[t.Dict[str, t.Any]] = None,
5007
5085
  ) -> ObjectApiResponse[t.Any]:
5008
5086
  """
5009
- Updates documents that match the specified query. If no query is specified, performs
5010
- an update on every document in the data stream or index without modifying the
5011
- source, which is useful for picking up mapping changes.
5087
+ Update documents. Updates documents that match the specified query. If no query
5088
+ is specified, performs an update on every document in the data stream or index
5089
+ without modifying the source, which is useful for picking up mapping changes.
5012
5090
 
5013
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-update-by-query.html>`_
5091
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-update-by-query.html>`_
5014
5092
 
5015
5093
  :param index: Comma-separated list of data streams, indices, and aliases to search.
5016
5094
  Supports wildcards (`*`). To search all data streams or indices, omit this
@@ -5204,9 +5282,12 @@ class Elasticsearch(BaseClient):
5204
5282
  requests_per_second: t.Optional[float] = None,
5205
5283
  ) -> ObjectApiResponse[t.Any]:
5206
5284
  """
5207
- Changes the number of requests per second for a particular Update By Query operation.
5285
+ Throttle an update by query operation. Change the number of requests per second
5286
+ for a particular update by query operation. Rethrottling that speeds up the query
5287
+ takes effect immediately but rethrotting that slows down the query takes effect
5288
+ after completing the current batch to prevent scroll timeouts.
5208
5289
 
5209
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-update-by-query.html>`_
5290
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-update-by-query.html>`_
5210
5291
 
5211
5292
  :param task_id: The ID for the task.
5212
5293
  :param requests_per_second: The throttle for this request in sub-requests per