elasticsearch 9.1.3__py3-none-any.whl → 9.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. elasticsearch/_async/client/__init__.py +91 -24
  2. elasticsearch/_async/client/async_search.py +7 -0
  3. elasticsearch/_async/client/autoscaling.py +7 -0
  4. elasticsearch/_async/client/cat.py +8 -1
  5. elasticsearch/_async/client/cluster.py +7 -7
  6. elasticsearch/_async/client/eql.py +7 -0
  7. elasticsearch/_async/client/esql.py +26 -3
  8. elasticsearch/_async/client/indices.py +153 -7
  9. elasticsearch/_async/client/inference.py +315 -42
  10. elasticsearch/_async/client/ingest.py +8 -0
  11. elasticsearch/_async/client/license.py +4 -2
  12. elasticsearch/_async/client/ml.py +2 -2
  13. elasticsearch/_async/client/nodes.py +2 -4
  14. elasticsearch/_async/client/project.py +68 -0
  15. elasticsearch/_async/client/security.py +39 -0
  16. elasticsearch/_async/client/shutdown.py +6 -0
  17. elasticsearch/_async/client/simulate.py +8 -0
  18. elasticsearch/_async/client/snapshot.py +20 -10
  19. elasticsearch/_async/client/sql.py +7 -0
  20. elasticsearch/_async/client/streams.py +2 -3
  21. elasticsearch/_async/helpers.py +28 -15
  22. elasticsearch/_sync/client/__init__.py +91 -24
  23. elasticsearch/_sync/client/async_search.py +7 -0
  24. elasticsearch/_sync/client/autoscaling.py +7 -0
  25. elasticsearch/_sync/client/cat.py +8 -1
  26. elasticsearch/_sync/client/cluster.py +7 -7
  27. elasticsearch/_sync/client/eql.py +7 -0
  28. elasticsearch/_sync/client/esql.py +26 -3
  29. elasticsearch/_sync/client/indices.py +153 -7
  30. elasticsearch/_sync/client/inference.py +315 -42
  31. elasticsearch/_sync/client/ingest.py +8 -0
  32. elasticsearch/_sync/client/license.py +4 -2
  33. elasticsearch/_sync/client/ml.py +2 -2
  34. elasticsearch/_sync/client/nodes.py +2 -4
  35. elasticsearch/_sync/client/project.py +68 -0
  36. elasticsearch/_sync/client/security.py +39 -0
  37. elasticsearch/_sync/client/shutdown.py +6 -0
  38. elasticsearch/_sync/client/simulate.py +8 -0
  39. elasticsearch/_sync/client/snapshot.py +20 -10
  40. elasticsearch/_sync/client/sql.py +7 -0
  41. elasticsearch/_sync/client/streams.py +2 -3
  42. elasticsearch/_version.py +2 -2
  43. elasticsearch/client.py +2 -0
  44. elasticsearch/compat.py +2 -15
  45. elasticsearch/dsl/_async/document.py +2 -1
  46. elasticsearch/dsl/_sync/document.py +2 -1
  47. elasticsearch/dsl/document_base.py +38 -13
  48. elasticsearch/dsl/field.py +8 -0
  49. elasticsearch/dsl/pydantic.py +152 -0
  50. elasticsearch/dsl/query.py +5 -1
  51. elasticsearch/dsl/search_base.py +5 -1
  52. elasticsearch/dsl/types.py +37 -9
  53. elasticsearch/esql/esql.py +331 -41
  54. elasticsearch/esql/functions.py +88 -0
  55. elasticsearch/helpers/actions.py +1 -1
  56. {elasticsearch-9.1.3.dist-info → elasticsearch-9.2.1.dist-info}/METADATA +26 -4
  57. {elasticsearch-9.1.3.dist-info → elasticsearch-9.2.1.dist-info}/RECORD +60 -57
  58. {elasticsearch-9.1.3.dist-info → elasticsearch-9.2.1.dist-info}/WHEEL +0 -0
  59. {elasticsearch-9.1.3.dist-info → elasticsearch-9.2.1.dist-info}/licenses/LICENSE +0 -0
  60. {elasticsearch-9.1.3.dist-info → elasticsearch-9.2.1.dist-info}/licenses/NOTICE +0 -0
@@ -63,6 +63,7 @@ from .migration import MigrationClient
63
63
  from .ml import MlClient
64
64
  from .monitoring import MonitoringClient
65
65
  from .nodes import NodesClient
66
+ from .project import ProjectClient
66
67
  from .query_rules import QueryRulesClient
67
68
  from .rollup import RollupClient
68
69
  from .search_application import SearchApplicationClient
@@ -369,6 +370,7 @@ class AsyncElasticsearch(BaseClient):
369
370
  self.migration = MigrationClient(self)
370
371
  self.ml = MlClient(self)
371
372
  self.monitoring = MonitoringClient(self)
373
+ self.project = ProjectClient(self)
372
374
  self.query_rules = QueryRulesClient(self)
373
375
  self.rollup = RollupClient(self)
374
376
  self.search_application = SearchApplicationClient(self)
@@ -614,6 +616,7 @@ class AsyncElasticsearch(BaseClient):
614
616
  <li>Perl: Check out <code>Search::Elasticsearch::Client::5_0::Bulk</code> and <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
615
617
  <li>Python: Check out <code>elasticsearch.helpers.*</code></li>
616
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>
617
620
  <li>.NET: Check out <code>BulkAllObservable</code></li>
618
621
  <li>PHP: Check out bulk indexing.</li>
619
622
  <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
@@ -893,6 +896,7 @@ class AsyncElasticsearch(BaseClient):
893
896
  min_score: t.Optional[float] = None,
894
897
  preference: t.Optional[str] = None,
895
898
  pretty: t.Optional[bool] = None,
899
+ project_routing: t.Optional[str] = None,
896
900
  q: t.Optional[str] = None,
897
901
  query: t.Optional[t.Mapping[str, t.Any]] = None,
898
902
  routing: t.Optional[str] = None,
@@ -926,8 +930,8 @@ class AsyncElasticsearch(BaseClient):
926
930
  This parameter can be used only when the `q` query string parameter is specified.
927
931
  :param analyzer: The analyzer to use for the query string. This parameter can
928
932
  be used only when the `q` query string parameter is specified.
929
- :param default_operator: The default operator for query string query: `AND` or
930
- `OR`. This parameter can be used only when the `q` query string parameter
933
+ :param default_operator: The default operator for query string query: `and` or
934
+ `or`. This parameter can be used only when the `q` query string parameter
931
935
  is specified.
932
936
  :param df: The field to use as a default when no field prefix is given in the
933
937
  query string. This parameter can be used only when the `q` query string parameter
@@ -947,6 +951,10 @@ class AsyncElasticsearch(BaseClient):
947
951
  in the result.
948
952
  :param preference: The node or shard the operation should be performed on. By
949
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.
950
958
  :param q: The query in Lucene query string syntax. This parameter cannot be used
951
959
  with a request body.
952
960
  :param query: Defines the search query using Query DSL. A request body query
@@ -999,6 +1007,8 @@ class AsyncElasticsearch(BaseClient):
999
1007
  __query["preference"] = preference
1000
1008
  if pretty is not None:
1001
1009
  __query["pretty"] = pretty
1010
+ if project_routing is not None:
1011
+ __query["project_routing"] = project_routing
1002
1012
  if q is not None:
1003
1013
  __query["q"] = q
1004
1014
  if routing is not None:
@@ -1048,7 +1058,7 @@ class AsyncElasticsearch(BaseClient):
1048
1058
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1049
1059
  version: t.Optional[int] = None,
1050
1060
  version_type: t.Optional[
1051
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
1061
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
1052
1062
  ] = None,
1053
1063
  wait_for_active_shards: t.Optional[
1054
1064
  t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
@@ -1227,7 +1237,7 @@ class AsyncElasticsearch(BaseClient):
1227
1237
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1228
1238
  version: t.Optional[int] = None,
1229
1239
  version_type: t.Optional[
1230
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
1240
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
1231
1241
  ] = None,
1232
1242
  wait_for_active_shards: t.Optional[
1233
1243
  t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
@@ -1472,8 +1482,8 @@ class AsyncElasticsearch(BaseClient):
1472
1482
  used only when the `q` query string parameter is specified.
1473
1483
  :param conflicts: What to do if delete by query hits version conflicts: `abort`
1474
1484
  or `proceed`.
1475
- :param default_operator: The default operator for query string query: `AND` or
1476
- `OR`. This parameter can be used only when the `q` query string parameter
1485
+ :param default_operator: The default operator for query string query: `and` or
1486
+ `or`. This parameter can be used only when the `q` query string parameter
1477
1487
  is specified.
1478
1488
  :param df: The field to use as default where no field prefix is given in the
1479
1489
  query string. This parameter can be used only when the `q` query string parameter
@@ -1769,7 +1779,7 @@ class AsyncElasticsearch(BaseClient):
1769
1779
  stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1770
1780
  version: t.Optional[int] = None,
1771
1781
  version_type: t.Optional[
1772
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
1782
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
1773
1783
  ] = None,
1774
1784
  ) -> HeadApiResponse:
1775
1785
  """
@@ -1898,7 +1908,7 @@ class AsyncElasticsearch(BaseClient):
1898
1908
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1899
1909
  version: t.Optional[int] = None,
1900
1910
  version_type: t.Optional[
1901
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
1911
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
1902
1912
  ] = None,
1903
1913
  ) -> HeadApiResponse:
1904
1914
  """
@@ -2027,8 +2037,8 @@ class AsyncElasticsearch(BaseClient):
2027
2037
  This parameter can be used only when the `q` query string parameter is specified.
2028
2038
  :param analyzer: The analyzer to use for the query string. This parameter can
2029
2039
  be used only when the `q` query string parameter is specified.
2030
- :param default_operator: The default operator for query string query: `AND` or
2031
- `OR`. This parameter can be used only when the `q` query string parameter
2040
+ :param default_operator: The default operator for query string query: `and` or
2041
+ `or`. This parameter can be used only when the `q` query string parameter
2032
2042
  is specified.
2033
2043
  :param df: The field to use as default where no field prefix is given in the
2034
2044
  query string. This parameter can be used only when the `q` query string parameter
@@ -2139,6 +2149,7 @@ class AsyncElasticsearch(BaseClient):
2139
2149
  include_unmapped: t.Optional[bool] = None,
2140
2150
  index_filter: t.Optional[t.Mapping[str, t.Any]] = None,
2141
2151
  pretty: t.Optional[bool] = None,
2152
+ project_routing: t.Optional[str] = None,
2142
2153
  runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
2143
2154
  types: t.Optional[t.Sequence[str]] = None,
2144
2155
  body: t.Optional[t.Dict[str, t.Any]] = None,
@@ -2182,6 +2193,11 @@ class AsyncElasticsearch(BaseClient):
2182
2193
  deleted documents) are outside of the provided range. However, not all queries
2183
2194
  can rewrite to `match_none` so this API may return an index even if the provided
2184
2195
  filter matches no document.
2196
+ :param project_routing: Specifies a subset of projects to target for the field-caps
2197
+ query using project metadata tags in a subset of Lucene query syntax. Allowed
2198
+ Lucene queries: the _alias tag and a single value (possibly wildcarded).
2199
+ Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless
2200
+ only.
2185
2201
  :param runtime_mappings: Define ad-hoc runtime fields in the request similar
2186
2202
  to the way it is done in search requests. These fields exist only as part
2187
2203
  of the query and take precedence over fields defined with the same name in
@@ -2219,6 +2235,8 @@ class AsyncElasticsearch(BaseClient):
2219
2235
  __query["include_unmapped"] = include_unmapped
2220
2236
  if pretty is not None:
2221
2237
  __query["pretty"] = pretty
2238
+ if project_routing is not None:
2239
+ __query["project_routing"] = project_routing
2222
2240
  if types is not None:
2223
2241
  __query["types"] = types
2224
2242
  if not __body:
@@ -2246,6 +2264,7 @@ class AsyncElasticsearch(BaseClient):
2246
2264
  @_rewrite_parameters(
2247
2265
  parameter_aliases={
2248
2266
  "_source": "source",
2267
+ "_source_exclude_vectors": "source_exclude_vectors",
2249
2268
  "_source_excludes": "source_excludes",
2250
2269
  "_source_includes": "source_includes",
2251
2270
  },
@@ -2265,12 +2284,13 @@ class AsyncElasticsearch(BaseClient):
2265
2284
  refresh: t.Optional[bool] = None,
2266
2285
  routing: t.Optional[str] = None,
2267
2286
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
2287
+ source_exclude_vectors: t.Optional[bool] = None,
2268
2288
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2269
2289
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2270
2290
  stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2271
2291
  version: t.Optional[int] = None,
2272
2292
  version_type: t.Optional[
2273
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
2293
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
2274
2294
  ] = None,
2275
2295
  ) -> ObjectApiResponse[t.Any]:
2276
2296
  """
@@ -2338,6 +2358,7 @@ class AsyncElasticsearch(BaseClient):
2338
2358
  :param routing: A custom value used to route operations to a specific shard.
2339
2359
  :param source: Indicates whether to return the `_source` field (`true` or `false`)
2340
2360
  or lists the fields to return.
2361
+ :param source_exclude_vectors: Whether vectors should be excluded from _source
2341
2362
  :param source_excludes: A comma-separated list of source fields to exclude from
2342
2363
  the response. You can also use this parameter to exclude fields from the
2343
2364
  subset specified in `_source_includes` query parameter. If the `_source`
@@ -2383,6 +2404,8 @@ class AsyncElasticsearch(BaseClient):
2383
2404
  __query["routing"] = routing
2384
2405
  if source is not None:
2385
2406
  __query["_source"] = source
2407
+ if source_exclude_vectors is not None:
2408
+ __query["_source_exclude_vectors"] = source_exclude_vectors
2386
2409
  if source_excludes is not None:
2387
2410
  __query["_source_excludes"] = source_excludes
2388
2411
  if source_includes is not None:
@@ -2557,7 +2580,7 @@ class AsyncElasticsearch(BaseClient):
2557
2580
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2558
2581
  version: t.Optional[int] = None,
2559
2582
  version_type: t.Optional[
2560
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
2583
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
2561
2584
  ] = None,
2562
2585
  ) -> ObjectApiResponse[t.Any]:
2563
2586
  """
@@ -2737,7 +2760,7 @@ class AsyncElasticsearch(BaseClient):
2737
2760
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2738
2761
  version: t.Optional[int] = None,
2739
2762
  version_type: t.Optional[
2740
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
2763
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
2741
2764
  ] = None,
2742
2765
  wait_for_active_shards: t.Optional[
2743
2766
  t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
@@ -3150,6 +3173,7 @@ class AsyncElasticsearch(BaseClient):
3150
3173
  max_concurrent_shard_requests: t.Optional[int] = None,
3151
3174
  pre_filter_shard_size: t.Optional[int] = None,
3152
3175
  pretty: t.Optional[bool] = None,
3176
+ project_routing: t.Optional[str] = None,
3153
3177
  rest_total_hits_as_int: t.Optional[bool] = None,
3154
3178
  routing: t.Optional[str] = None,
3155
3179
  search_type: t.Optional[
@@ -3211,6 +3235,10 @@ class AsyncElasticsearch(BaseClient):
3211
3235
  roundtrip can limit the number of shards significantly if for instance a
3212
3236
  shard can not match any documents based on its rewrite method i.e., if date
3213
3237
  filters are mandatory to match but the shard bounds and the query are disjoint.
3238
+ :param project_routing: Specifies a subset of projects to target for a search
3239
+ using project metadata tags in a subset Lucene syntax. Allowed Lucene queries:
3240
+ the _alias tag and a single value (possible wildcarded). Examples: _alias:my-project
3241
+ _alias:_origin _alias:*pr* Supported in serverless only.
3214
3242
  :param rest_total_hits_as_int: If true, hits.total are returned as an integer
3215
3243
  in the response. Defaults to false, which returns an object.
3216
3244
  :param routing: Custom routing value used to route search operations to a specific
@@ -3260,6 +3288,8 @@ class AsyncElasticsearch(BaseClient):
3260
3288
  __query["pre_filter_shard_size"] = pre_filter_shard_size
3261
3289
  if pretty is not None:
3262
3290
  __query["pretty"] = pretty
3291
+ if project_routing is not None:
3292
+ __query["project_routing"] = project_routing
3263
3293
  if rest_total_hits_as_int is not None:
3264
3294
  __query["rest_total_hits_as_int"] = rest_total_hits_as_int
3265
3295
  if routing is not None:
@@ -3298,6 +3328,7 @@ class AsyncElasticsearch(BaseClient):
3298
3328
  human: t.Optional[bool] = None,
3299
3329
  max_concurrent_searches: t.Optional[int] = None,
3300
3330
  pretty: t.Optional[bool] = None,
3331
+ project_routing: t.Optional[str] = None,
3301
3332
  rest_total_hits_as_int: t.Optional[bool] = None,
3302
3333
  search_type: t.Optional[
3303
3334
  t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
@@ -3331,6 +3362,10 @@ class AsyncElasticsearch(BaseClient):
3331
3362
  for cross-cluster search requests.
3332
3363
  :param max_concurrent_searches: The maximum number of concurrent searches the
3333
3364
  API can run.
3365
+ :param project_routing: Specifies a subset of projects to target for the search
3366
+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
3367
+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
3368
+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
3334
3369
  :param rest_total_hits_as_int: If `true`, the response returns `hits.total` as
3335
3370
  an integer. If `false`, it returns `hits.total` as an object.
3336
3371
  :param search_type: The type of the search operation.
@@ -3363,6 +3398,8 @@ class AsyncElasticsearch(BaseClient):
3363
3398
  __query["max_concurrent_searches"] = max_concurrent_searches
3364
3399
  if pretty is not None:
3365
3400
  __query["pretty"] = pretty
3401
+ if project_routing is not None:
3402
+ __query["project_routing"] = project_routing
3366
3403
  if rest_total_hits_as_int is not None:
3367
3404
  __query["rest_total_hits_as_int"] = rest_total_hits_as_int
3368
3405
  if search_type is not None:
@@ -3408,7 +3445,7 @@ class AsyncElasticsearch(BaseClient):
3408
3445
  term_statistics: t.Optional[bool] = None,
3409
3446
  version: t.Optional[int] = None,
3410
3447
  version_type: t.Optional[
3411
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
3448
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
3412
3449
  ] = None,
3413
3450
  body: t.Optional[t.Dict[str, t.Any]] = None,
3414
3451
  ) -> ObjectApiResponse[t.Any]:
@@ -3533,6 +3570,7 @@ class AsyncElasticsearch(BaseClient):
3533
3570
  max_concurrent_shard_requests: t.Optional[int] = None,
3534
3571
  preference: t.Optional[str] = None,
3535
3572
  pretty: t.Optional[bool] = None,
3573
+ project_routing: t.Optional[str] = None,
3536
3574
  routing: t.Optional[str] = None,
3537
3575
  body: t.Optional[t.Dict[str, t.Any]] = None,
3538
3576
  ) -> ObjectApiResponse[t.Any]:
@@ -3589,6 +3627,11 @@ class AsyncElasticsearch(BaseClient):
3589
3627
  that each sub-search request executes per node.
3590
3628
  :param preference: The node or shard the operation should be performed on. By
3591
3629
  default, it is random.
3630
+ :param project_routing: Specifies a subset of projects to target for the PIT
3631
+ request using project metadata tags in a subset of Lucene query syntax. Allowed
3632
+ Lucene queries: the _alias tag and a single value (possibly wildcarded).
3633
+ Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless
3634
+ only.
3592
3635
  :param routing: A custom value that is used to route operations to a specific
3593
3636
  shard.
3594
3637
  """
@@ -3620,6 +3663,8 @@ class AsyncElasticsearch(BaseClient):
3620
3663
  __query["preference"] = preference
3621
3664
  if pretty is not None:
3622
3665
  __query["pretty"] = pretty
3666
+ if project_routing is not None:
3667
+ __query["project_routing"] = project_routing
3623
3668
  if routing is not None:
3624
3669
  __query["routing"] = routing
3625
3670
  if not __body:
@@ -3818,7 +3863,7 @@ class AsyncElasticsearch(BaseClient):
3818
3863
  )
3819
3864
 
3820
3865
  @_rewrite_parameters(
3821
- body_fields=("dest", "source", "conflicts", "max_docs", "script", "size"),
3866
+ body_fields=("dest", "source", "conflicts", "max_docs", "script"),
3822
3867
  )
3823
3868
  async def reindex(
3824
3869
  self,
@@ -3836,7 +3881,6 @@ class AsyncElasticsearch(BaseClient):
3836
3881
  require_alias: t.Optional[bool] = None,
3837
3882
  script: t.Optional[t.Mapping[str, t.Any]] = None,
3838
3883
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3839
- size: t.Optional[int] = None,
3840
3884
  slices: t.Optional[t.Union[int, t.Union[str, t.Literal["auto"]]]] = None,
3841
3885
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3842
3886
  wait_for_active_shards: t.Optional[
@@ -3912,7 +3956,6 @@ class AsyncElasticsearch(BaseClient):
3912
3956
  reindexing.
3913
3957
  :param scroll: The period of time that a consistent view of the index should
3914
3958
  be maintained for scrolled search.
3915
- :param size:
3916
3959
  :param slices: The number of slices this task should be divided into. It defaults
3917
3960
  to one slice, which means the task isn't sliced into subtasks. Reindex supports
3918
3961
  sliced scroll to parallelize the reindexing process. This parallelization
@@ -3977,8 +4020,6 @@ class AsyncElasticsearch(BaseClient):
3977
4020
  __body["max_docs"] = max_docs
3978
4021
  if script is not None:
3979
4022
  __body["script"] = script
3980
- if size is not None:
3981
- __body["size"] = size
3982
4023
  __headers = {"accept": "application/json", "content-type": "application/json"}
3983
4024
  return await self.perform_request( # type: ignore[return-value]
3984
4025
  "POST",
@@ -4315,6 +4356,7 @@ class AsyncElasticsearch(BaseClient):
4315
4356
  ),
4316
4357
  parameter_aliases={
4317
4358
  "_source": "source",
4359
+ "_source_exclude_vectors": "source_exclude_vectors",
4318
4360
  "_source_excludes": "source_excludes",
4319
4361
  "_source_includes": "source_includes",
4320
4362
  "from": "from_",
@@ -4369,6 +4411,7 @@ class AsyncElasticsearch(BaseClient):
4369
4411
  preference: t.Optional[str] = None,
4370
4412
  pretty: t.Optional[bool] = None,
4371
4413
  profile: t.Optional[bool] = None,
4414
+ project_routing: t.Optional[str] = None,
4372
4415
  q: t.Optional[str] = None,
4373
4416
  query: t.Optional[t.Mapping[str, t.Any]] = None,
4374
4417
  rank: t.Optional[t.Mapping[str, t.Any]] = None,
@@ -4398,6 +4441,7 @@ class AsyncElasticsearch(BaseClient):
4398
4441
  ]
4399
4442
  ] = None,
4400
4443
  source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None,
4444
+ source_exclude_vectors: t.Optional[bool] = None,
4401
4445
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4402
4446
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4403
4447
  stats: t.Optional[t.Sequence[str]] = None,
@@ -4465,8 +4509,8 @@ class AsyncElasticsearch(BaseClient):
4465
4509
  node and the remote clusters are minimized when running cross-cluster search
4466
4510
  (CCS) requests.
4467
4511
  :param collapse: Collapses search results the values of the specified field.
4468
- :param default_operator: The default operator for the query string query: `AND`
4469
- or `OR`. This parameter can be used only when the `q` query string parameter
4512
+ :param default_operator: The default operator for the query string query: `and`
4513
+ or `or`. This parameter can be used only when the `q` query string parameter
4470
4514
  is specified.
4471
4515
  :param df: The field to use as a default when no field prefix is given in the
4472
4516
  query string. This parameter can be used only when the `q` query string parameter
@@ -4551,6 +4595,10 @@ class AsyncElasticsearch(BaseClient):
4551
4595
  :param profile: Set to `true` to return detailed timing information about the
4552
4596
  execution of individual components in a search request. NOTE: This is a debugging
4553
4597
  tool and adds significant overhead to search execution.
4598
+ :param project_routing: Specifies a subset of projects to target for the search
4599
+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
4600
+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
4601
+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
4554
4602
  :param q: A query in the Lucene query string syntax. Query parameter searches
4555
4603
  do not support the full Elasticsearch Query DSL but are handy for testing.
4556
4604
  IMPORTANT: This parameter overrides the query parameter in the request body.
@@ -4592,6 +4640,7 @@ class AsyncElasticsearch(BaseClient):
4592
4640
  fields are returned in the `hits._source` property of the search response.
4593
4641
  If the `stored_fields` property is specified, the `_source` property defaults
4594
4642
  to `false`. Otherwise, it defaults to `true`.
4643
+ :param source_exclude_vectors: Whether vectors should be excluded from _source
4595
4644
  :param source_excludes: A comma-separated list of source fields to exclude from
4596
4645
  the response. You can also use this parameter to exclude fields from the
4597
4646
  subset specified in `_source_includes` query parameter. If the `_source`
@@ -4704,6 +4753,8 @@ class AsyncElasticsearch(BaseClient):
4704
4753
  __query["preference"] = preference
4705
4754
  if pretty is not None:
4706
4755
  __query["pretty"] = pretty
4756
+ if project_routing is not None:
4757
+ __query["project_routing"] = project_routing
4707
4758
  if q is not None:
4708
4759
  __query["q"] = q
4709
4760
  if request_cache is not None:
@@ -4716,6 +4767,8 @@ class AsyncElasticsearch(BaseClient):
4716
4767
  __query["scroll"] = scroll
4717
4768
  if search_type is not None:
4718
4769
  __query["search_type"] = search_type
4770
+ if source_exclude_vectors is not None:
4771
+ __query["_source_exclude_vectors"] = source_exclude_vectors
4719
4772
  if source_excludes is not None:
4720
4773
  __query["_source_excludes"] = source_excludes
4721
4774
  if source_includes is not None:
@@ -4856,6 +4909,7 @@ class AsyncElasticsearch(BaseClient):
4856
4909
  ] = None,
4857
4910
  human: t.Optional[bool] = None,
4858
4911
  pretty: t.Optional[bool] = None,
4912
+ project_routing: t.Optional[str] = None,
4859
4913
  query: t.Optional[t.Mapping[str, t.Any]] = None,
4860
4914
  runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
4861
4915
  size: t.Optional[int] = None,
@@ -5181,6 +5235,10 @@ class AsyncElasticsearch(BaseClient):
5181
5235
  In the aggs layer, each feature represents a `geotile_grid` cell. If `grid,
5182
5236
  each feature is a polygon of the cells bounding box. If `point`, each feature
5183
5237
  is a Point that is the centroid of the cell.
5238
+ :param project_routing: Specifies a subset of projects to target for the search
5239
+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
5240
+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
5241
+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
5184
5242
  :param query: The query DSL used to filter documents for the search.
5185
5243
  :param runtime_mappings: Defines one or more runtime fields in the search request.
5186
5244
  These fields take precedence over mapped fields with the same name.
@@ -5244,6 +5302,8 @@ class AsyncElasticsearch(BaseClient):
5244
5302
  __query["human"] = human
5245
5303
  if pretty is not None:
5246
5304
  __query["pretty"] = pretty
5305
+ if project_routing is not None:
5306
+ __query["project_routing"] = project_routing
5247
5307
  if not __body:
5248
5308
  if aggs is not None:
5249
5309
  __body["aggs"] = aggs
@@ -5417,6 +5477,7 @@ class AsyncElasticsearch(BaseClient):
5417
5477
  preference: t.Optional[str] = None,
5418
5478
  pretty: t.Optional[bool] = None,
5419
5479
  profile: t.Optional[bool] = None,
5480
+ project_routing: t.Optional[str] = None,
5420
5481
  rest_total_hits_as_int: t.Optional[bool] = None,
5421
5482
  routing: t.Optional[str] = None,
5422
5483
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -5462,6 +5523,10 @@ class AsyncElasticsearch(BaseClient):
5462
5523
  :param preference: The node or shard the operation should be performed on. It
5463
5524
  is random by default.
5464
5525
  :param profile: If `true`, the query execution is profiled.
5526
+ :param project_routing: Specifies a subset of projects to target for the search
5527
+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
5528
+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
5529
+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
5465
5530
  :param rest_total_hits_as_int: If `true`, `hits.total` is rendered as an integer
5466
5531
  in the response. If `false`, it is rendered as an object.
5467
5532
  :param routing: A custom value used to route operations to a specific shard.
@@ -5503,6 +5568,8 @@ class AsyncElasticsearch(BaseClient):
5503
5568
  __query["preference"] = preference
5504
5569
  if pretty is not None:
5505
5570
  __query["pretty"] = pretty
5571
+ if project_routing is not None:
5572
+ __query["project_routing"] = project_routing
5506
5573
  if rest_total_hits_as_int is not None:
5507
5574
  __query["rest_total_hits_as_int"] = rest_total_hits_as_int
5508
5575
  if routing is not None:
@@ -5679,7 +5746,7 @@ class AsyncElasticsearch(BaseClient):
5679
5746
  term_statistics: t.Optional[bool] = None,
5680
5747
  version: t.Optional[int] = None,
5681
5748
  version_type: t.Optional[
5682
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
5749
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
5683
5750
  ] = None,
5684
5751
  body: t.Optional[t.Dict[str, t.Any]] = None,
5685
5752
  ) -> ObjectApiResponse[t.Any]:
@@ -6155,8 +6222,8 @@ class AsyncElasticsearch(BaseClient):
6155
6222
  be used only when the `q` query string parameter is specified.
6156
6223
  :param conflicts: The preferred behavior when update by query hits version conflicts:
6157
6224
  `abort` or `proceed`.
6158
- :param default_operator: The default operator for query string query: `AND` or
6159
- `OR`. This parameter can be used only when the `q` query string parameter
6225
+ :param default_operator: The default operator for query string query: `and` or
6226
+ `or`. This parameter can be used only when the `q` query string parameter
6160
6227
  is specified.
6161
6228
  :param df: The field to use as default where no field prefix is given in the
6162
6229
  query string. This parameter can be used only when the `q` query string parameter
@@ -287,6 +287,7 @@ class AsyncSearchClient(NamespacedClient):
287
287
  preference: t.Optional[str] = None,
288
288
  pretty: t.Optional[bool] = None,
289
289
  profile: t.Optional[bool] = None,
290
+ project_routing: t.Optional[str] = None,
290
291
  q: t.Optional[str] = None,
291
292
  query: t.Optional[t.Mapping[str, t.Any]] = None,
292
293
  request_cache: t.Optional[bool] = None,
@@ -408,6 +409,10 @@ class AsyncSearchClient(NamespacedClient):
408
409
  :param preference: Specify the node or shard the operation should be performed
409
410
  on
410
411
  :param profile:
412
+ :param project_routing: Specifies a subset of projects to target for the search
413
+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
414
+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
415
+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
411
416
  :param q: Query in the Lucene query string syntax
412
417
  :param query: Defines the search definition using the Query DSL.
413
418
  :param request_cache: Specify if request cache should be used for this request
@@ -528,6 +533,8 @@ class AsyncSearchClient(NamespacedClient):
528
533
  __query["preference"] = preference
529
534
  if pretty is not None:
530
535
  __query["pretty"] = pretty
536
+ if project_routing is not None:
537
+ __query["project_routing"] = project_routing
531
538
  if q is not None:
532
539
  __query["q"] = q
533
540
  if request_cache is not None:
@@ -22,6 +22,9 @@ from elastic_transport import ObjectApiResponse
22
22
  from ._base import NamespacedClient
23
23
  from .utils import (
24
24
  SKIP_IN_PATH,
25
+ Stability,
26
+ Visibility,
27
+ _availability_warning,
25
28
  _quote,
26
29
  _rewrite_parameters,
27
30
  )
@@ -30,6 +33,7 @@ from .utils import (
30
33
  class AutoscalingClient(NamespacedClient):
31
34
 
32
35
  @_rewrite_parameters()
36
+ @_availability_warning(Stability.STABLE, Visibility.PRIVATE)
33
37
  async def delete_autoscaling_policy(
34
38
  self,
35
39
  *,
@@ -85,6 +89,7 @@ class AutoscalingClient(NamespacedClient):
85
89
  )
86
90
 
87
91
  @_rewrite_parameters()
92
+ @_availability_warning(Stability.STABLE, Visibility.PRIVATE)
88
93
  async def get_autoscaling_capacity(
89
94
  self,
90
95
  *,
@@ -138,6 +143,7 @@ class AutoscalingClient(NamespacedClient):
138
143
  )
139
144
 
140
145
  @_rewrite_parameters()
146
+ @_availability_warning(Stability.STABLE, Visibility.PRIVATE)
141
147
  async def get_autoscaling_policy(
142
148
  self,
143
149
  *,
@@ -190,6 +196,7 @@ class AutoscalingClient(NamespacedClient):
190
196
  @_rewrite_parameters(
191
197
  body_name="policy",
192
198
  )
199
+ @_availability_warning(Stability.STABLE, Visibility.PRIVATE)
193
200
  async def put_autoscaling_policy(
194
201
  self,
195
202
  *,
@@ -488,6 +488,7 @@ class CatClient(NamespacedClient):
488
488
  help: t.Optional[bool] = None,
489
489
  human: t.Optional[bool] = None,
490
490
  pretty: t.Optional[bool] = None,
491
+ project_routing: t.Optional[str] = None,
491
492
  s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
492
493
  time: t.Optional[
493
494
  t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
@@ -523,6 +524,10 @@ class CatClient(NamespacedClient):
523
524
  wildcards.
524
525
  :param help: When set to `true` will output available columns. This option can't
525
526
  be combined with any other query string option.
527
+ :param project_routing: Specifies a subset of projects to target for the search
528
+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
529
+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
530
+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
526
531
  :param s: List of columns that determine how the table should be sorted. Sorting
527
532
  defaults to ascending and can be changed by setting `:asc` or `:desc` as
528
533
  a suffix to the column name.
@@ -558,6 +563,8 @@ class CatClient(NamespacedClient):
558
563
  __query["human"] = human
559
564
  if pretty is not None:
560
565
  __query["pretty"] = pretty
566
+ if project_routing is not None:
567
+ __query["project_routing"] = project_routing
561
568
  if s is not None:
562
569
  __query["s"] = s
563
570
  if time is not None:
@@ -2502,7 +2509,7 @@ class CatClient(NamespacedClient):
2502
2509
  error_trace: t.Optional[bool] = None,
2503
2510
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2504
2511
  format: t.Optional[str] = None,
2505
- full_id: t.Optional[t.Union[bool, str]] = None,
2512
+ full_id: t.Optional[bool] = None,
2506
2513
  h: t.Optional[
2507
2514
  t.Union[
2508
2515
  t.Sequence[
@@ -49,6 +49,7 @@ class ClusterClient(NamespacedClient):
49
49
 
50
50
  <p>Explain the shard allocations.</p>
51
51
  <p>Get explanations for shard allocations in the cluster.
52
+ This API accepts the current_node, index, primary and shard parameters in the request body or in query parameters, but not in both at the same time.
52
53
  For unassigned shards, it provides an explanation for why the shard is unassigned.
53
54
  For assigned shards, it provides an explanation for why the shard is remaining on its current node and has not moved or rebalanced to another node.
54
55
  This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise.
@@ -57,17 +58,16 @@ class ClusterClient(NamespacedClient):
57
58
 
58
59
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-allocation-explain>`_
59
60
 
60
- :param current_node: Specifies the node ID or the name of the node to only explain
61
- a shard that is currently located on the specified node.
61
+ :param current_node: Explain a shard only if it is currently located on the specified
62
+ node name or node ID.
62
63
  :param include_disk_info: If true, returns information about disk usage and shard
63
64
  sizes.
64
65
  :param include_yes_decisions: If true, returns YES decisions in explanation.
65
- :param index: Specifies the name of the index that you would like an explanation
66
- for.
66
+ :param index: The name of the index that you would like an explanation for.
67
67
  :param master_timeout: Period to wait for a connection to the master node.
68
- :param primary: If true, returns explanation for the primary shard for the given
69
- shard ID.
70
- :param shard: Specifies the ID of the shard that you would like an explanation
68
+ :param primary: If true, returns an explanation for the primary shard for the
69
+ specified shard ID.
70
+ :param shard: An identifier for the shard that you would like an explanation
71
71
  for.
72
72
  """
73
73
  __path_parts: t.Dict[str, str] = {}
@@ -229,6 +229,7 @@ class EqlClient(NamespacedClient):
229
229
  keep_on_completion: t.Optional[bool] = None,
230
230
  max_samples_per_key: t.Optional[int] = None,
231
231
  pretty: t.Optional[bool] = None,
232
+ project_routing: t.Optional[str] = None,
232
233
  result_position: t.Optional[t.Union[str, t.Literal["head", "tail"]]] = None,
233
234
  runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
234
235
  size: t.Optional[int] = None,
@@ -285,6 +286,10 @@ class EqlClient(NamespacedClient):
285
286
  `size` parameter to get a smaller or larger set of samples. To retrieve more
286
287
  than one sample per set of join keys, use the `max_samples_per_key` parameter.
287
288
  Pipes are not supported for sample queries.
289
+ :param project_routing: Specifies a subset of projects to target for the search
290
+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
291
+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
292
+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
288
293
  :param result_position:
289
294
  :param runtime_mappings:
290
295
  :param size: For basic queries, the maximum number of matching events to return.
@@ -318,6 +323,8 @@ class EqlClient(NamespacedClient):
318
323
  __query["ignore_unavailable"] = ignore_unavailable
319
324
  if pretty is not None:
320
325
  __query["pretty"] = pretty
326
+ if project_routing is not None:
327
+ __query["project_routing"] = project_routing
321
328
  if not __body:
322
329
  if query is not None:
323
330
  __body["query"] = query