elasticsearch 9.1.1__py3-none-any.whl → 9.2.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 (76) hide show
  1. elasticsearch/_async/client/__init__.py +96 -44
  2. elasticsearch/_async/client/async_search.py +7 -0
  3. elasticsearch/_async/client/cat.py +489 -26
  4. elasticsearch/_async/client/cluster.py +9 -8
  5. elasticsearch/_async/client/connector.py +3 -3
  6. elasticsearch/_async/client/eql.py +7 -0
  7. elasticsearch/_async/client/esql.py +26 -3
  8. elasticsearch/_async/client/fleet.py +1 -5
  9. elasticsearch/_async/client/graph.py +1 -5
  10. elasticsearch/_async/client/ilm.py +2 -10
  11. elasticsearch/_async/client/indices.py +181 -37
  12. elasticsearch/_async/client/inference.py +291 -124
  13. elasticsearch/_async/client/ingest.py +8 -0
  14. elasticsearch/_async/client/license.py +4 -2
  15. elasticsearch/_async/client/logstash.py +3 -1
  16. elasticsearch/_async/client/ml.py +2 -2
  17. elasticsearch/_async/client/nodes.py +3 -5
  18. elasticsearch/_async/client/project.py +67 -0
  19. elasticsearch/_async/client/security.py +39 -0
  20. elasticsearch/_async/client/shutdown.py +5 -15
  21. elasticsearch/_async/client/simulate.py +8 -0
  22. elasticsearch/_async/client/slm.py +1 -5
  23. elasticsearch/_async/client/snapshot.py +20 -10
  24. elasticsearch/_async/client/sql.py +7 -0
  25. elasticsearch/_async/client/streams.py +185 -0
  26. elasticsearch/_async/client/watcher.py +1 -5
  27. elasticsearch/_async/helpers.py +74 -12
  28. elasticsearch/_sync/client/__init__.py +96 -44
  29. elasticsearch/_sync/client/async_search.py +7 -0
  30. elasticsearch/_sync/client/cat.py +489 -26
  31. elasticsearch/_sync/client/cluster.py +9 -8
  32. elasticsearch/_sync/client/connector.py +3 -3
  33. elasticsearch/_sync/client/eql.py +7 -0
  34. elasticsearch/_sync/client/esql.py +26 -3
  35. elasticsearch/_sync/client/fleet.py +1 -5
  36. elasticsearch/_sync/client/graph.py +1 -5
  37. elasticsearch/_sync/client/ilm.py +2 -10
  38. elasticsearch/_sync/client/indices.py +181 -37
  39. elasticsearch/_sync/client/inference.py +291 -124
  40. elasticsearch/_sync/client/ingest.py +8 -0
  41. elasticsearch/_sync/client/license.py +4 -2
  42. elasticsearch/_sync/client/logstash.py +3 -1
  43. elasticsearch/_sync/client/ml.py +2 -2
  44. elasticsearch/_sync/client/nodes.py +3 -5
  45. elasticsearch/_sync/client/project.py +67 -0
  46. elasticsearch/_sync/client/security.py +39 -0
  47. elasticsearch/_sync/client/shutdown.py +5 -15
  48. elasticsearch/_sync/client/simulate.py +8 -0
  49. elasticsearch/_sync/client/slm.py +1 -5
  50. elasticsearch/_sync/client/snapshot.py +20 -10
  51. elasticsearch/_sync/client/sql.py +7 -0
  52. elasticsearch/_sync/client/streams.py +185 -0
  53. elasticsearch/_sync/client/watcher.py +1 -5
  54. elasticsearch/_version.py +2 -1
  55. elasticsearch/client.py +4 -0
  56. elasticsearch/compat.py +30 -1
  57. elasticsearch/dsl/__init__.py +28 -0
  58. elasticsearch/dsl/_async/document.py +2 -1
  59. elasticsearch/dsl/_sync/document.py +2 -1
  60. elasticsearch/dsl/aggs.py +97 -0
  61. elasticsearch/dsl/document_base.py +53 -13
  62. elasticsearch/dsl/field.py +21 -2
  63. elasticsearch/dsl/pydantic.py +152 -0
  64. elasticsearch/dsl/query.py +5 -1
  65. elasticsearch/dsl/response/__init__.py +3 -0
  66. elasticsearch/dsl/search_base.py +5 -1
  67. elasticsearch/dsl/types.py +226 -14
  68. elasticsearch/esql/esql.py +331 -41
  69. elasticsearch/esql/functions.py +88 -0
  70. elasticsearch/helpers/__init__.py +10 -1
  71. elasticsearch/helpers/actions.py +106 -33
  72. {elasticsearch-9.1.1.dist-info → elasticsearch-9.2.0.dist-info}/METADATA +27 -5
  73. {elasticsearch-9.1.1.dist-info → elasticsearch-9.2.0.dist-info}/RECORD +76 -71
  74. {elasticsearch-9.1.1.dist-info → elasticsearch-9.2.0.dist-info}/WHEEL +0 -0
  75. {elasticsearch-9.1.1.dist-info → elasticsearch-9.2.0.dist-info}/licenses/LICENSE +0 -0
  76. {elasticsearch-9.1.1.dist-info → elasticsearch-9.2.0.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
@@ -74,6 +75,7 @@ from .slm import SlmClient
74
75
  from .snapshot import SnapshotClient
75
76
  from .sql import SqlClient
76
77
  from .ssl import SslClient
78
+ from .streams import StreamsClient
77
79
  from .synonyms import SynonymsClient
78
80
  from .tasks import TasksClient
79
81
  from .text_structure import TextStructureClient
@@ -368,6 +370,7 @@ class Elasticsearch(BaseClient):
368
370
  self.migration = MigrationClient(self)
369
371
  self.ml = MlClient(self)
370
372
  self.monitoring = MonitoringClient(self)
373
+ self.project = ProjectClient(self)
371
374
  self.query_rules = QueryRulesClient(self)
372
375
  self.rollup = RollupClient(self)
373
376
  self.search_application = SearchApplicationClient(self)
@@ -378,6 +381,7 @@ class Elasticsearch(BaseClient):
378
381
  self.shutdown = ShutdownClient(self)
379
382
  self.sql = SqlClient(self)
380
383
  self.ssl = SslClient(self)
384
+ self.streams = StreamsClient(self)
381
385
  self.synonyms = SynonymsClient(self)
382
386
  self.text_structure = TextStructureClient(self)
383
387
  self.transform = TransformClient(self)
@@ -843,11 +847,7 @@ class Elasticsearch(BaseClient):
843
847
  if not __body:
844
848
  if id is not None:
845
849
  __body["id"] = id
846
- if not __body:
847
- __body = None # type: ignore[assignment]
848
- __headers = {"accept": "application/json"}
849
- if __body is not None:
850
- __headers["content-type"] = "application/json"
850
+ __headers = {"accept": "application/json", "content-type": "application/json"}
851
851
  return self.perform_request( # type: ignore[return-value]
852
852
  "DELETE",
853
853
  __path,
@@ -887,6 +887,7 @@ class Elasticsearch(BaseClient):
887
887
  min_score: t.Optional[float] = None,
888
888
  preference: t.Optional[str] = None,
889
889
  pretty: t.Optional[bool] = None,
890
+ project_routing: t.Optional[str] = None,
890
891
  q: t.Optional[str] = None,
891
892
  query: t.Optional[t.Mapping[str, t.Any]] = None,
892
893
  routing: t.Optional[str] = None,
@@ -920,8 +921,8 @@ class Elasticsearch(BaseClient):
920
921
  This parameter can be used only when the `q` query string parameter is specified.
921
922
  :param analyzer: The analyzer to use for the query string. This parameter can
922
923
  be used only when the `q` query string parameter is specified.
923
- :param default_operator: The default operator for query string query: `AND` or
924
- `OR`. This parameter can be used only when the `q` query string parameter
924
+ :param default_operator: The default operator for query string query: `and` or
925
+ `or`. This parameter can be used only when the `q` query string parameter
925
926
  is specified.
926
927
  :param df: The field to use as a default when no field prefix is given in the
927
928
  query string. This parameter can be used only when the `q` query string parameter
@@ -941,6 +942,10 @@ class Elasticsearch(BaseClient):
941
942
  in the result.
942
943
  :param preference: The node or shard the operation should be performed on. By
943
944
  default, it is random.
945
+ :param project_routing: Specifies a subset of projects to target for the search
946
+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
947
+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
948
+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
944
949
  :param q: The query in Lucene query string syntax. This parameter cannot be used
945
950
  with a request body.
946
951
  :param query: Defines the search query using Query DSL. A request body query
@@ -993,6 +998,8 @@ class Elasticsearch(BaseClient):
993
998
  __query["preference"] = preference
994
999
  if pretty is not None:
995
1000
  __query["pretty"] = pretty
1001
+ if project_routing is not None:
1002
+ __query["project_routing"] = project_routing
996
1003
  if q is not None:
997
1004
  __query["q"] = q
998
1005
  if routing is not None:
@@ -1042,7 +1049,7 @@ class Elasticsearch(BaseClient):
1042
1049
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1043
1050
  version: t.Optional[int] = None,
1044
1051
  version_type: t.Optional[
1045
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
1052
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
1046
1053
  ] = None,
1047
1054
  wait_for_active_shards: t.Optional[
1048
1055
  t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
@@ -1221,7 +1228,7 @@ class Elasticsearch(BaseClient):
1221
1228
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1222
1229
  version: t.Optional[int] = None,
1223
1230
  version_type: t.Optional[
1224
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
1231
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
1225
1232
  ] = None,
1226
1233
  wait_for_active_shards: t.Optional[
1227
1234
  t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
@@ -1466,8 +1473,8 @@ class Elasticsearch(BaseClient):
1466
1473
  used only when the `q` query string parameter is specified.
1467
1474
  :param conflicts: What to do if delete by query hits version conflicts: `abort`
1468
1475
  or `proceed`.
1469
- :param default_operator: The default operator for query string query: `AND` or
1470
- `OR`. This parameter can be used only when the `q` query string parameter
1476
+ :param default_operator: The default operator for query string query: `and` or
1477
+ `or`. This parameter can be used only when the `q` query string parameter
1471
1478
  is specified.
1472
1479
  :param df: The field to use as default where no field prefix is given in the
1473
1480
  query string. This parameter can be used only when the `q` query string parameter
@@ -1761,7 +1768,7 @@ class Elasticsearch(BaseClient):
1761
1768
  stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1762
1769
  version: t.Optional[int] = None,
1763
1770
  version_type: t.Optional[
1764
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
1771
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
1765
1772
  ] = None,
1766
1773
  ) -> HeadApiResponse:
1767
1774
  """
@@ -1890,7 +1897,7 @@ class Elasticsearch(BaseClient):
1890
1897
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1891
1898
  version: t.Optional[int] = None,
1892
1899
  version_type: t.Optional[
1893
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
1900
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
1894
1901
  ] = None,
1895
1902
  ) -> HeadApiResponse:
1896
1903
  """
@@ -2019,8 +2026,8 @@ class Elasticsearch(BaseClient):
2019
2026
  This parameter can be used only when the `q` query string parameter is specified.
2020
2027
  :param analyzer: The analyzer to use for the query string. This parameter can
2021
2028
  be used only when the `q` query string parameter is specified.
2022
- :param default_operator: The default operator for query string query: `AND` or
2023
- `OR`. This parameter can be used only when the `q` query string parameter
2029
+ :param default_operator: The default operator for query string query: `and` or
2030
+ `or`. This parameter can be used only when the `q` query string parameter
2024
2031
  is specified.
2025
2032
  :param df: The field to use as default where no field prefix is given in the
2026
2033
  query string. This parameter can be used only when the `q` query string parameter
@@ -2131,6 +2138,7 @@ class Elasticsearch(BaseClient):
2131
2138
  include_unmapped: t.Optional[bool] = None,
2132
2139
  index_filter: t.Optional[t.Mapping[str, t.Any]] = None,
2133
2140
  pretty: t.Optional[bool] = None,
2141
+ project_routing: t.Optional[str] = None,
2134
2142
  runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
2135
2143
  types: t.Optional[t.Sequence[str]] = None,
2136
2144
  body: t.Optional[t.Dict[str, t.Any]] = None,
@@ -2174,6 +2182,11 @@ class Elasticsearch(BaseClient):
2174
2182
  deleted documents) are outside of the provided range. However, not all queries
2175
2183
  can rewrite to `match_none` so this API may return an index even if the provided
2176
2184
  filter matches no document.
2185
+ :param project_routing: Specifies a subset of projects to target for the field-caps
2186
+ query using project metadata tags in a subset of Lucene query syntax. Allowed
2187
+ Lucene queries: the _alias tag and a single value (possibly wildcarded).
2188
+ Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless
2189
+ only.
2177
2190
  :param runtime_mappings: Define ad-hoc runtime fields in the request similar
2178
2191
  to the way it is done in search requests. These fields exist only as part
2179
2192
  of the query and take precedence over fields defined with the same name in
@@ -2211,6 +2224,8 @@ class Elasticsearch(BaseClient):
2211
2224
  __query["include_unmapped"] = include_unmapped
2212
2225
  if pretty is not None:
2213
2226
  __query["pretty"] = pretty
2227
+ if project_routing is not None:
2228
+ __query["project_routing"] = project_routing
2214
2229
  if types is not None:
2215
2230
  __query["types"] = types
2216
2231
  if not __body:
@@ -2238,6 +2253,7 @@ class Elasticsearch(BaseClient):
2238
2253
  @_rewrite_parameters(
2239
2254
  parameter_aliases={
2240
2255
  "_source": "source",
2256
+ "_source_exclude_vectors": "source_exclude_vectors",
2241
2257
  "_source_excludes": "source_excludes",
2242
2258
  "_source_includes": "source_includes",
2243
2259
  },
@@ -2257,12 +2273,13 @@ class Elasticsearch(BaseClient):
2257
2273
  refresh: t.Optional[bool] = None,
2258
2274
  routing: t.Optional[str] = None,
2259
2275
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
2276
+ source_exclude_vectors: t.Optional[bool] = None,
2260
2277
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2261
2278
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2262
2279
  stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2263
2280
  version: t.Optional[int] = None,
2264
2281
  version_type: t.Optional[
2265
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
2282
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
2266
2283
  ] = None,
2267
2284
  ) -> ObjectApiResponse[t.Any]:
2268
2285
  """
@@ -2330,6 +2347,7 @@ class Elasticsearch(BaseClient):
2330
2347
  :param routing: A custom value used to route operations to a specific shard.
2331
2348
  :param source: Indicates whether to return the `_source` field (`true` or `false`)
2332
2349
  or lists the fields to return.
2350
+ :param source_exclude_vectors: Whether vectors should be excluded from _source
2333
2351
  :param source_excludes: A comma-separated list of source fields to exclude from
2334
2352
  the response. You can also use this parameter to exclude fields from the
2335
2353
  subset specified in `_source_includes` query parameter. If the `_source`
@@ -2375,6 +2393,8 @@ class Elasticsearch(BaseClient):
2375
2393
  __query["routing"] = routing
2376
2394
  if source is not None:
2377
2395
  __query["_source"] = source
2396
+ if source_exclude_vectors is not None:
2397
+ __query["_source_exclude_vectors"] = source_exclude_vectors
2378
2398
  if source_excludes is not None:
2379
2399
  __query["_source_excludes"] = source_excludes
2380
2400
  if source_includes is not None:
@@ -2549,7 +2569,7 @@ class Elasticsearch(BaseClient):
2549
2569
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2550
2570
  version: t.Optional[int] = None,
2551
2571
  version_type: t.Optional[
2552
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
2572
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
2553
2573
  ] = None,
2554
2574
  ) -> ObjectApiResponse[t.Any]:
2555
2575
  """
@@ -2729,7 +2749,7 @@ class Elasticsearch(BaseClient):
2729
2749
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2730
2750
  version: t.Optional[int] = None,
2731
2751
  version_type: t.Optional[
2732
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
2752
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
2733
2753
  ] = None,
2734
2754
  wait_for_active_shards: t.Optional[
2735
2755
  t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
@@ -3144,6 +3164,7 @@ class Elasticsearch(BaseClient):
3144
3164
  max_concurrent_shard_requests: t.Optional[int] = None,
3145
3165
  pre_filter_shard_size: t.Optional[int] = None,
3146
3166
  pretty: t.Optional[bool] = None,
3167
+ project_routing: t.Optional[str] = None,
3147
3168
  rest_total_hits_as_int: t.Optional[bool] = None,
3148
3169
  routing: t.Optional[str] = None,
3149
3170
  search_type: t.Optional[
@@ -3205,6 +3226,10 @@ class Elasticsearch(BaseClient):
3205
3226
  roundtrip can limit the number of shards significantly if for instance a
3206
3227
  shard can not match any documents based on its rewrite method i.e., if date
3207
3228
  filters are mandatory to match but the shard bounds and the query are disjoint.
3229
+ :param project_routing: Specifies a subset of projects to target for a search
3230
+ using project metadata tags in a subset Lucene syntax. Allowed Lucene queries:
3231
+ the _alias tag and a single value (possible wildcarded). Examples: _alias:my-project
3232
+ _alias:_origin _alias:*pr* Supported in serverless only.
3208
3233
  :param rest_total_hits_as_int: If true, hits.total are returned as an integer
3209
3234
  in the response. Defaults to false, which returns an object.
3210
3235
  :param routing: Custom routing value used to route search operations to a specific
@@ -3254,6 +3279,8 @@ class Elasticsearch(BaseClient):
3254
3279
  __query["pre_filter_shard_size"] = pre_filter_shard_size
3255
3280
  if pretty is not None:
3256
3281
  __query["pretty"] = pretty
3282
+ if project_routing is not None:
3283
+ __query["project_routing"] = project_routing
3257
3284
  if rest_total_hits_as_int is not None:
3258
3285
  __query["rest_total_hits_as_int"] = rest_total_hits_as_int
3259
3286
  if routing is not None:
@@ -3292,6 +3319,7 @@ class Elasticsearch(BaseClient):
3292
3319
  human: t.Optional[bool] = None,
3293
3320
  max_concurrent_searches: t.Optional[int] = None,
3294
3321
  pretty: t.Optional[bool] = None,
3322
+ project_routing: t.Optional[str] = None,
3295
3323
  rest_total_hits_as_int: t.Optional[bool] = None,
3296
3324
  search_type: t.Optional[
3297
3325
  t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
@@ -3325,6 +3353,10 @@ class Elasticsearch(BaseClient):
3325
3353
  for cross-cluster search requests.
3326
3354
  :param max_concurrent_searches: The maximum number of concurrent searches the
3327
3355
  API can run.
3356
+ :param project_routing: Specifies a subset of projects to target for the search
3357
+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
3358
+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
3359
+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
3328
3360
  :param rest_total_hits_as_int: If `true`, the response returns `hits.total` as
3329
3361
  an integer. If `false`, it returns `hits.total` as an object.
3330
3362
  :param search_type: The type of the search operation.
@@ -3357,6 +3389,8 @@ class Elasticsearch(BaseClient):
3357
3389
  __query["max_concurrent_searches"] = max_concurrent_searches
3358
3390
  if pretty is not None:
3359
3391
  __query["pretty"] = pretty
3392
+ if project_routing is not None:
3393
+ __query["project_routing"] = project_routing
3360
3394
  if rest_total_hits_as_int is not None:
3361
3395
  __query["rest_total_hits_as_int"] = rest_total_hits_as_int
3362
3396
  if search_type is not None:
@@ -3402,7 +3436,7 @@ class Elasticsearch(BaseClient):
3402
3436
  term_statistics: t.Optional[bool] = None,
3403
3437
  version: t.Optional[int] = None,
3404
3438
  version_type: t.Optional[
3405
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
3439
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
3406
3440
  ] = None,
3407
3441
  body: t.Optional[t.Dict[str, t.Any]] = None,
3408
3442
  ) -> ObjectApiResponse[t.Any]:
@@ -3527,6 +3561,7 @@ class Elasticsearch(BaseClient):
3527
3561
  max_concurrent_shard_requests: t.Optional[int] = None,
3528
3562
  preference: t.Optional[str] = None,
3529
3563
  pretty: t.Optional[bool] = None,
3564
+ project_routing: t.Optional[str] = None,
3530
3565
  routing: t.Optional[str] = None,
3531
3566
  body: t.Optional[t.Dict[str, t.Any]] = None,
3532
3567
  ) -> ObjectApiResponse[t.Any]:
@@ -3583,6 +3618,11 @@ class Elasticsearch(BaseClient):
3583
3618
  that each sub-search request executes per node.
3584
3619
  :param preference: The node or shard the operation should be performed on. By
3585
3620
  default, it is random.
3621
+ :param project_routing: Specifies a subset of projects to target for the PIT
3622
+ request using project metadata tags in a subset of Lucene query syntax. Allowed
3623
+ Lucene queries: the _alias tag and a single value (possibly wildcarded).
3624
+ Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless
3625
+ only.
3586
3626
  :param routing: A custom value that is used to route operations to a specific
3587
3627
  shard.
3588
3628
  """
@@ -3614,6 +3654,8 @@ class Elasticsearch(BaseClient):
3614
3654
  __query["preference"] = preference
3615
3655
  if pretty is not None:
3616
3656
  __query["pretty"] = pretty
3657
+ if project_routing is not None:
3658
+ __query["project_routing"] = project_routing
3617
3659
  if routing is not None:
3618
3660
  __query["routing"] = routing
3619
3661
  if not __body:
@@ -3812,7 +3854,7 @@ class Elasticsearch(BaseClient):
3812
3854
  )
3813
3855
 
3814
3856
  @_rewrite_parameters(
3815
- body_fields=("dest", "source", "conflicts", "max_docs", "script", "size"),
3857
+ body_fields=("dest", "source", "conflicts", "max_docs", "script"),
3816
3858
  )
3817
3859
  def reindex(
3818
3860
  self,
@@ -3830,7 +3872,6 @@ class Elasticsearch(BaseClient):
3830
3872
  require_alias: t.Optional[bool] = None,
3831
3873
  script: t.Optional[t.Mapping[str, t.Any]] = None,
3832
3874
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3833
- size: t.Optional[int] = None,
3834
3875
  slices: t.Optional[t.Union[int, t.Union[str, t.Literal["auto"]]]] = None,
3835
3876
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3836
3877
  wait_for_active_shards: t.Optional[
@@ -3906,7 +3947,6 @@ class Elasticsearch(BaseClient):
3906
3947
  reindexing.
3907
3948
  :param scroll: The period of time that a consistent view of the index should
3908
3949
  be maintained for scrolled search.
3909
- :param size:
3910
3950
  :param slices: The number of slices this task should be divided into. It defaults
3911
3951
  to one slice, which means the task isn't sliced into subtasks. Reindex supports
3912
3952
  sliced scroll to parallelize the reindexing process. This parallelization
@@ -3971,8 +4011,6 @@ class Elasticsearch(BaseClient):
3971
4011
  __body["max_docs"] = max_docs
3972
4012
  if script is not None:
3973
4013
  __body["script"] = script
3974
- if size is not None:
3975
- __body["size"] = size
3976
4014
  __headers = {"accept": "application/json", "content-type": "application/json"}
3977
4015
  return self.perform_request( # type: ignore[return-value]
3978
4016
  "POST",
@@ -4099,11 +4137,7 @@ class Elasticsearch(BaseClient):
4099
4137
  __body["params"] = params
4100
4138
  if source is not None:
4101
4139
  __body["source"] = source
4102
- if not __body:
4103
- __body = None # type: ignore[assignment]
4104
- __headers = {"accept": "application/json"}
4105
- if __body is not None:
4106
- __headers["content-type"] = "application/json"
4140
+ __headers = {"accept": "application/json", "content-type": "application/json"}
4107
4141
  return self.perform_request( # type: ignore[return-value]
4108
4142
  "POST",
4109
4143
  __path,
@@ -4186,11 +4220,7 @@ class Elasticsearch(BaseClient):
4186
4220
  __body["context_setup"] = context_setup
4187
4221
  if script is not None:
4188
4222
  __body["script"] = script
4189
- if not __body:
4190
- __body = None # type: ignore[assignment]
4191
- __headers = {"accept": "application/json"}
4192
- if __body is not None:
4193
- __headers["content-type"] = "application/json"
4223
+ __headers = {"accept": "application/json", "content-type": "application/json"}
4194
4224
  return self.perform_request( # type: ignore[return-value]
4195
4225
  "POST",
4196
4226
  __path,
@@ -4315,6 +4345,7 @@ class Elasticsearch(BaseClient):
4315
4345
  ),
4316
4346
  parameter_aliases={
4317
4347
  "_source": "source",
4348
+ "_source_exclude_vectors": "source_exclude_vectors",
4318
4349
  "_source_excludes": "source_excludes",
4319
4350
  "_source_includes": "source_includes",
4320
4351
  "from": "from_",
@@ -4369,6 +4400,7 @@ class Elasticsearch(BaseClient):
4369
4400
  preference: t.Optional[str] = None,
4370
4401
  pretty: t.Optional[bool] = None,
4371
4402
  profile: t.Optional[bool] = None,
4403
+ project_routing: t.Optional[str] = None,
4372
4404
  q: t.Optional[str] = None,
4373
4405
  query: t.Optional[t.Mapping[str, t.Any]] = None,
4374
4406
  rank: t.Optional[t.Mapping[str, t.Any]] = None,
@@ -4398,6 +4430,7 @@ class Elasticsearch(BaseClient):
4398
4430
  ]
4399
4431
  ] = None,
4400
4432
  source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None,
4433
+ source_exclude_vectors: t.Optional[bool] = None,
4401
4434
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4402
4435
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4403
4436
  stats: t.Optional[t.Sequence[str]] = None,
@@ -4465,8 +4498,8 @@ class Elasticsearch(BaseClient):
4465
4498
  node and the remote clusters are minimized when running cross-cluster search
4466
4499
  (CCS) requests.
4467
4500
  :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
4501
+ :param default_operator: The default operator for the query string query: `and`
4502
+ or `or`. This parameter can be used only when the `q` query string parameter
4470
4503
  is specified.
4471
4504
  :param df: The field to use as a default when no field prefix is given in the
4472
4505
  query string. This parameter can be used only when the `q` query string parameter
@@ -4551,6 +4584,10 @@ class Elasticsearch(BaseClient):
4551
4584
  :param profile: Set to `true` to return detailed timing information about the
4552
4585
  execution of individual components in a search request. NOTE: This is a debugging
4553
4586
  tool and adds significant overhead to search execution.
4587
+ :param project_routing: Specifies a subset of projects to target for the search
4588
+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
4589
+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
4590
+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
4554
4591
  :param q: A query in the Lucene query string syntax. Query parameter searches
4555
4592
  do not support the full Elasticsearch Query DSL but are handy for testing.
4556
4593
  IMPORTANT: This parameter overrides the query parameter in the request body.
@@ -4592,6 +4629,7 @@ class Elasticsearch(BaseClient):
4592
4629
  fields are returned in the `hits._source` property of the search response.
4593
4630
  If the `stored_fields` property is specified, the `_source` property defaults
4594
4631
  to `false`. Otherwise, it defaults to `true`.
4632
+ :param source_exclude_vectors: Whether vectors should be excluded from _source
4595
4633
  :param source_excludes: A comma-separated list of source fields to exclude from
4596
4634
  the response. You can also use this parameter to exclude fields from the
4597
4635
  subset specified in `_source_includes` query parameter. If the `_source`
@@ -4704,6 +4742,8 @@ class Elasticsearch(BaseClient):
4704
4742
  __query["preference"] = preference
4705
4743
  if pretty is not None:
4706
4744
  __query["pretty"] = pretty
4745
+ if project_routing is not None:
4746
+ __query["project_routing"] = project_routing
4707
4747
  if q is not None:
4708
4748
  __query["q"] = q
4709
4749
  if request_cache is not None:
@@ -4716,6 +4756,8 @@ class Elasticsearch(BaseClient):
4716
4756
  __query["scroll"] = scroll
4717
4757
  if search_type is not None:
4718
4758
  __query["search_type"] = search_type
4759
+ if source_exclude_vectors is not None:
4760
+ __query["_source_exclude_vectors"] = source_exclude_vectors
4719
4761
  if source_excludes is not None:
4720
4762
  __query["_source_excludes"] = source_excludes
4721
4763
  if source_includes is not None:
@@ -4856,6 +4898,7 @@ class Elasticsearch(BaseClient):
4856
4898
  ] = None,
4857
4899
  human: t.Optional[bool] = None,
4858
4900
  pretty: t.Optional[bool] = None,
4901
+ project_routing: t.Optional[str] = None,
4859
4902
  query: t.Optional[t.Mapping[str, t.Any]] = None,
4860
4903
  runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
4861
4904
  size: t.Optional[int] = None,
@@ -5173,6 +5216,10 @@ class Elasticsearch(BaseClient):
5173
5216
  In the aggs layer, each feature represents a `geotile_grid` cell. If `grid,
5174
5217
  each feature is a polygon of the cells bounding box. If `point`, each feature
5175
5218
  is a Point that is the centroid of the cell.
5219
+ :param project_routing: Specifies a subset of projects to target for the search
5220
+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
5221
+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
5222
+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
5176
5223
  :param query: The query DSL used to filter documents for the search.
5177
5224
  :param runtime_mappings: Defines one or more runtime fields in the search request.
5178
5225
  These fields take precedence over mapped fields with the same name.
@@ -5236,6 +5283,8 @@ class Elasticsearch(BaseClient):
5236
5283
  __query["human"] = human
5237
5284
  if pretty is not None:
5238
5285
  __query["pretty"] = pretty
5286
+ if project_routing is not None:
5287
+ __query["project_routing"] = project_routing
5239
5288
  if not __body:
5240
5289
  if aggs is not None:
5241
5290
  __body["aggs"] = aggs
@@ -5409,6 +5458,7 @@ class Elasticsearch(BaseClient):
5409
5458
  preference: t.Optional[str] = None,
5410
5459
  pretty: t.Optional[bool] = None,
5411
5460
  profile: t.Optional[bool] = None,
5461
+ project_routing: t.Optional[str] = None,
5412
5462
  rest_total_hits_as_int: t.Optional[bool] = None,
5413
5463
  routing: t.Optional[str] = None,
5414
5464
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -5454,6 +5504,10 @@ class Elasticsearch(BaseClient):
5454
5504
  :param preference: The node or shard the operation should be performed on. It
5455
5505
  is random by default.
5456
5506
  :param profile: If `true`, the query execution is profiled.
5507
+ :param project_routing: Specifies a subset of projects to target for the search
5508
+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
5509
+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
5510
+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
5457
5511
  :param rest_total_hits_as_int: If `true`, `hits.total` is rendered as an integer
5458
5512
  in the response. If `false`, it is rendered as an object.
5459
5513
  :param routing: A custom value used to route operations to a specific shard.
@@ -5495,6 +5549,8 @@ class Elasticsearch(BaseClient):
5495
5549
  __query["preference"] = preference
5496
5550
  if pretty is not None:
5497
5551
  __query["pretty"] = pretty
5552
+ if project_routing is not None:
5553
+ __query["project_routing"] = project_routing
5498
5554
  if rest_total_hits_as_int is not None:
5499
5555
  __query["rest_total_hits_as_int"] = rest_total_hits_as_int
5500
5556
  if routing is not None:
@@ -5621,11 +5677,7 @@ class Elasticsearch(BaseClient):
5621
5677
  __body["string"] = string
5622
5678
  if timeout is not None:
5623
5679
  __body["timeout"] = timeout
5624
- if not __body:
5625
- __body = None # type: ignore[assignment]
5626
- __headers = {"accept": "application/json"}
5627
- if __body is not None:
5628
- __headers["content-type"] = "application/json"
5680
+ __headers = {"accept": "application/json", "content-type": "application/json"}
5629
5681
  return self.perform_request( # type: ignore[return-value]
5630
5682
  "POST",
5631
5683
  __path,
@@ -5675,7 +5727,7 @@ class Elasticsearch(BaseClient):
5675
5727
  term_statistics: t.Optional[bool] = None,
5676
5728
  version: t.Optional[int] = None,
5677
5729
  version_type: t.Optional[
5678
- t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
5730
+ t.Union[str, t.Literal["external", "external_gte", "internal"]]
5679
5731
  ] = None,
5680
5732
  body: t.Optional[t.Dict[str, t.Any]] = None,
5681
5733
  ) -> ObjectApiResponse[t.Any]:
@@ -6151,8 +6203,8 @@ class Elasticsearch(BaseClient):
6151
6203
  be used only when the `q` query string parameter is specified.
6152
6204
  :param conflicts: The preferred behavior when update by query hits version conflicts:
6153
6205
  `abort` or `proceed`.
6154
- :param default_operator: The default operator for query string query: `AND` or
6155
- `OR`. This parameter can be used only when the `q` query string parameter
6206
+ :param default_operator: The default operator for query string query: `and` or
6207
+ `or`. This parameter can be used only when the `q` query string parameter
6156
6208
  is specified.
6157
6209
  :param df: The field to use as default where no field prefix is given in the
6158
6210
  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 (default: random)
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: