elasticsearch 9.2.1__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 (55) hide show
  1. elasticsearch/_async/client/__init__.py +44 -40
  2. elasticsearch/_async/client/async_search.py +4 -3
  3. elasticsearch/_async/client/cat.py +163 -8
  4. elasticsearch/_async/client/cluster.py +66 -34
  5. elasticsearch/_async/client/eql.py +7 -6
  6. elasticsearch/_async/client/esql.py +157 -8
  7. elasticsearch/_async/client/fleet.py +1 -1
  8. elasticsearch/_async/client/graph.py +1 -1
  9. elasticsearch/_async/client/indices.py +436 -17
  10. elasticsearch/_async/client/inference.py +299 -9
  11. elasticsearch/_async/client/ml.py +7 -3
  12. elasticsearch/_async/client/nodes.py +167 -5
  13. elasticsearch/_async/client/project.py +9 -1
  14. elasticsearch/_async/client/security.py +26 -3
  15. elasticsearch/_async/client/snapshot.py +1 -1
  16. elasticsearch/_async/client/sql.py +7 -6
  17. elasticsearch/_async/client/streams.py +0 -1
  18. elasticsearch/_async/client/text_structure.py +3 -3
  19. elasticsearch/_sync/client/__init__.py +44 -40
  20. elasticsearch/_sync/client/async_search.py +4 -3
  21. elasticsearch/_sync/client/cat.py +163 -8
  22. elasticsearch/_sync/client/cluster.py +66 -34
  23. elasticsearch/_sync/client/eql.py +7 -6
  24. elasticsearch/_sync/client/esql.py +157 -8
  25. elasticsearch/_sync/client/fleet.py +1 -1
  26. elasticsearch/_sync/client/graph.py +1 -1
  27. elasticsearch/_sync/client/indices.py +436 -17
  28. elasticsearch/_sync/client/inference.py +299 -9
  29. elasticsearch/_sync/client/ml.py +7 -3
  30. elasticsearch/_sync/client/nodes.py +167 -5
  31. elasticsearch/_sync/client/project.py +9 -1
  32. elasticsearch/_sync/client/project_routing.py +264 -0
  33. elasticsearch/_sync/client/security.py +26 -3
  34. elasticsearch/_sync/client/snapshot.py +1 -1
  35. elasticsearch/_sync/client/sql.py +7 -6
  36. elasticsearch/_sync/client/streams.py +0 -1
  37. elasticsearch/_sync/client/text_structure.py +3 -3
  38. elasticsearch/_version.py +2 -2
  39. elasticsearch/dsl/__init__.py +4 -0
  40. elasticsearch/dsl/aggs.py +6 -6
  41. elasticsearch/dsl/field.py +91 -7
  42. elasticsearch/dsl/query.py +2 -2
  43. elasticsearch/dsl/response/__init__.py +2 -0
  44. elasticsearch/dsl/types.py +66 -7
  45. elasticsearch/dsl/utils.py +11 -2
  46. elasticsearch/esql/functions.py +924 -250
  47. elasticsearch/helpers/__init__.py +2 -0
  48. elasticsearch/helpers/actions.py +21 -0
  49. elasticsearch/helpers/vectorstore/_async/vectorstore.py +3 -0
  50. elasticsearch/helpers/vectorstore/_sync/vectorstore.py +3 -0
  51. {elasticsearch-9.2.1.dist-info → elasticsearch-9.3.0.dist-info}/METADATA +2 -1
  52. {elasticsearch-9.2.1.dist-info → elasticsearch-9.3.0.dist-info}/RECORD +55 -54
  53. {elasticsearch-9.2.1.dist-info → elasticsearch-9.3.0.dist-info}/WHEEL +0 -0
  54. {elasticsearch-9.2.1.dist-info → elasticsearch-9.3.0.dist-info}/licenses/LICENSE +0 -0
  55. {elasticsearch-9.2.1.dist-info → elasticsearch-9.3.0.dist-info}/licenses/NOTICE +0 -0
@@ -38,6 +38,7 @@ class ProjectClient(NamespacedClient):
38
38
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
39
39
  human: t.Optional[bool] = None,
40
40
  pretty: t.Optional[bool] = None,
41
+ project_routing: t.Optional[str] = None,
41
42
  ) -> ObjectApiResponse[t.Any]:
42
43
  """
43
44
  .. raw:: html
@@ -45,6 +46,11 @@ class ProjectClient(NamespacedClient):
45
46
  <p>Get tags.</p>
46
47
  <p>Get the tags that are defined for the project.</p>
47
48
 
49
+
50
+ `<https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-project-tags>`_
51
+
52
+ :param project_routing: A Lucene query using project metadata tags used to filter
53
+ which projects are returned in the response, such as _alias:_origin or _alias:*pr*.
48
54
  """
49
55
  __path_parts: t.Dict[str, str] = {}
50
56
  __path = "/_project/tags"
@@ -57,9 +63,11 @@ class ProjectClient(NamespacedClient):
57
63
  __query["human"] = human
58
64
  if pretty is not None:
59
65
  __query["pretty"] = pretty
66
+ if project_routing is not None:
67
+ __query["project_routing"] = project_routing
60
68
  __headers = {"accept": "application/json"}
61
69
  return await self.perform_request( # type: ignore[return-value]
62
- "GET",
70
+ "POST",
63
71
  __path,
64
72
  params=__query,
65
73
  headers=__headers,
@@ -477,7 +477,7 @@ class SecurityClient(NamespacedClient):
477
477
  async def clear_cached_privileges(
478
478
  self,
479
479
  *,
480
- application: str,
480
+ application: t.Union[str, t.Sequence[str]],
481
481
  error_trace: t.Optional[bool] = None,
482
482
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
483
483
  human: t.Optional[bool] = None,
@@ -775,13 +775,20 @@ class SecurityClient(NamespacedClient):
775
775
  )
776
776
 
777
777
  @_rewrite_parameters(
778
- body_fields=("access", "name", "expiration", "metadata"),
778
+ body_fields=(
779
+ "access",
780
+ "name",
781
+ "certificate_identity",
782
+ "expiration",
783
+ "metadata",
784
+ ),
779
785
  )
780
786
  async def create_cross_cluster_api_key(
781
787
  self,
782
788
  *,
783
789
  access: t.Optional[t.Mapping[str, t.Any]] = None,
784
790
  name: t.Optional[str] = None,
791
+ certificate_identity: t.Optional[str] = None,
785
792
  error_trace: t.Optional[bool] = None,
786
793
  expiration: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
787
794
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -814,6 +821,10 @@ class SecurityClient(NamespacedClient):
814
821
  automatically converts the access specification to a role descriptor which
815
822
  has relevant privileges assigned accordingly.
816
823
  :param name: Specifies the name for this API key.
824
+ :param certificate_identity: The certificate identity to associate with this
825
+ API key. This field is used to restrict the API key to connections authenticated
826
+ by a specific TLS certificate. The value should match the certificate's distinguished
827
+ name (DN) pattern.
817
828
  :param expiration: Expiration time for the API key. By default, API keys never
818
829
  expire.
819
830
  :param metadata: Arbitrary metadata that you want to associate with the API key.
@@ -841,6 +852,8 @@ class SecurityClient(NamespacedClient):
841
852
  __body["access"] = access
842
853
  if name is not None:
843
854
  __body["name"] = name
855
+ if certificate_identity is not None:
856
+ __body["certificate_identity"] = certificate_identity
844
857
  if expiration is not None:
845
858
  __body["expiration"] = expiration
846
859
  if metadata is not None:
@@ -4474,13 +4487,14 @@ class SecurityClient(NamespacedClient):
4474
4487
  )
4475
4488
 
4476
4489
  @_rewrite_parameters(
4477
- body_fields=("access", "expiration", "metadata"),
4490
+ body_fields=("access", "certificate_identity", "expiration", "metadata"),
4478
4491
  )
4479
4492
  async def update_cross_cluster_api_key(
4480
4493
  self,
4481
4494
  *,
4482
4495
  id: str,
4483
4496
  access: t.Optional[t.Mapping[str, t.Any]] = None,
4497
+ certificate_identity: t.Optional[str] = None,
4484
4498
  error_trace: t.Optional[bool] = None,
4485
4499
  expiration: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4486
4500
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -4513,6 +4527,13 @@ class SecurityClient(NamespacedClient):
4513
4527
  of permissions for cross cluster search and cross cluster replication. At
4514
4528
  least one of them must be specified. When specified, the new access assignment
4515
4529
  fully replaces the previously assigned access.
4530
+ :param certificate_identity: The certificate identity to associate with this
4531
+ API key. This field is used to restrict the API key to connections authenticated
4532
+ by a specific TLS certificate. The value should match the certificate's distinguished
4533
+ name (DN) pattern. When specified, this fully replaces any previously assigned
4534
+ certificate identity. To clear an existing certificate identity, explicitly
4535
+ set this field to `null`. When omitted, the existing certificate identity
4536
+ remains unchanged.
4516
4537
  :param expiration: The expiration time for the API key. By default, API keys
4517
4538
  never expire. This property can be omitted to leave the value unchanged.
4518
4539
  :param metadata: Arbitrary metadata that you want to associate with the API key.
@@ -4539,6 +4560,8 @@ class SecurityClient(NamespacedClient):
4539
4560
  if not __body:
4540
4561
  if access is not None:
4541
4562
  __body["access"] = access
4563
+ if certificate_identity is not None:
4564
+ __body["certificate_identity"] = certificate_identity
4542
4565
  if expiration is not None:
4543
4566
  __body["expiration"] = expiration
4544
4567
  if metadata is not None:
@@ -397,7 +397,7 @@ class SnapshotClient(NamespacedClient):
397
397
  self,
398
398
  *,
399
399
  repository: str,
400
- snapshot: str,
400
+ snapshot: t.Union[str, t.Sequence[str]],
401
401
  error_trace: t.Optional[bool] = None,
402
402
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
403
403
  human: t.Optional[bool] = None,
@@ -253,6 +253,7 @@ class SqlClient(NamespacedClient):
253
253
  "keep_on_completion",
254
254
  "page_timeout",
255
255
  "params",
256
+ "project_routing",
256
257
  "query",
257
258
  "request_timeout",
258
259
  "runtime_mappings",
@@ -333,10 +334,10 @@ class SqlClient(NamespacedClient):
333
334
  is no longer available. Subsequent scroll requests prolong the lifetime of
334
335
  the scroll cursor by the duration of `page_timeout` in the scroll request.
335
336
  :param params: The values for parameters in the query.
336
- :param project_routing: Specifies a subset of projects to target for the search
337
- using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
338
- queries: the _alias tag and a single value (possibly wildcarded). Examples:
339
- _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
337
+ :param project_routing: Specifies a subset of projects to target using project
338
+ metadata tags in a subset of Lucene query syntax. Allowed Lucene queries:
339
+ the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project
340
+ _alias:_origin _alias:*pr* Supported in serverless only.
340
341
  :param query: The SQL query to run.
341
342
  :param request_timeout: The timeout before the request fails.
342
343
  :param runtime_mappings: One or more runtime fields for the search request. These
@@ -362,8 +363,6 @@ class SqlClient(NamespacedClient):
362
363
  __query["human"] = human
363
364
  if pretty is not None:
364
365
  __query["pretty"] = pretty
365
- if project_routing is not None:
366
- __query["project_routing"] = project_routing
367
366
  if not __body:
368
367
  if allow_partial_search_results is not None:
369
368
  __body["allow_partial_search_results"] = allow_partial_search_results
@@ -389,6 +388,8 @@ class SqlClient(NamespacedClient):
389
388
  __body["page_timeout"] = page_timeout
390
389
  if params is not None:
391
390
  __body["params"] = params
391
+ if project_routing is not None:
392
+ __body["project_routing"] = project_routing
392
393
  if query is not None:
393
394
  __body["query"] = query
394
395
  if request_timeout is not None:
@@ -15,7 +15,6 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
-
19
18
  import typing as t
20
19
 
21
20
  from elastic_transport import ObjectApiResponse, TextApiResponse
@@ -31,7 +31,7 @@ class TextStructureClient(NamespacedClient):
31
31
  *,
32
32
  field: str,
33
33
  index: str,
34
- column_names: t.Optional[str] = None,
34
+ column_names: t.Optional[t.Union[str, t.Sequence[str]]] = None,
35
35
  delimiter: t.Optional[str] = None,
36
36
  documents_to_sample: t.Optional[int] = None,
37
37
  ecs_compatibility: t.Optional[t.Union[str, t.Literal["disabled", "v1"]]] = None,
@@ -217,7 +217,7 @@ class TextStructureClient(NamespacedClient):
217
217
  self,
218
218
  *,
219
219
  messages: t.Optional[t.Sequence[str]] = None,
220
- column_names: t.Optional[str] = None,
220
+ column_names: t.Optional[t.Union[str, t.Sequence[str]]] = None,
221
221
  delimiter: t.Optional[str] = None,
222
222
  ecs_compatibility: t.Optional[t.Union[str, t.Literal["disabled", "v1"]]] = None,
223
223
  error_trace: t.Optional[bool] = None,
@@ -398,7 +398,7 @@ class TextStructureClient(NamespacedClient):
398
398
  text_files: t.Optional[t.Sequence[t.Any]] = None,
399
399
  body: t.Optional[t.Sequence[t.Any]] = None,
400
400
  charset: t.Optional[str] = None,
401
- column_names: t.Optional[str] = None,
401
+ column_names: t.Optional[t.Union[str, t.Sequence[str]]] = None,
402
402
  delimiter: t.Optional[str] = None,
403
403
  ecs_compatibility: t.Optional[str] = None,
404
404
  explain: t.Optional[bool] = None,
@@ -555,7 +555,7 @@ class Elasticsearch(BaseClient):
555
555
  ] = None,
556
556
  require_alias: t.Optional[bool] = None,
557
557
  require_data_stream: t.Optional[bool] = None,
558
- routing: t.Optional[str] = None,
558
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
559
559
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
560
560
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
561
561
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -868,7 +868,7 @@ class Elasticsearch(BaseClient):
868
868
  )
869
869
 
870
870
  @_rewrite_parameters(
871
- body_fields=("query",),
871
+ body_fields=("project_routing", "query"),
872
872
  )
873
873
  def count(
874
874
  self,
@@ -899,7 +899,7 @@ class Elasticsearch(BaseClient):
899
899
  project_routing: t.Optional[str] = None,
900
900
  q: t.Optional[str] = None,
901
901
  query: t.Optional[t.Mapping[str, t.Any]] = None,
902
- routing: t.Optional[str] = None,
902
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
903
903
  terminate_after: t.Optional[int] = None,
904
904
  body: t.Optional[t.Dict[str, t.Any]] = None,
905
905
  ) -> ObjectApiResponse[t.Any]:
@@ -951,10 +951,10 @@ class Elasticsearch(BaseClient):
951
951
  in the result.
952
952
  :param preference: The node or shard the operation should be performed on. By
953
953
  default, it is random.
954
- :param project_routing: Specifies a subset of projects to target for the search
955
- using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
956
- queries: the _alias tag and a single value (possibly wildcarded). Examples:
957
- _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.
958
958
  :param q: The query in Lucene query string syntax. This parameter cannot be used
959
959
  with a request body.
960
960
  :param query: Defines the search query using Query DSL. A request body query
@@ -1007,8 +1007,6 @@ class Elasticsearch(BaseClient):
1007
1007
  __query["preference"] = preference
1008
1008
  if pretty is not None:
1009
1009
  __query["pretty"] = pretty
1010
- if project_routing is not None:
1011
- __query["project_routing"] = project_routing
1012
1010
  if q is not None:
1013
1011
  __query["q"] = q
1014
1012
  if routing is not None:
@@ -1016,6 +1014,8 @@ class Elasticsearch(BaseClient):
1016
1014
  if terminate_after is not None:
1017
1015
  __query["terminate_after"] = terminate_after
1018
1016
  if not __body:
1017
+ if project_routing is not None:
1018
+ __body["project_routing"] = project_routing
1019
1019
  if query is not None:
1020
1020
  __body["query"] = query
1021
1021
  if not __body:
@@ -1054,7 +1054,7 @@ class Elasticsearch(BaseClient):
1054
1054
  ] = None,
1055
1055
  require_alias: t.Optional[bool] = None,
1056
1056
  require_data_stream: t.Optional[bool] = None,
1057
- routing: t.Optional[str] = None,
1057
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1058
1058
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1059
1059
  version: t.Optional[int] = None,
1060
1060
  version_type: t.Optional[
@@ -1233,7 +1233,7 @@ class Elasticsearch(BaseClient):
1233
1233
  refresh: t.Optional[
1234
1234
  t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
1235
1235
  ] = None,
1236
- routing: t.Optional[str] = None,
1236
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1237
1237
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1238
1238
  version: t.Optional[int] = None,
1239
1239
  version_type: t.Optional[
@@ -1376,7 +1376,7 @@ class Elasticsearch(BaseClient):
1376
1376
  refresh: t.Optional[bool] = None,
1377
1377
  request_cache: t.Optional[bool] = None,
1378
1378
  requests_per_second: t.Optional[float] = None,
1379
- routing: t.Optional[str] = None,
1379
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1380
1380
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1381
1381
  scroll_size: t.Optional[int] = None,
1382
1382
  search_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -1772,7 +1772,7 @@ class Elasticsearch(BaseClient):
1772
1772
  pretty: t.Optional[bool] = None,
1773
1773
  realtime: t.Optional[bool] = None,
1774
1774
  refresh: t.Optional[bool] = None,
1775
- routing: t.Optional[str] = None,
1775
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1776
1776
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
1777
1777
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1778
1778
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -1902,7 +1902,7 @@ class Elasticsearch(BaseClient):
1902
1902
  pretty: t.Optional[bool] = None,
1903
1903
  realtime: t.Optional[bool] = None,
1904
1904
  refresh: t.Optional[bool] = None,
1905
- routing: t.Optional[str] = None,
1905
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1906
1906
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
1907
1907
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1908
1908
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -2013,7 +2013,7 @@ class Elasticsearch(BaseClient):
2013
2013
  pretty: t.Optional[bool] = None,
2014
2014
  q: t.Optional[str] = None,
2015
2015
  query: t.Optional[t.Mapping[str, t.Any]] = None,
2016
- routing: t.Optional[str] = None,
2016
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2017
2017
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
2018
2018
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2019
2019
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -2124,7 +2124,7 @@ class Elasticsearch(BaseClient):
2124
2124
  )
2125
2125
 
2126
2126
  @_rewrite_parameters(
2127
- body_fields=("fields", "index_filter", "runtime_mappings"),
2127
+ body_fields=("fields", "index_filter", "project_routing", "runtime_mappings"),
2128
2128
  )
2129
2129
  def field_caps(
2130
2130
  self,
@@ -2142,7 +2142,7 @@ class Elasticsearch(BaseClient):
2142
2142
  ] = None,
2143
2143
  fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2144
2144
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2145
- filters: t.Optional[str] = None,
2145
+ filters: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2146
2146
  human: t.Optional[bool] = None,
2147
2147
  ignore_unavailable: t.Optional[bool] = None,
2148
2148
  include_empty_fields: t.Optional[bool] = None,
@@ -2235,8 +2235,6 @@ class Elasticsearch(BaseClient):
2235
2235
  __query["include_unmapped"] = include_unmapped
2236
2236
  if pretty is not None:
2237
2237
  __query["pretty"] = pretty
2238
- if project_routing is not None:
2239
- __query["project_routing"] = project_routing
2240
2238
  if types is not None:
2241
2239
  __query["types"] = types
2242
2240
  if not __body:
@@ -2244,6 +2242,8 @@ class Elasticsearch(BaseClient):
2244
2242
  __body["fields"] = fields
2245
2243
  if index_filter is not None:
2246
2244
  __body["index_filter"] = index_filter
2245
+ if project_routing is not None:
2246
+ __body["project_routing"] = project_routing
2247
2247
  if runtime_mappings is not None:
2248
2248
  __body["runtime_mappings"] = runtime_mappings
2249
2249
  if not __body:
@@ -2282,7 +2282,7 @@ class Elasticsearch(BaseClient):
2282
2282
  pretty: t.Optional[bool] = None,
2283
2283
  realtime: t.Optional[bool] = None,
2284
2284
  refresh: t.Optional[bool] = None,
2285
- routing: t.Optional[str] = None,
2285
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2286
2286
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
2287
2287
  source_exclude_vectors: t.Optional[bool] = None,
2288
2288
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -2574,7 +2574,7 @@ class Elasticsearch(BaseClient):
2574
2574
  pretty: t.Optional[bool] = None,
2575
2575
  realtime: t.Optional[bool] = None,
2576
2576
  refresh: t.Optional[bool] = None,
2577
- routing: t.Optional[str] = None,
2577
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2578
2578
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
2579
2579
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2580
2580
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -2756,7 +2756,7 @@ class Elasticsearch(BaseClient):
2756
2756
  ] = None,
2757
2757
  require_alias: t.Optional[bool] = None,
2758
2758
  require_data_stream: t.Optional[bool] = None,
2759
- routing: t.Optional[str] = None,
2759
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2760
2760
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2761
2761
  version: t.Optional[int] = None,
2762
2762
  version_type: t.Optional[
@@ -3038,7 +3038,7 @@ class Elasticsearch(BaseClient):
3038
3038
  pretty: t.Optional[bool] = None,
3039
3039
  realtime: t.Optional[bool] = None,
3040
3040
  refresh: t.Optional[bool] = None,
3041
- routing: t.Optional[str] = None,
3041
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3042
3042
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
3043
3043
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3044
3044
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -3175,7 +3175,7 @@ class Elasticsearch(BaseClient):
3175
3175
  pretty: t.Optional[bool] = None,
3176
3176
  project_routing: t.Optional[str] = None,
3177
3177
  rest_total_hits_as_int: t.Optional[bool] = None,
3178
- routing: t.Optional[str] = None,
3178
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3179
3179
  search_type: t.Optional[
3180
3180
  t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
3181
3181
  ] = None,
@@ -3441,7 +3441,7 @@ class Elasticsearch(BaseClient):
3441
3441
  preference: t.Optional[str] = None,
3442
3442
  pretty: t.Optional[bool] = None,
3443
3443
  realtime: t.Optional[bool] = None,
3444
- routing: t.Optional[str] = None,
3444
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3445
3445
  term_statistics: t.Optional[bool] = None,
3446
3446
  version: t.Optional[int] = None,
3447
3447
  version_type: t.Optional[
@@ -3546,7 +3546,7 @@ class Elasticsearch(BaseClient):
3546
3546
  )
3547
3547
 
3548
3548
  @_rewrite_parameters(
3549
- body_fields=("index_filter",),
3549
+ body_fields=("index_filter", "project_routing"),
3550
3550
  )
3551
3551
  def open_point_in_time(
3552
3552
  self,
@@ -3571,7 +3571,7 @@ class Elasticsearch(BaseClient):
3571
3571
  preference: t.Optional[str] = None,
3572
3572
  pretty: t.Optional[bool] = None,
3573
3573
  project_routing: t.Optional[str] = None,
3574
- routing: t.Optional[str] = None,
3574
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3575
3575
  body: t.Optional[t.Dict[str, t.Any]] = None,
3576
3576
  ) -> ObjectApiResponse[t.Any]:
3577
3577
  """
@@ -3663,13 +3663,13 @@ class Elasticsearch(BaseClient):
3663
3663
  __query["preference"] = preference
3664
3664
  if pretty is not None:
3665
3665
  __query["pretty"] = pretty
3666
- if project_routing is not None:
3667
- __query["project_routing"] = project_routing
3668
3666
  if routing is not None:
3669
3667
  __query["routing"] = routing
3670
3668
  if not __body:
3671
3669
  if index_filter is not None:
3672
3670
  __body["index_filter"] = index_filter
3671
+ if project_routing is not None:
3672
+ __body["project_routing"] = project_routing
3673
3673
  if not __body:
3674
3674
  __body = None # type: ignore[assignment]
3675
3675
  __headers = {"accept": "application/json"}
@@ -3789,7 +3789,9 @@ class Elasticsearch(BaseClient):
3789
3789
  ignore_unavailable: t.Optional[bool] = None,
3790
3790
  metric: t.Optional[t.Mapping[str, t.Any]] = None,
3791
3791
  pretty: t.Optional[bool] = None,
3792
- 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,
3793
3795
  body: t.Optional[t.Dict[str, t.Any]] = None,
3794
3796
  ) -> ObjectApiResponse[t.Any]:
3795
3797
  """
@@ -3909,7 +3911,8 @@ class Elasticsearch(BaseClient):
3909
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>
3910
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>
3911
3913
  </ul>
3912
- <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.
3913
3916
  Automatic data stream creation requires a matching index template with data stream enabled.</p>
3914
3917
  <p>The <code>dest</code> element can be configured like the index API to control optimistic concurrency control.
3915
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>
@@ -4333,6 +4336,7 @@ class Elasticsearch(BaseClient):
4333
4336
  "pit",
4334
4337
  "post_filter",
4335
4338
  "profile",
4339
+ "project_routing",
4336
4340
  "query",
4337
4341
  "rank",
4338
4342
  "rescore",
@@ -4421,7 +4425,7 @@ class Elasticsearch(BaseClient):
4421
4425
  ] = None,
4422
4426
  rest_total_hits_as_int: t.Optional[bool] = None,
4423
4427
  retriever: t.Optional[t.Mapping[str, t.Any]] = None,
4424
- routing: t.Optional[str] = None,
4428
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4425
4429
  runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
4426
4430
  script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
4427
4431
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -4753,8 +4757,6 @@ class Elasticsearch(BaseClient):
4753
4757
  __query["preference"] = preference
4754
4758
  if pretty is not None:
4755
4759
  __query["pretty"] = pretty
4756
- if project_routing is not None:
4757
- __query["project_routing"] = project_routing
4758
4760
  if q is not None:
4759
4761
  __query["q"] = q
4760
4762
  if request_cache is not None:
@@ -4814,6 +4816,8 @@ class Elasticsearch(BaseClient):
4814
4816
  __body["post_filter"] = post_filter
4815
4817
  if profile is not None:
4816
4818
  __body["profile"] = profile
4819
+ if project_routing is not None:
4820
+ __body["project_routing"] = project_routing
4817
4821
  if query is not None:
4818
4822
  __body["query"] = query
4819
4823
  if rank is not None:
@@ -5370,7 +5374,7 @@ class Elasticsearch(BaseClient):
5370
5374
  master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
5371
5375
  preference: t.Optional[str] = None,
5372
5376
  pretty: t.Optional[bool] = None,
5373
- routing: t.Optional[str] = None,
5377
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
5374
5378
  ) -> ObjectApiResponse[t.Any]:
5375
5379
  """
5376
5380
  .. raw:: html
@@ -5479,7 +5483,7 @@ class Elasticsearch(BaseClient):
5479
5483
  profile: t.Optional[bool] = None,
5480
5484
  project_routing: t.Optional[str] = None,
5481
5485
  rest_total_hits_as_int: t.Optional[bool] = None,
5482
- routing: t.Optional[str] = None,
5486
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
5483
5487
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
5484
5488
  search_type: t.Optional[
5485
5489
  t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
@@ -5616,7 +5620,7 @@ class Elasticsearch(BaseClient):
5616
5620
  def terms_enum(
5617
5621
  self,
5618
5622
  *,
5619
- index: str,
5623
+ index: t.Union[str, t.Sequence[str]],
5620
5624
  field: t.Optional[str] = None,
5621
5625
  case_insensitive: t.Optional[bool] = None,
5622
5626
  error_trace: t.Optional[bool] = None,
@@ -5742,7 +5746,7 @@ class Elasticsearch(BaseClient):
5742
5746
  preference: t.Optional[str] = None,
5743
5747
  pretty: t.Optional[bool] = None,
5744
5748
  realtime: t.Optional[bool] = None,
5745
- routing: t.Optional[str] = None,
5749
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
5746
5750
  term_statistics: t.Optional[bool] = None,
5747
5751
  version: t.Optional[int] = None,
5748
5752
  version_type: t.Optional[
@@ -5926,7 +5930,7 @@ class Elasticsearch(BaseClient):
5926
5930
  ] = None,
5927
5931
  require_alias: t.Optional[bool] = None,
5928
5932
  retry_on_conflict: t.Optional[int] = None,
5929
- routing: t.Optional[str] = None,
5933
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
5930
5934
  script: t.Optional[t.Mapping[str, t.Any]] = None,
5931
5935
  scripted_upsert: t.Optional[bool] = None,
5932
5936
  source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None,
@@ -6106,7 +6110,7 @@ class Elasticsearch(BaseClient):
6106
6110
  refresh: t.Optional[bool] = None,
6107
6111
  request_cache: t.Optional[bool] = None,
6108
6112
  requests_per_second: t.Optional[float] = None,
6109
- routing: t.Optional[str] = None,
6113
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
6110
6114
  script: t.Optional[t.Mapping[str, t.Any]] = None,
6111
6115
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
6112
6116
  scroll_size: t.Optional[int] = None,
@@ -213,6 +213,7 @@ class AsyncSearchClient(NamespacedClient):
213
213
  "pit",
214
214
  "post_filter",
215
215
  "profile",
216
+ "project_routing",
216
217
  "query",
217
218
  "rescore",
218
219
  "runtime_mappings",
@@ -295,7 +296,7 @@ class AsyncSearchClient(NamespacedClient):
295
296
  t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
296
297
  ] = None,
297
298
  rest_total_hits_as_int: t.Optional[bool] = None,
298
- routing: t.Optional[str] = None,
299
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
299
300
  runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
300
301
  script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
301
302
  search_after: t.Optional[
@@ -533,8 +534,6 @@ class AsyncSearchClient(NamespacedClient):
533
534
  __query["preference"] = preference
534
535
  if pretty is not None:
535
536
  __query["pretty"] = pretty
536
- if project_routing is not None:
537
- __query["project_routing"] = project_routing
538
537
  if q is not None:
539
538
  __query["q"] = q
540
539
  if request_cache is not None:
@@ -592,6 +591,8 @@ class AsyncSearchClient(NamespacedClient):
592
591
  __body["post_filter"] = post_filter
593
592
  if profile is not None:
594
593
  __body["profile"] = profile
594
+ if project_routing is not None:
595
+ __body["project_routing"] = project_routing
595
596
  if query is not None:
596
597
  __body["query"] = query
597
598
  if rescore is not None: