elasticsearch 9.2.0__py3-none-any.whl → 9.3.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 (125) hide show
  1. elasticsearch/_async/client/__init__.py +108 -85
  2. elasticsearch/_async/client/async_search.py +7 -6
  3. elasticsearch/_async/client/autoscaling.py +15 -4
  4. elasticsearch/_async/client/cat.py +203 -10
  5. elasticsearch/_async/client/ccr.py +10 -10
  6. elasticsearch/_async/client/cluster.py +98 -66
  7. elasticsearch/_async/client/connector.py +42 -41
  8. elasticsearch/_async/client/dangling_indices.py +8 -12
  9. elasticsearch/_async/client/enrich.py +10 -10
  10. elasticsearch/_async/client/eql.py +17 -16
  11. elasticsearch/_async/client/esql.py +173 -24
  12. elasticsearch/_async/client/features.py +6 -6
  13. elasticsearch/_async/client/fleet.py +8 -8
  14. elasticsearch/_async/client/graph.py +3 -3
  15. elasticsearch/_async/client/ilm.py +18 -18
  16. elasticsearch/_async/client/indices.py +564 -149
  17. elasticsearch/_async/client/inference.py +374 -64
  18. elasticsearch/_async/client/ingest.py +9 -9
  19. elasticsearch/_async/client/license.py +5 -7
  20. elasticsearch/_async/client/logstash.py +4 -4
  21. elasticsearch/_async/client/migration.py +6 -6
  22. elasticsearch/_async/client/ml.py +132 -88
  23. elasticsearch/_async/client/monitoring.py +4 -3
  24. elasticsearch/_async/client/nodes.py +182 -20
  25. elasticsearch/_async/client/project.py +13 -4
  26. elasticsearch/_async/client/query_rules.py +16 -16
  27. elasticsearch/_async/client/rollup.py +21 -21
  28. elasticsearch/_async/client/search_application.py +19 -19
  29. elasticsearch/_async/client/searchable_snapshots.py +10 -10
  30. elasticsearch/_async/client/security.py +34 -10
  31. elasticsearch/_async/client/shutdown.py +15 -4
  32. elasticsearch/_async/client/simulate.py +4 -4
  33. elasticsearch/_async/client/slm.py +17 -17
  34. elasticsearch/_async/client/snapshot.py +21 -21
  35. elasticsearch/_async/client/sql.py +17 -16
  36. elasticsearch/_async/client/streams.py +6 -7
  37. elasticsearch/_async/client/synonyms.py +10 -10
  38. elasticsearch/_async/client/tasks.py +8 -8
  39. elasticsearch/_async/client/text_structure.py +16 -12
  40. elasticsearch/_async/client/transform.py +51 -12
  41. elasticsearch/_async/client/utils.py +4 -2
  42. elasticsearch/_async/client/watcher.py +26 -26
  43. elasticsearch/_async/client/xpack.py +6 -5
  44. elasticsearch/_sync/client/__init__.py +110 -85
  45. elasticsearch/_sync/client/async_search.py +7 -6
  46. elasticsearch/_sync/client/autoscaling.py +15 -4
  47. elasticsearch/_sync/client/cat.py +203 -10
  48. elasticsearch/_sync/client/ccr.py +10 -10
  49. elasticsearch/_sync/client/cluster.py +98 -66
  50. elasticsearch/_sync/client/connector.py +42 -41
  51. elasticsearch/_sync/client/dangling_indices.py +8 -12
  52. elasticsearch/_sync/client/enrich.py +10 -10
  53. elasticsearch/_sync/client/eql.py +17 -16
  54. elasticsearch/_sync/client/esql.py +173 -24
  55. elasticsearch/_sync/client/features.py +6 -6
  56. elasticsearch/_sync/client/fleet.py +8 -8
  57. elasticsearch/_sync/client/graph.py +3 -3
  58. elasticsearch/_sync/client/ilm.py +18 -18
  59. elasticsearch/_sync/client/indices.py +564 -149
  60. elasticsearch/_sync/client/inference.py +374 -64
  61. elasticsearch/_sync/client/ingest.py +9 -9
  62. elasticsearch/_sync/client/license.py +5 -7
  63. elasticsearch/_sync/client/logstash.py +4 -4
  64. elasticsearch/_sync/client/migration.py +6 -6
  65. elasticsearch/_sync/client/ml.py +132 -88
  66. elasticsearch/_sync/client/monitoring.py +4 -3
  67. elasticsearch/_sync/client/nodes.py +182 -20
  68. elasticsearch/_sync/client/project.py +13 -4
  69. elasticsearch/_sync/client/project_routing.py +264 -0
  70. elasticsearch/_sync/client/query_rules.py +16 -16
  71. elasticsearch/_sync/client/rollup.py +21 -21
  72. elasticsearch/_sync/client/search_application.py +19 -19
  73. elasticsearch/_sync/client/searchable_snapshots.py +10 -10
  74. elasticsearch/_sync/client/security.py +34 -10
  75. elasticsearch/_sync/client/shutdown.py +15 -4
  76. elasticsearch/_sync/client/simulate.py +4 -4
  77. elasticsearch/_sync/client/slm.py +17 -17
  78. elasticsearch/_sync/client/snapshot.py +21 -21
  79. elasticsearch/_sync/client/sql.py +17 -16
  80. elasticsearch/_sync/client/streams.py +6 -7
  81. elasticsearch/_sync/client/synonyms.py +10 -10
  82. elasticsearch/_sync/client/tasks.py +8 -8
  83. elasticsearch/_sync/client/text_structure.py +16 -12
  84. elasticsearch/_sync/client/transform.py +51 -12
  85. elasticsearch/_sync/client/utils.py +16 -2
  86. elasticsearch/_sync/client/watcher.py +26 -26
  87. elasticsearch/_sync/client/xpack.py +6 -5
  88. elasticsearch/_version.py +2 -2
  89. elasticsearch/dsl/__init__.py +4 -0
  90. elasticsearch/dsl/_async/document.py +4 -5
  91. elasticsearch/dsl/_async/index.py +1 -1
  92. elasticsearch/dsl/_async/search.py +2 -3
  93. elasticsearch/dsl/_sync/document.py +4 -5
  94. elasticsearch/dsl/_sync/index.py +1 -1
  95. elasticsearch/dsl/_sync/search.py +2 -3
  96. elasticsearch/dsl/aggs.py +9 -9
  97. elasticsearch/dsl/async_connections.py +1 -2
  98. elasticsearch/dsl/connections.py +1 -2
  99. elasticsearch/dsl/document_base.py +1 -1
  100. elasticsearch/dsl/field.py +90 -6
  101. elasticsearch/dsl/pydantic.py +1 -1
  102. elasticsearch/dsl/query.py +25 -2
  103. elasticsearch/dsl/response/__init__.py +2 -0
  104. elasticsearch/dsl/serializer.py +1 -2
  105. elasticsearch/dsl/types.py +63 -8
  106. elasticsearch/dsl/utils.py +12 -4
  107. elasticsearch/esql/esql.py +1 -1
  108. elasticsearch/esql/functions.py +926 -252
  109. elasticsearch/helpers/__init__.py +2 -0
  110. elasticsearch/helpers/actions.py +21 -0
  111. elasticsearch/helpers/vectorstore/__init__.py +7 -7
  112. elasticsearch/helpers/vectorstore/_async/_utils.py +1 -1
  113. elasticsearch/helpers/vectorstore/_async/embedding_service.py +2 -2
  114. elasticsearch/helpers/vectorstore/_async/strategies.py +3 -3
  115. elasticsearch/helpers/vectorstore/_async/vectorstore.py +8 -5
  116. elasticsearch/helpers/vectorstore/_sync/_utils.py +1 -1
  117. elasticsearch/helpers/vectorstore/_sync/embedding_service.py +2 -2
  118. elasticsearch/helpers/vectorstore/_sync/strategies.py +3 -3
  119. elasticsearch/helpers/vectorstore/_sync/vectorstore.py +8 -5
  120. {elasticsearch-9.2.0.dist-info → elasticsearch-9.3.0.dist-info}/METADATA +2 -1
  121. elasticsearch-9.3.0.dist-info/RECORD +169 -0
  122. {elasticsearch-9.2.0.dist-info → elasticsearch-9.3.0.dist-info}/WHEEL +1 -1
  123. elasticsearch-9.2.0.dist-info/RECORD +0 -168
  124. {elasticsearch-9.2.0.dist-info → elasticsearch-9.3.0.dist-info}/licenses/LICENSE +0 -0
  125. {elasticsearch-9.2.0.dist-info → elasticsearch-9.3.0.dist-info}/licenses/NOTICE +0 -0
@@ -85,9 +85,9 @@ from .utils import (
85
85
  CLIENT_META_SERVICE,
86
86
  SKIP_IN_PATH,
87
87
  Stability,
88
+ _availability_warning,
88
89
  _quote,
89
90
  _rewrite_parameters,
90
- _stability_warning,
91
91
  client_node_configs,
92
92
  is_requests_http_auth,
93
93
  is_requests_node_class,
@@ -504,6 +504,7 @@ class AsyncElasticsearch(BaseClient):
504
504
  """
505
505
  __path = "/"
506
506
  __query: t.Dict[str, t.Any] = {}
507
+ __path_parts: t.Dict[str, str] = {}
507
508
  if error_trace is not None:
508
509
  __query["error_trace"] = error_trace
509
510
  if filter_path is not None:
@@ -515,7 +516,12 @@ class AsyncElasticsearch(BaseClient):
515
516
  __headers = {"accept": "application/json"}
516
517
  try:
517
518
  await self.perform_request(
518
- "HEAD", __path, params=__query, headers=__headers
519
+ "HEAD",
520
+ __path,
521
+ params=__query,
522
+ headers=__headers,
523
+ endpoint_id="ping",
524
+ path_parts=__path_parts,
519
525
  )
520
526
  return True
521
527
  except (ApiError, TransportError):
@@ -549,7 +555,7 @@ class AsyncElasticsearch(BaseClient):
549
555
  ] = None,
550
556
  require_alias: t.Optional[bool] = None,
551
557
  require_data_stream: t.Optional[bool] = None,
552
- routing: t.Optional[str] = None,
558
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
553
559
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
554
560
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
555
561
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -561,8 +567,8 @@ class AsyncElasticsearch(BaseClient):
561
567
  """
562
568
  .. raw:: html
563
569
 
564
- <p>Bulk index or delete documents.
565
- Perform multiple <code>index</code>, <code>create</code>, <code>delete</code>, and <code>update</code> actions in a single request.
570
+ <p>Bulk index or delete documents.</p>
571
+ <p>Perform multiple <code>index</code>, <code>create</code>, <code>delete</code>, and <code>update</code> actions in a single request.
566
572
  This reduces overhead and can greatly increase indexing speed.</p>
567
573
  <p>If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias:</p>
568
574
  <ul>
@@ -610,6 +616,7 @@ class AsyncElasticsearch(BaseClient):
610
616
  <li>Perl: Check out <code>Search::Elasticsearch::Client::5_0::Bulk</code> and <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
611
617
  <li>Python: Check out <code>elasticsearch.helpers.*</code></li>
612
618
  <li>JavaScript: Check out <code>client.helpers.*</code></li>
619
+ <li>Java: Check out <code>co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester</code></li>
613
620
  <li>.NET: Check out <code>BulkAllObservable</code></li>
614
621
  <li>PHP: Check out bulk indexing.</li>
615
622
  <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
@@ -767,8 +774,8 @@ class AsyncElasticsearch(BaseClient):
767
774
  """
768
775
  .. raw:: html
769
776
 
770
- <p>Clear a scrolling search.
771
- Clear the search context and results for a scrolling search.</p>
777
+ <p>Clear a scrolling search.</p>
778
+ <p>Clear the search context and results for a scrolling search.</p>
772
779
 
773
780
 
774
781
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-clear-scroll>`_
@@ -821,8 +828,8 @@ class AsyncElasticsearch(BaseClient):
821
828
  """
822
829
  .. raw:: html
823
830
 
824
- <p>Close a point in time.
825
- A point in time must be opened explicitly before being used in search requests.
831
+ <p>Close a point in time.</p>
832
+ <p>A point in time must be opened explicitly before being used in search requests.
826
833
  The <code>keep_alive</code> parameter tells Elasticsearch how long it should persist.
827
834
  A point in time is automatically closed when the <code>keep_alive</code> period has elapsed.
828
835
  However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.</p>
@@ -861,7 +868,7 @@ class AsyncElasticsearch(BaseClient):
861
868
  )
862
869
 
863
870
  @_rewrite_parameters(
864
- body_fields=("query",),
871
+ body_fields=("project_routing", "query"),
865
872
  )
866
873
  async def count(
867
874
  self,
@@ -892,15 +899,15 @@ class AsyncElasticsearch(BaseClient):
892
899
  project_routing: t.Optional[str] = None,
893
900
  q: t.Optional[str] = None,
894
901
  query: t.Optional[t.Mapping[str, t.Any]] = None,
895
- routing: t.Optional[str] = None,
902
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
896
903
  terminate_after: t.Optional[int] = None,
897
904
  body: t.Optional[t.Dict[str, t.Any]] = None,
898
905
  ) -> ObjectApiResponse[t.Any]:
899
906
  """
900
907
  .. raw:: html
901
908
 
902
- <p>Count search results.
903
- Get the number of documents matching a query.</p>
909
+ <p>Count search results.</p>
910
+ <p>Get the number of documents matching a query.</p>
904
911
  <p>The query can be provided either by using a simple query string as a parameter, or by defining Query DSL within the request body.
905
912
  The query is optional. When no query is provided, the API uses <code>match_all</code> to count all the documents.</p>
906
913
  <p>The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices.</p>
@@ -944,10 +951,10 @@ class AsyncElasticsearch(BaseClient):
944
951
  in the result.
945
952
  :param preference: The node or shard the operation should be performed on. By
946
953
  default, it is random.
947
- :param project_routing: Specifies a subset of projects to target for the search
948
- using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
949
- queries: the _alias tag and a single value (possibly wildcarded). Examples:
950
- _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
954
+ :param project_routing: Specifies a subset of projects to target using project
955
+ metadata tags in a subset of Lucene query syntax. Allowed Lucene queries:
956
+ the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project
957
+ _alias:_origin _alias:*pr* Supported in serverless only.
951
958
  :param q: The query in Lucene query string syntax. This parameter cannot be used
952
959
  with a request body.
953
960
  :param query: Defines the search query using Query DSL. A request body query
@@ -1000,8 +1007,6 @@ class AsyncElasticsearch(BaseClient):
1000
1007
  __query["preference"] = preference
1001
1008
  if pretty is not None:
1002
1009
  __query["pretty"] = pretty
1003
- if project_routing is not None:
1004
- __query["project_routing"] = project_routing
1005
1010
  if q is not None:
1006
1011
  __query["q"] = q
1007
1012
  if routing is not None:
@@ -1009,6 +1014,8 @@ class AsyncElasticsearch(BaseClient):
1009
1014
  if terminate_after is not None:
1010
1015
  __query["terminate_after"] = terminate_after
1011
1016
  if not __body:
1017
+ if project_routing is not None:
1018
+ __body["project_routing"] = project_routing
1012
1019
  if query is not None:
1013
1020
  __body["query"] = query
1014
1021
  if not __body:
@@ -1047,7 +1054,7 @@ class AsyncElasticsearch(BaseClient):
1047
1054
  ] = None,
1048
1055
  require_alias: t.Optional[bool] = None,
1049
1056
  require_data_stream: t.Optional[bool] = None,
1050
- routing: t.Optional[str] = None,
1057
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1051
1058
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1052
1059
  version: t.Optional[int] = None,
1053
1060
  version_type: t.Optional[
@@ -1226,7 +1233,7 @@ class AsyncElasticsearch(BaseClient):
1226
1233
  refresh: t.Optional[
1227
1234
  t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
1228
1235
  ] = None,
1229
- routing: t.Optional[str] = None,
1236
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1230
1237
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1231
1238
  version: t.Optional[int] = None,
1232
1239
  version_type: t.Optional[
@@ -1369,7 +1376,7 @@ class AsyncElasticsearch(BaseClient):
1369
1376
  refresh: t.Optional[bool] = None,
1370
1377
  request_cache: t.Optional[bool] = None,
1371
1378
  requests_per_second: t.Optional[float] = None,
1372
- routing: t.Optional[str] = None,
1379
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1373
1380
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1374
1381
  scroll_size: t.Optional[int] = None,
1375
1382
  search_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -1642,11 +1649,11 @@ class AsyncElasticsearch(BaseClient):
1642
1649
  self,
1643
1650
  *,
1644
1651
  task_id: str,
1652
+ requests_per_second: float,
1645
1653
  error_trace: t.Optional[bool] = None,
1646
1654
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1647
1655
  human: t.Optional[bool] = None,
1648
1656
  pretty: t.Optional[bool] = None,
1649
- requests_per_second: t.Optional[float] = None,
1650
1657
  ) -> ObjectApiResponse[t.Any]:
1651
1658
  """
1652
1659
  .. raw:: html
@@ -1664,9 +1671,13 @@ class AsyncElasticsearch(BaseClient):
1664
1671
  """
1665
1672
  if task_id in SKIP_IN_PATH:
1666
1673
  raise ValueError("Empty value passed for parameter 'task_id'")
1674
+ if requests_per_second is None:
1675
+ raise ValueError("Empty value passed for parameter 'requests_per_second'")
1667
1676
  __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
1668
1677
  __path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle'
1669
1678
  __query: t.Dict[str, t.Any] = {}
1679
+ if requests_per_second is not None:
1680
+ __query["requests_per_second"] = requests_per_second
1670
1681
  if error_trace is not None:
1671
1682
  __query["error_trace"] = error_trace
1672
1683
  if filter_path is not None:
@@ -1675,8 +1686,6 @@ class AsyncElasticsearch(BaseClient):
1675
1686
  __query["human"] = human
1676
1687
  if pretty is not None:
1677
1688
  __query["pretty"] = pretty
1678
- if requests_per_second is not None:
1679
- __query["requests_per_second"] = requests_per_second
1680
1689
  __headers = {"accept": "application/json"}
1681
1690
  return await self.perform_request( # type: ignore[return-value]
1682
1691
  "POST",
@@ -1702,8 +1711,8 @@ class AsyncElasticsearch(BaseClient):
1702
1711
  """
1703
1712
  .. raw:: html
1704
1713
 
1705
- <p>Delete a script or search template.
1706
- Deletes a stored script or search template.</p>
1714
+ <p>Delete a script or search template.</p>
1715
+ <p>Deletes a stored script or search template.</p>
1707
1716
 
1708
1717
 
1709
1718
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script>`_
@@ -1763,7 +1772,7 @@ class AsyncElasticsearch(BaseClient):
1763
1772
  pretty: t.Optional[bool] = None,
1764
1773
  realtime: t.Optional[bool] = None,
1765
1774
  refresh: t.Optional[bool] = None,
1766
- routing: t.Optional[str] = None,
1775
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1767
1776
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
1768
1777
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1769
1778
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -1893,7 +1902,7 @@ class AsyncElasticsearch(BaseClient):
1893
1902
  pretty: t.Optional[bool] = None,
1894
1903
  realtime: t.Optional[bool] = None,
1895
1904
  refresh: t.Optional[bool] = None,
1896
- routing: t.Optional[str] = None,
1905
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1897
1906
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
1898
1907
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1899
1908
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -2004,7 +2013,7 @@ class AsyncElasticsearch(BaseClient):
2004
2013
  pretty: t.Optional[bool] = None,
2005
2014
  q: t.Optional[str] = None,
2006
2015
  query: t.Optional[t.Mapping[str, t.Any]] = None,
2007
- routing: t.Optional[str] = None,
2016
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2008
2017
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
2009
2018
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2010
2019
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -2014,8 +2023,8 @@ class AsyncElasticsearch(BaseClient):
2014
2023
  """
2015
2024
  .. raw:: html
2016
2025
 
2017
- <p>Explain a document match result.
2018
- Get information about why a specific document matches, or doesn't match, a query.
2026
+ <p>Explain a document match result.</p>
2027
+ <p>Get information about why a specific document matches, or doesn't match, a query.
2019
2028
  It computes a score explanation for a query and a specific document.</p>
2020
2029
 
2021
2030
 
@@ -2115,7 +2124,7 @@ class AsyncElasticsearch(BaseClient):
2115
2124
  )
2116
2125
 
2117
2126
  @_rewrite_parameters(
2118
- body_fields=("fields", "index_filter", "runtime_mappings"),
2127
+ body_fields=("fields", "index_filter", "project_routing", "runtime_mappings"),
2119
2128
  )
2120
2129
  async def field_caps(
2121
2130
  self,
@@ -2133,7 +2142,7 @@ class AsyncElasticsearch(BaseClient):
2133
2142
  ] = None,
2134
2143
  fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2135
2144
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2136
- filters: t.Optional[str] = None,
2145
+ filters: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2137
2146
  human: t.Optional[bool] = None,
2138
2147
  ignore_unavailable: t.Optional[bool] = None,
2139
2148
  include_empty_fields: t.Optional[bool] = None,
@@ -2226,8 +2235,6 @@ class AsyncElasticsearch(BaseClient):
2226
2235
  __query["include_unmapped"] = include_unmapped
2227
2236
  if pretty is not None:
2228
2237
  __query["pretty"] = pretty
2229
- if project_routing is not None:
2230
- __query["project_routing"] = project_routing
2231
2238
  if types is not None:
2232
2239
  __query["types"] = types
2233
2240
  if not __body:
@@ -2235,6 +2242,8 @@ class AsyncElasticsearch(BaseClient):
2235
2242
  __body["fields"] = fields
2236
2243
  if index_filter is not None:
2237
2244
  __body["index_filter"] = index_filter
2245
+ if project_routing is not None:
2246
+ __body["project_routing"] = project_routing
2238
2247
  if runtime_mappings is not None:
2239
2248
  __body["runtime_mappings"] = runtime_mappings
2240
2249
  if not __body:
@@ -2273,7 +2282,7 @@ class AsyncElasticsearch(BaseClient):
2273
2282
  pretty: t.Optional[bool] = None,
2274
2283
  realtime: t.Optional[bool] = None,
2275
2284
  refresh: t.Optional[bool] = None,
2276
- routing: t.Optional[str] = None,
2285
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2277
2286
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
2278
2287
  source_exclude_vectors: t.Optional[bool] = None,
2279
2288
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -2431,8 +2440,8 @@ class AsyncElasticsearch(BaseClient):
2431
2440
  """
2432
2441
  .. raw:: html
2433
2442
 
2434
- <p>Get a script or search template.
2435
- Retrieves a stored script or search template.</p>
2443
+ <p>Get a script or search template.</p>
2444
+ <p>Retrieves a stored script or search template.</p>
2436
2445
 
2437
2446
 
2438
2447
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script>`_
@@ -2565,7 +2574,7 @@ class AsyncElasticsearch(BaseClient):
2565
2574
  pretty: t.Optional[bool] = None,
2566
2575
  realtime: t.Optional[bool] = None,
2567
2576
  refresh: t.Optional[bool] = None,
2568
- routing: t.Optional[str] = None,
2577
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2569
2578
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
2570
2579
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2571
2580
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -2668,8 +2677,8 @@ class AsyncElasticsearch(BaseClient):
2668
2677
  """
2669
2678
  .. raw:: html
2670
2679
 
2671
- <p>Get the cluster health.
2672
- Get a report with the health status of an Elasticsearch cluster.
2680
+ <p>Get the cluster health.</p>
2681
+ <p>Get a report with the health status of an Elasticsearch cluster.
2673
2682
  The report contains a list of indicators that compose Elasticsearch functionality.</p>
2674
2683
  <p>Each indicator has a health status of: green, unknown, yellow or red.
2675
2684
  The indicator will provide an explanation and metadata describing the reason for its current health status.</p>
@@ -2747,7 +2756,7 @@ class AsyncElasticsearch(BaseClient):
2747
2756
  ] = None,
2748
2757
  require_alias: t.Optional[bool] = None,
2749
2758
  require_data_stream: t.Optional[bool] = None,
2750
- routing: t.Optional[str] = None,
2759
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2751
2760
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2752
2761
  version: t.Optional[int] = None,
2753
2762
  version_type: t.Optional[
@@ -2840,13 +2849,11 @@ class AsyncElasticsearch(BaseClient):
2840
2849
  &quot;id&quot;: &quot;elkbee&quot;
2841
2850
  }
2842
2851
  }
2843
-
2844
- In this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1.
2845
- If the document was already updated and its version was set to 2 or higher, the indexing command will fail and result in a conflict (409 HTTP status code).
2846
-
2847
- A nice side effect is that there is no need to maintain strict ordering of async indexing operations run as a result of changes to a source database, as long as version numbers from the source database are used.
2848
- Even the simple case of updating the Elasticsearch index using data from a database is simplified if external versioning is used, as only the latest version will be used if the index operations arrive out of order.
2849
2852
  </code></pre>
2853
+ <p>In this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1.
2854
+ If the document was already updated and its version was set to 2 or higher, the indexing command will fail and result in a conflict (409 HTTP status code).</p>
2855
+ <p>A nice side effect is that there is no need to maintain strict ordering of async indexing operations run as a result of changes to a source database, as long as version numbers from the source database are used.
2856
+ Even the simple case of updating the Elasticsearch index using data from a database is simplified if external versioning is used, as only the latest version will be used if the index operations arrive out of order.</p>
2850
2857
 
2851
2858
 
2852
2859
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create>`_
@@ -2981,8 +2988,8 @@ class AsyncElasticsearch(BaseClient):
2981
2988
  """
2982
2989
  .. raw:: html
2983
2990
 
2984
- <p>Get cluster info.
2985
- Get basic build, version, and cluster information.
2991
+ <p>Get cluster info.</p>
2992
+ <p>Get basic build, version, and cluster information.
2986
2993
  ::: In Serverless, this API is retained for backward compatibility only. Some response fields, such as the version number, should be ignored.</p>
2987
2994
 
2988
2995
 
@@ -3031,7 +3038,7 @@ class AsyncElasticsearch(BaseClient):
3031
3038
  pretty: t.Optional[bool] = None,
3032
3039
  realtime: t.Optional[bool] = None,
3033
3040
  refresh: t.Optional[bool] = None,
3034
- routing: t.Optional[str] = None,
3041
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3035
3042
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
3036
3043
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3037
3044
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -3168,7 +3175,7 @@ class AsyncElasticsearch(BaseClient):
3168
3175
  pretty: t.Optional[bool] = None,
3169
3176
  project_routing: t.Optional[str] = None,
3170
3177
  rest_total_hits_as_int: t.Optional[bool] = None,
3171
- routing: t.Optional[str] = None,
3178
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3172
3179
  search_type: t.Optional[
3173
3180
  t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
3174
3181
  ] = None,
@@ -3434,7 +3441,7 @@ class AsyncElasticsearch(BaseClient):
3434
3441
  preference: t.Optional[str] = None,
3435
3442
  pretty: t.Optional[bool] = None,
3436
3443
  realtime: t.Optional[bool] = None,
3437
- routing: t.Optional[str] = None,
3444
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3438
3445
  term_statistics: t.Optional[bool] = None,
3439
3446
  version: t.Optional[int] = None,
3440
3447
  version_type: t.Optional[
@@ -3539,7 +3546,7 @@ class AsyncElasticsearch(BaseClient):
3539
3546
  )
3540
3547
 
3541
3548
  @_rewrite_parameters(
3542
- body_fields=("index_filter",),
3549
+ body_fields=("index_filter", "project_routing"),
3543
3550
  )
3544
3551
  async def open_point_in_time(
3545
3552
  self,
@@ -3564,7 +3571,7 @@ class AsyncElasticsearch(BaseClient):
3564
3571
  preference: t.Optional[str] = None,
3565
3572
  pretty: t.Optional[bool] = None,
3566
3573
  project_routing: t.Optional[str] = None,
3567
- routing: t.Optional[str] = None,
3574
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3568
3575
  body: t.Optional[t.Dict[str, t.Any]] = None,
3569
3576
  ) -> ObjectApiResponse[t.Any]:
3570
3577
  """
@@ -3656,13 +3663,13 @@ class AsyncElasticsearch(BaseClient):
3656
3663
  __query["preference"] = preference
3657
3664
  if pretty is not None:
3658
3665
  __query["pretty"] = pretty
3659
- if project_routing is not None:
3660
- __query["project_routing"] = project_routing
3661
3666
  if routing is not None:
3662
3667
  __query["routing"] = routing
3663
3668
  if not __body:
3664
3669
  if index_filter is not None:
3665
3670
  __body["index_filter"] = index_filter
3671
+ if project_routing is not None:
3672
+ __body["project_routing"] = project_routing
3666
3673
  if not __body:
3667
3674
  __body = None # type: ignore[assignment]
3668
3675
  __headers = {"accept": "application/json"}
@@ -3698,8 +3705,8 @@ class AsyncElasticsearch(BaseClient):
3698
3705
  """
3699
3706
  .. raw:: html
3700
3707
 
3701
- <p>Create or update a script or search template.
3702
- Creates or updates a stored script or search template.</p>
3708
+ <p>Create or update a script or search template.</p>
3709
+ <p>Creates or updates a stored script or search template.</p>
3703
3710
 
3704
3711
 
3705
3712
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-put-script>`_
@@ -3782,7 +3789,9 @@ class AsyncElasticsearch(BaseClient):
3782
3789
  ignore_unavailable: t.Optional[bool] = None,
3783
3790
  metric: t.Optional[t.Mapping[str, t.Any]] = None,
3784
3791
  pretty: t.Optional[bool] = None,
3785
- search_type: t.Optional[str] = None,
3792
+ search_type: t.Optional[
3793
+ t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
3794
+ ] = None,
3786
3795
  body: t.Optional[t.Dict[str, t.Any]] = None,
3787
3796
  ) -> ObjectApiResponse[t.Any]:
3788
3797
  """
@@ -3902,7 +3911,8 @@ class AsyncElasticsearch(BaseClient):
3902
3911
  <li>To automatically create a data stream or index with a reindex API request, you must have the <code>auto_configure</code>, <code>create_index</code>, or <code>manage</code> index privilege for the destination data stream, index, or alias.</li>
3903
3912
  <li>If reindexing from a remote cluster, the <code>source.remote.user</code> must have the <code>monitor</code> cluster privilege and the <code>read</code> index privilege for the source data stream, index, or alias.</li>
3904
3913
  </ul>
3905
- <p>If reindexing from a remote cluster, you must explicitly allow the remote host in the <code>reindex.remote.whitelist</code> setting.
3914
+ <p>If reindexing from a remote cluster into a cluster using Elastic Stack, you must explicitly allow the remote host using the <code>reindex.remote.whitelist</code> node setting on the destination cluster.
3915
+ If reindexing from a remote cluster into an Elastic Cloud Serverless project, only remote hosts from Elastic Cloud Hosted are allowed.
3906
3916
  Automatic data stream creation requires a matching index template with data stream enabled.</p>
3907
3917
  <p>The <code>dest</code> element can be configured like the index API to control optimistic concurrency control.
3908
3918
  Omitting <code>version_type</code> or setting it to <code>internal</code> causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID.</p>
@@ -4029,11 +4039,11 @@ class AsyncElasticsearch(BaseClient):
4029
4039
  self,
4030
4040
  *,
4031
4041
  task_id: str,
4042
+ requests_per_second: float,
4032
4043
  error_trace: t.Optional[bool] = None,
4033
4044
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4034
4045
  human: t.Optional[bool] = None,
4035
4046
  pretty: t.Optional[bool] = None,
4036
- requests_per_second: t.Optional[float] = None,
4037
4047
  ) -> ObjectApiResponse[t.Any]:
4038
4048
  """
4039
4049
  .. raw:: html
@@ -4057,9 +4067,13 @@ class AsyncElasticsearch(BaseClient):
4057
4067
  """
4058
4068
  if task_id in SKIP_IN_PATH:
4059
4069
  raise ValueError("Empty value passed for parameter 'task_id'")
4070
+ if requests_per_second is None:
4071
+ raise ValueError("Empty value passed for parameter 'requests_per_second'")
4060
4072
  __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
4061
4073
  __path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle'
4062
4074
  __query: t.Dict[str, t.Any] = {}
4075
+ if requests_per_second is not None:
4076
+ __query["requests_per_second"] = requests_per_second
4063
4077
  if error_trace is not None:
4064
4078
  __query["error_trace"] = error_trace
4065
4079
  if filter_path is not None:
@@ -4068,8 +4082,6 @@ class AsyncElasticsearch(BaseClient):
4068
4082
  __query["human"] = human
4069
4083
  if pretty is not None:
4070
4084
  __query["pretty"] = pretty
4071
- if requests_per_second is not None:
4072
- __query["requests_per_second"] = requests_per_second
4073
4085
  __headers = {"accept": "application/json"}
4074
4086
  return await self.perform_request( # type: ignore[return-value]
4075
4087
  "POST",
@@ -4153,7 +4165,7 @@ class AsyncElasticsearch(BaseClient):
4153
4165
  @_rewrite_parameters(
4154
4166
  body_fields=("context", "context_setup", "script"),
4155
4167
  )
4156
- @_stability_warning(Stability.EXPERIMENTAL)
4168
+ @_availability_warning(Stability.EXPERIMENTAL)
4157
4169
  async def scripts_painless_execute(
4158
4170
  self,
4159
4171
  *,
@@ -4324,6 +4336,7 @@ class AsyncElasticsearch(BaseClient):
4324
4336
  "pit",
4325
4337
  "post_filter",
4326
4338
  "profile",
4339
+ "project_routing",
4327
4340
  "query",
4328
4341
  "rank",
4329
4342
  "rescore",
@@ -4412,7 +4425,7 @@ class AsyncElasticsearch(BaseClient):
4412
4425
  ] = None,
4413
4426
  rest_total_hits_as_int: t.Optional[bool] = None,
4414
4427
  retriever: t.Optional[t.Mapping[str, t.Any]] = None,
4415
- routing: t.Optional[str] = None,
4428
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4416
4429
  runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
4417
4430
  script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
4418
4431
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -4744,8 +4757,6 @@ class AsyncElasticsearch(BaseClient):
4744
4757
  __query["preference"] = preference
4745
4758
  if pretty is not None:
4746
4759
  __query["pretty"] = pretty
4747
- if project_routing is not None:
4748
- __query["project_routing"] = project_routing
4749
4760
  if q is not None:
4750
4761
  __query["q"] = q
4751
4762
  if request_cache is not None:
@@ -4805,6 +4816,8 @@ class AsyncElasticsearch(BaseClient):
4805
4816
  __body["post_filter"] = post_filter
4806
4817
  if profile is not None:
4807
4818
  __body["profile"] = profile
4819
+ if project_routing is not None:
4820
+ __body["project_routing"] = project_routing
4808
4821
  if query is not None:
4809
4822
  __body["query"] = query
4810
4823
  if rank is not None:
@@ -5187,11 +5200,19 @@ class AsyncElasticsearch(BaseClient):
5187
5200
 
5188
5201
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-mvt>`_
5189
5202
 
5190
- :param index: Comma-separated list of data streams, indices, or aliases to search
5191
- :param field: Field containing geospatial data to return
5192
- :param zoom: Zoom level for the vector tile to search
5193
- :param x: X coordinate for the vector tile to search
5194
- :param y: Y coordinate for the vector tile to search
5203
+ :param index: A list of indices, data streams, or aliases to search. It supports
5204
+ wildcards (`*`). To search all data streams and indices, omit this parameter
5205
+ or use `*` or `_all`. To search a remote cluster, use the `<cluster>:<target>`
5206
+ syntax.
5207
+ :param field: A field that contains the geospatial data to return. It must be
5208
+ a `geo_point` or `geo_shape` field. The field must have doc values enabled.
5209
+ It cannot be a nested field. NOTE: Vector tiles do not natively support geometry
5210
+ collections. For `geometrycollection` values in a `geo_shape` field, the
5211
+ API returns a hits layer feature for each element of the collection. This
5212
+ behavior may change in a future release.
5213
+ :param zoom: The zoom level of the vector tile to search. It accepts `0` to `29`.
5214
+ :param x: The X coordinate for the vector tile to search.
5215
+ :param y: The Y coordinate for the vector tile to search.
5195
5216
  :param aggs: Sub-aggregations for the geotile_grid. It supports the following
5196
5217
  aggregation types: - `avg` - `boxplot` - `cardinality` - `extended stats`
5197
5218
  - `max` - `median absolute deviation` - `min` - `percentile` - `percentile-rank`
@@ -5353,7 +5374,7 @@ class AsyncElasticsearch(BaseClient):
5353
5374
  master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
5354
5375
  preference: t.Optional[str] = None,
5355
5376
  pretty: t.Optional[bool] = None,
5356
- routing: t.Optional[str] = None,
5377
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
5357
5378
  ) -> ObjectApiResponse[t.Any]:
5358
5379
  """
5359
5380
  .. raw:: html
@@ -5462,7 +5483,7 @@ class AsyncElasticsearch(BaseClient):
5462
5483
  profile: t.Optional[bool] = None,
5463
5484
  project_routing: t.Optional[str] = None,
5464
5485
  rest_total_hits_as_int: t.Optional[bool] = None,
5465
- routing: t.Optional[str] = None,
5486
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
5466
5487
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
5467
5488
  search_type: t.Optional[
5468
5489
  t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
@@ -5599,7 +5620,7 @@ class AsyncElasticsearch(BaseClient):
5599
5620
  async def terms_enum(
5600
5621
  self,
5601
5622
  *,
5602
- index: str,
5623
+ index: t.Union[str, t.Sequence[str]],
5603
5624
  field: t.Optional[str] = None,
5604
5625
  case_insensitive: t.Optional[bool] = None,
5605
5626
  error_trace: t.Optional[bool] = None,
@@ -5725,7 +5746,7 @@ class AsyncElasticsearch(BaseClient):
5725
5746
  preference: t.Optional[str] = None,
5726
5747
  pretty: t.Optional[bool] = None,
5727
5748
  realtime: t.Optional[bool] = None,
5728
- routing: t.Optional[str] = None,
5749
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
5729
5750
  term_statistics: t.Optional[bool] = None,
5730
5751
  version: t.Optional[int] = None,
5731
5752
  version_type: t.Optional[
@@ -5909,7 +5930,7 @@ class AsyncElasticsearch(BaseClient):
5909
5930
  ] = None,
5910
5931
  require_alias: t.Optional[bool] = None,
5911
5932
  retry_on_conflict: t.Optional[int] = None,
5912
- routing: t.Optional[str] = None,
5933
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
5913
5934
  script: t.Optional[t.Mapping[str, t.Any]] = None,
5914
5935
  scripted_upsert: t.Optional[bool] = None,
5915
5936
  source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None,
@@ -6089,7 +6110,7 @@ class AsyncElasticsearch(BaseClient):
6089
6110
  refresh: t.Optional[bool] = None,
6090
6111
  request_cache: t.Optional[bool] = None,
6091
6112
  requests_per_second: t.Optional[float] = None,
6092
- routing: t.Optional[str] = None,
6113
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
6093
6114
  script: t.Optional[t.Mapping[str, t.Any]] = None,
6094
6115
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
6095
6116
  scroll_size: t.Optional[int] = None,
@@ -6114,8 +6135,8 @@ class AsyncElasticsearch(BaseClient):
6114
6135
  """
6115
6136
  .. raw:: html
6116
6137
 
6117
- <p>Update documents.
6118
- Updates documents that match the specified query.
6138
+ <p>Update documents.</p>
6139
+ <p>Updates documents that match the specified query.
6119
6140
  If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes.</p>
6120
6141
  <p>If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:</p>
6121
6142
  <ul>
@@ -6394,11 +6415,11 @@ class AsyncElasticsearch(BaseClient):
6394
6415
  self,
6395
6416
  *,
6396
6417
  task_id: str,
6418
+ requests_per_second: float,
6397
6419
  error_trace: t.Optional[bool] = None,
6398
6420
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
6399
6421
  human: t.Optional[bool] = None,
6400
6422
  pretty: t.Optional[bool] = None,
6401
- requests_per_second: t.Optional[float] = None,
6402
6423
  ) -> ObjectApiResponse[t.Any]:
6403
6424
  """
6404
6425
  .. raw:: html
@@ -6416,9 +6437,13 @@ class AsyncElasticsearch(BaseClient):
6416
6437
  """
6417
6438
  if task_id in SKIP_IN_PATH:
6418
6439
  raise ValueError("Empty value passed for parameter 'task_id'")
6440
+ if requests_per_second is None:
6441
+ raise ValueError("Empty value passed for parameter 'requests_per_second'")
6419
6442
  __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
6420
6443
  __path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle'
6421
6444
  __query: t.Dict[str, t.Any] = {}
6445
+ if requests_per_second is not None:
6446
+ __query["requests_per_second"] = requests_per_second
6422
6447
  if error_trace is not None:
6423
6448
  __query["error_trace"] = error_trace
6424
6449
  if filter_path is not None:
@@ -6427,8 +6452,6 @@ class AsyncElasticsearch(BaseClient):
6427
6452
  __query["human"] = human
6428
6453
  if pretty is not None:
6429
6454
  __query["pretty"] = pretty
6430
- if requests_per_second is not None:
6431
- __query["requests_per_second"] = requests_per_second
6432
6455
  __headers = {"accept": "application/json"}
6433
6456
  return await self.perform_request( # type: ignore[return-value]
6434
6457
  "POST",