elasticsearch 8.13.2__py3-none-any.whl → 8.15.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 (96) hide show
  1. elasticsearch/_async/client/__init__.py +204 -169
  2. elasticsearch/_async/client/async_search.py +35 -20
  3. elasticsearch/_async/client/autoscaling.py +4 -4
  4. elasticsearch/_async/client/cat.py +785 -180
  5. elasticsearch/_async/client/ccr.py +20 -32
  6. elasticsearch/_async/client/cluster.py +94 -88
  7. elasticsearch/_async/client/connector.py +1470 -0
  8. elasticsearch/_async/client/dangling_indices.py +7 -11
  9. elasticsearch/_async/client/enrich.py +8 -8
  10. elasticsearch/_async/client/eql.py +17 -16
  11. elasticsearch/_async/client/esql.py +2 -2
  12. elasticsearch/_async/client/features.py +2 -2
  13. elasticsearch/_async/client/fleet.py +18 -17
  14. elasticsearch/_async/client/graph.py +4 -4
  15. elasticsearch/_async/client/ilm.py +36 -44
  16. elasticsearch/_async/client/indices.py +401 -411
  17. elasticsearch/_async/client/inference.py +65 -39
  18. elasticsearch/_async/client/ingest.py +22 -23
  19. elasticsearch/_async/client/license.py +18 -10
  20. elasticsearch/_async/client/logstash.py +6 -6
  21. elasticsearch/_async/client/migration.py +3 -3
  22. elasticsearch/_async/client/ml.py +383 -176
  23. elasticsearch/_async/client/monitoring.py +2 -2
  24. elasticsearch/_async/client/nodes.py +32 -32
  25. elasticsearch/_async/client/query_rules.py +384 -0
  26. elasticsearch/_async/client/rollup.py +13 -13
  27. elasticsearch/_async/client/search_application.py +15 -10
  28. elasticsearch/_async/client/searchable_snapshots.py +9 -13
  29. elasticsearch/_async/client/security.py +587 -104
  30. elasticsearch/_async/client/shutdown.py +7 -7
  31. elasticsearch/_async/client/slm.py +11 -13
  32. elasticsearch/_async/client/snapshot.py +39 -52
  33. elasticsearch/_async/client/sql.py +12 -14
  34. elasticsearch/_async/client/ssl.py +1 -1
  35. elasticsearch/_async/client/synonyms.py +8 -8
  36. elasticsearch/_async/client/tasks.py +9 -10
  37. elasticsearch/_async/client/text_structure.py +3 -3
  38. elasticsearch/_async/client/transform.py +89 -34
  39. elasticsearch/_async/client/watcher.py +30 -15
  40. elasticsearch/_async/client/xpack.py +6 -7
  41. elasticsearch/_otel.py +2 -6
  42. elasticsearch/_sync/client/__init__.py +204 -169
  43. elasticsearch/_sync/client/async_search.py +35 -20
  44. elasticsearch/_sync/client/autoscaling.py +4 -4
  45. elasticsearch/_sync/client/cat.py +785 -180
  46. elasticsearch/_sync/client/ccr.py +20 -32
  47. elasticsearch/_sync/client/cluster.py +94 -88
  48. elasticsearch/_sync/client/connector.py +1470 -0
  49. elasticsearch/_sync/client/dangling_indices.py +7 -11
  50. elasticsearch/_sync/client/enrich.py +8 -8
  51. elasticsearch/_sync/client/eql.py +17 -16
  52. elasticsearch/_sync/client/esql.py +2 -2
  53. elasticsearch/_sync/client/features.py +2 -2
  54. elasticsearch/_sync/client/fleet.py +18 -17
  55. elasticsearch/_sync/client/graph.py +4 -4
  56. elasticsearch/_sync/client/ilm.py +36 -44
  57. elasticsearch/_sync/client/indices.py +401 -411
  58. elasticsearch/_sync/client/inference.py +65 -39
  59. elasticsearch/_sync/client/ingest.py +22 -23
  60. elasticsearch/_sync/client/license.py +18 -10
  61. elasticsearch/_sync/client/logstash.py +6 -6
  62. elasticsearch/_sync/client/migration.py +3 -3
  63. elasticsearch/_sync/client/ml.py +383 -176
  64. elasticsearch/_sync/client/monitoring.py +2 -2
  65. elasticsearch/_sync/client/nodes.py +32 -32
  66. elasticsearch/_sync/client/query_rules.py +384 -0
  67. elasticsearch/_sync/client/rollup.py +13 -13
  68. elasticsearch/_sync/client/search_application.py +15 -10
  69. elasticsearch/_sync/client/searchable_snapshots.py +9 -13
  70. elasticsearch/_sync/client/security.py +587 -104
  71. elasticsearch/_sync/client/shutdown.py +7 -7
  72. elasticsearch/_sync/client/slm.py +11 -13
  73. elasticsearch/_sync/client/snapshot.py +39 -52
  74. elasticsearch/_sync/client/sql.py +12 -14
  75. elasticsearch/_sync/client/ssl.py +1 -1
  76. elasticsearch/_sync/client/synonyms.py +8 -8
  77. elasticsearch/_sync/client/tasks.py +9 -10
  78. elasticsearch/_sync/client/text_structure.py +3 -3
  79. elasticsearch/_sync/client/transform.py +89 -34
  80. elasticsearch/_sync/client/watcher.py +30 -15
  81. elasticsearch/_sync/client/xpack.py +6 -7
  82. elasticsearch/_version.py +1 -1
  83. elasticsearch/client.py +3 -3
  84. elasticsearch/helpers/vectorstore/_async/vectorstore.py +36 -6
  85. elasticsearch/helpers/vectorstore/_sync/vectorstore.py +36 -6
  86. elasticsearch/serializer.py +34 -1
  87. elasticsearch-8.15.0.dist-info/METADATA +177 -0
  88. elasticsearch-8.15.0.dist-info/RECORD +117 -0
  89. {elasticsearch-8.13.2.dist-info → elasticsearch-8.15.0.dist-info}/WHEEL +1 -2
  90. elasticsearch/_async/client/query_ruleset.py +0 -205
  91. elasticsearch/_sync/client/query_ruleset.py +0 -205
  92. elasticsearch-8.13.2.dist-info/METADATA +0 -147
  93. elasticsearch-8.13.2.dist-info/RECORD +0 -116
  94. elasticsearch-8.13.2.dist-info/top_level.txt +0 -1
  95. {elasticsearch-8.13.2.dist-info → elasticsearch-8.15.0.dist-info/licenses}/LICENSE +0 -0
  96. {elasticsearch-8.13.2.dist-info → elasticsearch-8.15.0.dist-info/licenses}/NOTICE +0 -0
@@ -46,6 +46,7 @@ from .autoscaling import AutoscalingClient
46
46
  from .cat import CatClient
47
47
  from .ccr import CcrClient
48
48
  from .cluster import ClusterClient
49
+ from .connector import ConnectorClient
49
50
  from .dangling_indices import DanglingIndicesClient
50
51
  from .enrich import EnrichClient
51
52
  from .eql import EqlClient
@@ -63,7 +64,7 @@ from .migration import MigrationClient
63
64
  from .ml import MlClient
64
65
  from .monitoring import MonitoringClient
65
66
  from .nodes import NodesClient
66
- from .query_ruleset import QueryRulesetClient
67
+ from .query_rules import QueryRulesClient
67
68
  from .rollup import RollupClient
68
69
  from .search_application import SearchApplicationClient
69
70
  from .searchable_snapshots import SearchableSnapshotsClient
@@ -352,7 +353,7 @@ class Elasticsearch(BaseClient):
352
353
  if node_class is not DEFAULT:
353
354
  transport_kwargs["node_class"] = node_class
354
355
  if node_pool_class is not DEFAULT:
355
- transport_kwargs["node_pool_class"] = node_class
356
+ transport_kwargs["node_pool_class"] = node_pool_class
356
357
  if randomize_nodes_in_pool is not DEFAULT:
357
358
  transport_kwargs["randomize_nodes_in_pool"] = randomize_nodes_in_pool
358
359
  if node_selector_class is not DEFAULT:
@@ -433,6 +434,7 @@ class Elasticsearch(BaseClient):
433
434
  self.autoscaling = AutoscalingClient(self)
434
435
  self.cat = CatClient(self)
435
436
  self.cluster = ClusterClient(self)
437
+ self.connector = ConnectorClient(self)
436
438
  self.fleet = FleetClient(self)
437
439
  self.features = FeaturesClient(self)
438
440
  self.indices = IndicesClient(self)
@@ -455,7 +457,7 @@ class Elasticsearch(BaseClient):
455
457
  self.migration = MigrationClient(self)
456
458
  self.ml = MlClient(self)
457
459
  self.monitoring = MonitoringClient(self)
458
- self.query_ruleset = QueryRulesetClient(self)
460
+ self.query_rules = QueryRulesClient(self)
459
461
  self.rollup = RollupClient(self)
460
462
  self.search_application = SearchApplicationClient(self)
461
463
  self.searchable_snapshots = SearchableSnapshotsClient(self)
@@ -623,22 +625,23 @@ class Elasticsearch(BaseClient):
623
625
  pipeline: t.Optional[str] = None,
624
626
  pretty: t.Optional[bool] = None,
625
627
  refresh: t.Optional[
626
- t.Union["t.Literal['false', 'true', 'wait_for']", bool, str]
628
+ t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
627
629
  ] = None,
628
630
  require_alias: t.Optional[bool] = None,
629
631
  routing: t.Optional[str] = None,
630
632
  source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
631
633
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
632
634
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
633
- timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
635
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
634
636
  wait_for_active_shards: t.Optional[
635
- t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
637
+ t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
636
638
  ] = None,
637
639
  ) -> ObjectApiResponse[t.Any]:
638
640
  """
639
- Allows to perform multiple index/update/delete operations in a single request.
641
+ Performs multiple indexing or delete operations in a single API call. This reduces
642
+ overhead and can greatly increase indexing speed.
640
643
 
641
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-bulk.html>`_
644
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-bulk.html>`_
642
645
 
643
646
  :param operations:
644
647
  :param index: Name of the data stream, index, or index alias to perform bulk
@@ -735,9 +738,9 @@ class Elasticsearch(BaseClient):
735
738
  body: t.Optional[t.Dict[str, t.Any]] = None,
736
739
  ) -> ObjectApiResponse[t.Any]:
737
740
  """
738
- Explicitly clears the search context for a scroll.
741
+ Clears the search context and results for a scrolling search.
739
742
 
740
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/clear-scroll-api.html>`_
743
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/clear-scroll-api.html>`_
741
744
 
742
745
  :param scroll_id: Scroll IDs to clear. To clear all scroll IDs, use `_all`.
743
746
  """
@@ -785,9 +788,9 @@ class Elasticsearch(BaseClient):
785
788
  body: t.Optional[t.Dict[str, t.Any]] = None,
786
789
  ) -> ObjectApiResponse[t.Any]:
787
790
  """
788
- Close a point in time
791
+ Closes a point-in-time.
789
792
 
790
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/point-in-time-api.html>`_
793
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/point-in-time-api.html>`_
791
794
 
792
795
  :param id: The ID of the point-in-time.
793
796
  """
@@ -833,15 +836,15 @@ class Elasticsearch(BaseClient):
833
836
  allow_no_indices: t.Optional[bool] = None,
834
837
  analyze_wildcard: t.Optional[bool] = None,
835
838
  analyzer: t.Optional[str] = None,
836
- default_operator: t.Optional[t.Union["t.Literal['and', 'or']", str]] = None,
839
+ default_operator: t.Optional[t.Union[str, t.Literal["and", "or"]]] = None,
837
840
  df: t.Optional[str] = None,
838
841
  error_trace: t.Optional[bool] = None,
839
842
  expand_wildcards: t.Optional[
840
843
  t.Union[
841
844
  t.Sequence[
842
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str]
845
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
843
846
  ],
844
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
847
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
845
848
  ]
846
849
  ] = None,
847
850
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -861,7 +864,7 @@ class Elasticsearch(BaseClient):
861
864
  """
862
865
  Returns number of documents matching a query.
863
866
 
864
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-count.html>`_
867
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-count.html>`_
865
868
 
866
869
  :param index: Comma-separated list of data streams, indices, and aliases to search.
867
870
  Supports wildcards (`*`). To search all data streams and indices, omit this
@@ -979,23 +982,24 @@ class Elasticsearch(BaseClient):
979
982
  pipeline: t.Optional[str] = None,
980
983
  pretty: t.Optional[bool] = None,
981
984
  refresh: t.Optional[
982
- t.Union["t.Literal['false', 'true', 'wait_for']", bool, str]
985
+ t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
983
986
  ] = None,
984
987
  routing: t.Optional[str] = None,
985
- timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
988
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
986
989
  version: t.Optional[int] = None,
987
990
  version_type: t.Optional[
988
- t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str]
991
+ t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
989
992
  ] = None,
990
993
  wait_for_active_shards: t.Optional[
991
- t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
994
+ t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
992
995
  ] = None,
993
996
  ) -> ObjectApiResponse[t.Any]:
994
997
  """
995
- Creates a new document in the index. Returns a 409 response when a document with
996
- a same ID already exists in the index.
998
+ Adds a JSON document to the specified data stream or index and makes it searchable.
999
+ If the target is an index and the document already exists, the request updates
1000
+ the document and increments its version.
997
1001
 
998
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-index_.html>`_
1002
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-index_.html>`_
999
1003
 
1000
1004
  :param index: Name of the data stream or index to target. If the target doesn’t
1001
1005
  exist and matches the name or wildcard (`*`) pattern of an index template
@@ -1084,22 +1088,22 @@ class Elasticsearch(BaseClient):
1084
1088
  if_seq_no: t.Optional[int] = None,
1085
1089
  pretty: t.Optional[bool] = None,
1086
1090
  refresh: t.Optional[
1087
- t.Union["t.Literal['false', 'true', 'wait_for']", bool, str]
1091
+ t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
1088
1092
  ] = None,
1089
1093
  routing: t.Optional[str] = None,
1090
- timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
1094
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1091
1095
  version: t.Optional[int] = None,
1092
1096
  version_type: t.Optional[
1093
- t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str]
1097
+ t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
1094
1098
  ] = None,
1095
1099
  wait_for_active_shards: t.Optional[
1096
- t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
1100
+ t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
1097
1101
  ] = None,
1098
1102
  ) -> ObjectApiResponse[t.Any]:
1099
1103
  """
1100
- Removes a document from the index.
1104
+ Removes a JSON document from the specified index.
1101
1105
 
1102
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-delete.html>`_
1106
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-delete.html>`_
1103
1107
 
1104
1108
  :param index: Name of the target index.
1105
1109
  :param id: Unique identifier for the document.
@@ -1173,16 +1177,16 @@ class Elasticsearch(BaseClient):
1173
1177
  allow_no_indices: t.Optional[bool] = None,
1174
1178
  analyze_wildcard: t.Optional[bool] = None,
1175
1179
  analyzer: t.Optional[str] = None,
1176
- conflicts: t.Optional[t.Union["t.Literal['abort', 'proceed']", str]] = None,
1177
- default_operator: t.Optional[t.Union["t.Literal['and', 'or']", str]] = None,
1180
+ conflicts: t.Optional[t.Union[str, t.Literal["abort", "proceed"]]] = None,
1181
+ default_operator: t.Optional[t.Union[str, t.Literal["and", "or"]]] = None,
1178
1182
  df: t.Optional[str] = None,
1179
1183
  error_trace: t.Optional[bool] = None,
1180
1184
  expand_wildcards: t.Optional[
1181
1185
  t.Union[
1182
1186
  t.Sequence[
1183
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str]
1187
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
1184
1188
  ],
1185
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
1189
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
1186
1190
  ]
1187
1191
  ] = None,
1188
1192
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -1199,31 +1203,29 @@ class Elasticsearch(BaseClient):
1199
1203
  request_cache: t.Optional[bool] = None,
1200
1204
  requests_per_second: t.Optional[float] = None,
1201
1205
  routing: t.Optional[str] = None,
1202
- scroll: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
1206
+ scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1203
1207
  scroll_size: t.Optional[int] = None,
1204
- search_timeout: t.Optional[
1205
- t.Union["t.Literal[-1]", "t.Literal[0]", str]
1206
- ] = None,
1208
+ search_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1207
1209
  search_type: t.Optional[
1208
- t.Union["t.Literal['dfs_query_then_fetch', 'query_then_fetch']", str]
1210
+ t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
1209
1211
  ] = None,
1210
1212
  slice: t.Optional[t.Mapping[str, t.Any]] = None,
1211
- slices: t.Optional[t.Union[int, t.Union["t.Literal['auto']", str]]] = None,
1213
+ slices: t.Optional[t.Union[int, t.Union[str, t.Literal["auto"]]]] = None,
1212
1214
  sort: t.Optional[t.Sequence[str]] = None,
1213
1215
  stats: t.Optional[t.Sequence[str]] = None,
1214
1216
  terminate_after: t.Optional[int] = None,
1215
- timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
1217
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1216
1218
  version: t.Optional[bool] = None,
1217
1219
  wait_for_active_shards: t.Optional[
1218
- t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
1220
+ t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
1219
1221
  ] = None,
1220
1222
  wait_for_completion: t.Optional[bool] = None,
1221
1223
  body: t.Optional[t.Dict[str, t.Any]] = None,
1222
1224
  ) -> ObjectApiResponse[t.Any]:
1223
1225
  """
1224
- Deletes documents matching the provided query.
1226
+ Deletes documents that match the specified query.
1225
1227
 
1226
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-delete-by-query.html>`_
1228
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-delete-by-query.html>`_
1227
1229
 
1228
1230
  :param index: Comma-separated list of data streams, indices, and aliases to search.
1229
1231
  Supports wildcards (`*`). To search all data streams or indices, omit this
@@ -1401,7 +1403,7 @@ class Elasticsearch(BaseClient):
1401
1403
  """
1402
1404
  Changes the number of requests per second for a particular Delete By Query operation.
1403
1405
 
1404
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-delete-by-query.html>`_
1406
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-delete-by-query.html>`_
1405
1407
 
1406
1408
  :param task_id: The ID for the task.
1407
1409
  :param requests_per_second: The throttle for this request in sub-requests per
@@ -1440,16 +1442,14 @@ class Elasticsearch(BaseClient):
1440
1442
  error_trace: t.Optional[bool] = None,
1441
1443
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1442
1444
  human: t.Optional[bool] = None,
1443
- master_timeout: t.Optional[
1444
- t.Union["t.Literal[-1]", "t.Literal[0]", str]
1445
- ] = None,
1445
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1446
1446
  pretty: t.Optional[bool] = None,
1447
- timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
1447
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1448
1448
  ) -> ObjectApiResponse[t.Any]:
1449
1449
  """
1450
- Deletes a script.
1450
+ Deletes a stored script or search template.
1451
1451
 
1452
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-scripting.html>`_
1452
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/modules-scripting.html>`_
1453
1453
 
1454
1454
  :param id: Identifier for the stored script or search template.
1455
1455
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -1511,13 +1511,13 @@ class Elasticsearch(BaseClient):
1511
1511
  stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1512
1512
  version: t.Optional[int] = None,
1513
1513
  version_type: t.Optional[
1514
- t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str]
1514
+ t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
1515
1515
  ] = None,
1516
1516
  ) -> HeadApiResponse:
1517
1517
  """
1518
- Returns information about whether a document exists in an index.
1518
+ Checks if a document in an index exists.
1519
1519
 
1520
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-get.html>`_
1520
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-get.html>`_
1521
1521
 
1522
1522
  :param index: Comma-separated list of data streams, indices, and aliases. Supports
1523
1523
  wildcards (`*`).
@@ -1612,13 +1612,13 @@ class Elasticsearch(BaseClient):
1612
1612
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1613
1613
  version: t.Optional[int] = None,
1614
1614
  version_type: t.Optional[
1615
- t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str]
1615
+ t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
1616
1616
  ] = None,
1617
1617
  ) -> HeadApiResponse:
1618
1618
  """
1619
- Returns information about whether a document source exists in an index.
1619
+ Checks if a document's `_source` is stored.
1620
1620
 
1621
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-get.html>`_
1621
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-get.html>`_
1622
1622
 
1623
1623
  :param index: Comma-separated list of data streams, indices, and aliases. Supports
1624
1624
  wildcards (`*`).
@@ -1698,7 +1698,7 @@ class Elasticsearch(BaseClient):
1698
1698
  id: str,
1699
1699
  analyze_wildcard: t.Optional[bool] = None,
1700
1700
  analyzer: t.Optional[str] = None,
1701
- default_operator: t.Optional[t.Union["t.Literal['and', 'or']", str]] = None,
1701
+ default_operator: t.Optional[t.Union[str, t.Literal["and", "or"]]] = None,
1702
1702
  df: t.Optional[str] = None,
1703
1703
  error_trace: t.Optional[bool] = None,
1704
1704
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -1716,9 +1716,10 @@ class Elasticsearch(BaseClient):
1716
1716
  body: t.Optional[t.Dict[str, t.Any]] = None,
1717
1717
  ) -> ObjectApiResponse[t.Any]:
1718
1718
  """
1719
- Returns information about why a specific matches (or doesn't match) a query.
1719
+ Returns information about why a specific document matches (or doesnt match)
1720
+ a query.
1720
1721
 
1721
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-explain.html>`_
1722
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-explain.html>`_
1722
1723
 
1723
1724
  :param index: Index names used to limit the request. Only a single index name
1724
1725
  can be provided to this parameter.
@@ -1816,9 +1817,9 @@ class Elasticsearch(BaseClient):
1816
1817
  expand_wildcards: t.Optional[
1817
1818
  t.Union[
1818
1819
  t.Sequence[
1819
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str]
1820
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
1820
1821
  ],
1821
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
1822
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
1822
1823
  ]
1823
1824
  ] = None,
1824
1825
  fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -1835,9 +1836,12 @@ class Elasticsearch(BaseClient):
1835
1836
  body: t.Optional[t.Dict[str, t.Any]] = None,
1836
1837
  ) -> ObjectApiResponse[t.Any]:
1837
1838
  """
1838
- Returns the information about the capabilities of fields among multiple indices.
1839
+ The field capabilities API returns the information about the capabilities of
1840
+ fields among multiple indices. The field capabilities API returns runtime fields
1841
+ like any other field. For example, a runtime field with a type of keyword is
1842
+ returned as any other field that belongs to the `keyword` family.
1839
1843
 
1840
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-field-caps.html>`_
1844
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-field-caps.html>`_
1841
1845
 
1842
1846
  :param index: Comma-separated list of data streams, indices, and aliases used
1843
1847
  to limit the request. Supports wildcards (*). To target all data streams
@@ -1947,13 +1951,13 @@ class Elasticsearch(BaseClient):
1947
1951
  stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1948
1952
  version: t.Optional[int] = None,
1949
1953
  version_type: t.Optional[
1950
- t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str]
1954
+ t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
1951
1955
  ] = None,
1952
1956
  ) -> ObjectApiResponse[t.Any]:
1953
1957
  """
1954
1958
  Returns a document.
1955
1959
 
1956
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-get.html>`_
1960
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-get.html>`_
1957
1961
 
1958
1962
  :param index: Name of the index that contains the document.
1959
1963
  :param id: Unique identifier of the document.
@@ -2036,15 +2040,13 @@ class Elasticsearch(BaseClient):
2036
2040
  error_trace: t.Optional[bool] = None,
2037
2041
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2038
2042
  human: t.Optional[bool] = None,
2039
- master_timeout: t.Optional[
2040
- t.Union["t.Literal[-1]", "t.Literal[0]", str]
2041
- ] = None,
2043
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2042
2044
  pretty: t.Optional[bool] = None,
2043
2045
  ) -> ObjectApiResponse[t.Any]:
2044
2046
  """
2045
- Returns a script.
2047
+ Retrieves a stored script or search template.
2046
2048
 
2047
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-scripting.html>`_
2049
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/modules-scripting.html>`_
2048
2050
 
2049
2051
  :param id: Identifier for the stored script or search template.
2050
2052
  :param master_timeout: Specify timeout for connection to master
@@ -2086,7 +2088,7 @@ class Elasticsearch(BaseClient):
2086
2088
  """
2087
2089
  Returns all script contexts.
2088
2090
 
2089
- `<https://www.elastic.co/guide/en/elasticsearch/painless/8.13/painless-contexts.html>`_
2091
+ `<https://www.elastic.co/guide/en/elasticsearch/painless/8.15/painless-contexts.html>`_
2090
2092
  """
2091
2093
  __path_parts: t.Dict[str, str] = {}
2092
2094
  __path = "/_script_context"
@@ -2121,7 +2123,7 @@ class Elasticsearch(BaseClient):
2121
2123
  """
2122
2124
  Returns available script types, languages and contexts
2123
2125
 
2124
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-scripting.html>`_
2126
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/modules-scripting.html>`_
2125
2127
  """
2126
2128
  __path_parts: t.Dict[str, str] = {}
2127
2129
  __path = "/_script_language"
@@ -2170,13 +2172,13 @@ class Elasticsearch(BaseClient):
2170
2172
  stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2171
2173
  version: t.Optional[int] = None,
2172
2174
  version_type: t.Optional[
2173
- t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str]
2175
+ t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
2174
2176
  ] = None,
2175
2177
  ) -> ObjectApiResponse[t.Any]:
2176
2178
  """
2177
2179
  Returns the source of a document.
2178
2180
 
2179
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-get.html>`_
2181
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-get.html>`_
2180
2182
 
2181
2183
  :param index: Name of the index that contains the document.
2182
2184
  :param id: Unique identifier of the document.
@@ -2253,13 +2255,13 @@ class Elasticsearch(BaseClient):
2253
2255
  human: t.Optional[bool] = None,
2254
2256
  pretty: t.Optional[bool] = None,
2255
2257
  size: t.Optional[int] = None,
2256
- timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
2258
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2257
2259
  verbose: t.Optional[bool] = None,
2258
2260
  ) -> ObjectApiResponse[t.Any]:
2259
2261
  """
2260
2262
  Returns the health of the cluster.
2261
2263
 
2262
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/health-api.html>`_
2264
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/health-api.html>`_
2263
2265
 
2264
2266
  :param feature: A feature of the cluster, as returned by the top-level health
2265
2267
  report API.
@@ -2314,27 +2316,29 @@ class Elasticsearch(BaseClient):
2314
2316
  human: t.Optional[bool] = None,
2315
2317
  if_primary_term: t.Optional[int] = None,
2316
2318
  if_seq_no: t.Optional[int] = None,
2317
- op_type: t.Optional[t.Union["t.Literal['create', 'index']", str]] = None,
2319
+ op_type: t.Optional[t.Union[str, t.Literal["create", "index"]]] = None,
2318
2320
  pipeline: t.Optional[str] = None,
2319
2321
  pretty: t.Optional[bool] = None,
2320
2322
  refresh: t.Optional[
2321
- t.Union["t.Literal['false', 'true', 'wait_for']", bool, str]
2323
+ t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
2322
2324
  ] = None,
2323
2325
  require_alias: t.Optional[bool] = None,
2324
2326
  routing: t.Optional[str] = None,
2325
- timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
2327
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2326
2328
  version: t.Optional[int] = None,
2327
2329
  version_type: t.Optional[
2328
- t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str]
2330
+ t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
2329
2331
  ] = None,
2330
2332
  wait_for_active_shards: t.Optional[
2331
- t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
2333
+ t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
2332
2334
  ] = None,
2333
2335
  ) -> ObjectApiResponse[t.Any]:
2334
2336
  """
2335
- Creates or updates a document in an index.
2337
+ Adds a JSON document to the specified data stream or index and makes it searchable.
2338
+ If the target is an index and the document already exists, the request updates
2339
+ the document and increments its version.
2336
2340
 
2337
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-index_.html>`_
2341
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-index_.html>`_
2338
2342
 
2339
2343
  :param index: Name of the data stream or index to target.
2340
2344
  :param document:
@@ -2443,7 +2447,7 @@ class Elasticsearch(BaseClient):
2443
2447
  """
2444
2448
  Returns basic information about the cluster.
2445
2449
 
2446
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/index.html>`_
2450
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/index.html>`_
2447
2451
  """
2448
2452
  __path_parts: t.Dict[str, str] = {}
2449
2453
  __path = "/"
@@ -2499,7 +2503,7 @@ class Elasticsearch(BaseClient):
2499
2503
  """
2500
2504
  Performs a kNN search.
2501
2505
 
2502
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-search.html>`_
2506
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-search.html>`_
2503
2507
 
2504
2508
  :param index: A comma-separated list of index names to search; use `_all` or
2505
2509
  to perform the operation on all indices
@@ -2600,7 +2604,7 @@ class Elasticsearch(BaseClient):
2600
2604
  """
2601
2605
  Allows to get multiple documents in one request.
2602
2606
 
2603
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-multi-get.html>`_
2607
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-multi-get.html>`_
2604
2608
 
2605
2609
  :param index: Name of the index to retrieve documents from when `ids` are specified,
2606
2610
  or when a document in the `docs` array does not specify an index.
@@ -2697,15 +2701,16 @@ class Elasticsearch(BaseClient):
2697
2701
  expand_wildcards: t.Optional[
2698
2702
  t.Union[
2699
2703
  t.Sequence[
2700
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str]
2704
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
2701
2705
  ],
2702
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
2706
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
2703
2707
  ]
2704
2708
  ] = None,
2705
2709
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2706
2710
  human: t.Optional[bool] = None,
2707
2711
  ignore_throttled: t.Optional[bool] = None,
2708
2712
  ignore_unavailable: t.Optional[bool] = None,
2713
+ include_named_queries_score: t.Optional[bool] = None,
2709
2714
  max_concurrent_searches: t.Optional[int] = None,
2710
2715
  max_concurrent_shard_requests: t.Optional[int] = None,
2711
2716
  pre_filter_shard_size: t.Optional[int] = None,
@@ -2713,14 +2718,14 @@ class Elasticsearch(BaseClient):
2713
2718
  rest_total_hits_as_int: t.Optional[bool] = None,
2714
2719
  routing: t.Optional[str] = None,
2715
2720
  search_type: t.Optional[
2716
- t.Union["t.Literal['dfs_query_then_fetch', 'query_then_fetch']", str]
2721
+ t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
2717
2722
  ] = None,
2718
2723
  typed_keys: t.Optional[bool] = None,
2719
2724
  ) -> ObjectApiResponse[t.Any]:
2720
2725
  """
2721
2726
  Allows to execute several search operations in one request.
2722
2727
 
2723
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-multi-search.html>`_
2728
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-multi-search.html>`_
2724
2729
 
2725
2730
  :param searches:
2726
2731
  :param index: Comma-separated list of data streams, indices, and index aliases
@@ -2739,6 +2744,13 @@ class Elasticsearch(BaseClient):
2739
2744
  when frozen.
2740
2745
  :param ignore_unavailable: If true, missing or closed indices are not included
2741
2746
  in the response.
2747
+ :param include_named_queries_score: Indicates whether hit.matched_queries should
2748
+ be rendered as a map that includes the name of the matched query associated
2749
+ with its score (true) or as an array containing the name of the matched queries
2750
+ (false) This functionality reruns each named query on every hit in a search
2751
+ response. Typically, this adds a small overhead to a request. However, using
2752
+ computationally expensive named queries on a large number of hits may add
2753
+ significant overhead.
2742
2754
  :param max_concurrent_searches: Maximum number of concurrent searches the multi
2743
2755
  search API can execute.
2744
2756
  :param max_concurrent_shard_requests: Maximum number of concurrent shard requests
@@ -2788,6 +2800,8 @@ class Elasticsearch(BaseClient):
2788
2800
  __query["ignore_throttled"] = ignore_throttled
2789
2801
  if ignore_unavailable is not None:
2790
2802
  __query["ignore_unavailable"] = ignore_unavailable
2803
+ if include_named_queries_score is not None:
2804
+ __query["include_named_queries_score"] = include_named_queries_score
2791
2805
  if max_concurrent_searches is not None:
2792
2806
  __query["max_concurrent_searches"] = max_concurrent_searches
2793
2807
  if max_concurrent_shard_requests is not None:
@@ -2836,14 +2850,14 @@ class Elasticsearch(BaseClient):
2836
2850
  pretty: t.Optional[bool] = None,
2837
2851
  rest_total_hits_as_int: t.Optional[bool] = None,
2838
2852
  search_type: t.Optional[
2839
- t.Union["t.Literal['dfs_query_then_fetch', 'query_then_fetch']", str]
2853
+ t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
2840
2854
  ] = None,
2841
2855
  typed_keys: t.Optional[bool] = None,
2842
2856
  ) -> ObjectApiResponse[t.Any]:
2843
2857
  """
2844
- Allows to execute several search template operations in one request.
2858
+ Runs multiple templated searches with a single request.
2845
2859
 
2846
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-multi-search.html>`_
2860
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-multi-search.html>`_
2847
2861
 
2848
2862
  :param search_templates:
2849
2863
  :param index: Comma-separated list of data streams, indices, and aliases to search.
@@ -2931,14 +2945,14 @@ class Elasticsearch(BaseClient):
2931
2945
  term_statistics: t.Optional[bool] = None,
2932
2946
  version: t.Optional[int] = None,
2933
2947
  version_type: t.Optional[
2934
- t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str]
2948
+ t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
2935
2949
  ] = None,
2936
2950
  body: t.Optional[t.Dict[str, t.Any]] = None,
2937
2951
  ) -> ObjectApiResponse[t.Any]:
2938
2952
  """
2939
2953
  Returns multiple termvectors in one request.
2940
2954
 
2941
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-multi-termvectors.html>`_
2955
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-multi-termvectors.html>`_
2942
2956
 
2943
2957
  :param index: Name of the index that contains the documents.
2944
2958
  :param docs: Array of existing or artificial documents.
@@ -3025,14 +3039,14 @@ class Elasticsearch(BaseClient):
3025
3039
  self,
3026
3040
  *,
3027
3041
  index: t.Union[str, t.Sequence[str]],
3028
- keep_alive: t.Union["t.Literal[-1]", "t.Literal[0]", str],
3042
+ keep_alive: t.Union[str, t.Literal[-1], t.Literal[0]],
3029
3043
  error_trace: t.Optional[bool] = None,
3030
3044
  expand_wildcards: t.Optional[
3031
3045
  t.Union[
3032
3046
  t.Sequence[
3033
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str]
3047
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
3034
3048
  ],
3035
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
3049
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
3036
3050
  ]
3037
3051
  ] = None,
3038
3052
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -3043,9 +3057,15 @@ class Elasticsearch(BaseClient):
3043
3057
  routing: t.Optional[str] = None,
3044
3058
  ) -> ObjectApiResponse[t.Any]:
3045
3059
  """
3046
- Open a point in time that can be used in subsequent searches
3060
+ A search request by default executes against the most recent visible data of
3061
+ the target indices, which is called point in time. Elasticsearch pit (point in
3062
+ time) is a lightweight view into the state of the data as it existed when initiated.
3063
+ In some cases, it’s preferred to perform multiple search requests using the same
3064
+ point in time. For example, if refreshes happen between `search_after` requests,
3065
+ then the results of those requests might not be consistent as changes happening
3066
+ between searches are only visible to the more recent point in time.
3047
3067
 
3048
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/point-in-time-api.html>`_
3068
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/point-in-time-api.html>`_
3049
3069
 
3050
3070
  :param index: A comma-separated list of index names to open point in time; use
3051
3071
  `_all` or empty string to perform the operation on all indices
@@ -3107,17 +3127,15 @@ class Elasticsearch(BaseClient):
3107
3127
  error_trace: t.Optional[bool] = None,
3108
3128
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3109
3129
  human: t.Optional[bool] = None,
3110
- master_timeout: t.Optional[
3111
- t.Union["t.Literal[-1]", "t.Literal[0]", str]
3112
- ] = None,
3130
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3113
3131
  pretty: t.Optional[bool] = None,
3114
- timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
3132
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3115
3133
  body: t.Optional[t.Dict[str, t.Any]] = None,
3116
3134
  ) -> ObjectApiResponse[t.Any]:
3117
3135
  """
3118
- Creates or updates a script.
3136
+ Creates or updates a stored script or search template.
3119
3137
 
3120
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-scripting.html>`_
3138
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/modules-scripting.html>`_
3121
3139
 
3122
3140
  :param id: Identifier for the stored script or search template. Must be unique
3123
3141
  within the cluster.
@@ -3186,9 +3204,9 @@ class Elasticsearch(BaseClient):
3186
3204
  expand_wildcards: t.Optional[
3187
3205
  t.Union[
3188
3206
  t.Sequence[
3189
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str]
3207
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
3190
3208
  ],
3191
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
3209
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
3192
3210
  ]
3193
3211
  ] = None,
3194
3212
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -3200,10 +3218,10 @@ class Elasticsearch(BaseClient):
3200
3218
  body: t.Optional[t.Dict[str, t.Any]] = None,
3201
3219
  ) -> ObjectApiResponse[t.Any]:
3202
3220
  """
3203
- Allows to evaluate the quality of ranked search results over a set of typical
3204
- search queries
3221
+ Enables you to evaluate the quality of ranked search results over a set of typical
3222
+ search queries.
3205
3223
 
3206
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-rank-eval.html>`_
3224
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-rank-eval.html>`_
3207
3225
 
3208
3226
  :param requests: A set of typical search requests, together with their provided
3209
3227
  ratings.
@@ -3274,7 +3292,7 @@ class Elasticsearch(BaseClient):
3274
3292
  *,
3275
3293
  dest: t.Optional[t.Mapping[str, t.Any]] = None,
3276
3294
  source: t.Optional[t.Mapping[str, t.Any]] = None,
3277
- conflicts: t.Optional[t.Union["t.Literal['abort', 'proceed']", str]] = None,
3295
+ conflicts: t.Optional[t.Union[str, t.Literal["abort", "proceed"]]] = None,
3278
3296
  error_trace: t.Optional[bool] = None,
3279
3297
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3280
3298
  human: t.Optional[bool] = None,
@@ -3284,12 +3302,12 @@ class Elasticsearch(BaseClient):
3284
3302
  requests_per_second: t.Optional[float] = None,
3285
3303
  require_alias: t.Optional[bool] = None,
3286
3304
  script: t.Optional[t.Mapping[str, t.Any]] = None,
3287
- scroll: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
3305
+ scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3288
3306
  size: t.Optional[int] = None,
3289
- slices: t.Optional[t.Union[int, t.Union["t.Literal['auto']", str]]] = None,
3290
- timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
3307
+ slices: t.Optional[t.Union[int, t.Union[str, t.Literal["auto"]]]] = None,
3308
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3291
3309
  wait_for_active_shards: t.Optional[
3292
- t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
3310
+ t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
3293
3311
  ] = None,
3294
3312
  wait_for_completion: t.Optional[bool] = None,
3295
3313
  body: t.Optional[t.Dict[str, t.Any]] = None,
@@ -3299,7 +3317,7 @@ class Elasticsearch(BaseClient):
3299
3317
  source documents by a query, changing the destination index settings, or fetching
3300
3318
  the documents from a remote cluster.
3301
3319
 
3302
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-reindex.html>`_
3320
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-reindex.html>`_
3303
3321
 
3304
3322
  :param dest: The destination you are copying to.
3305
3323
  :param source: The source you are copying from.
@@ -3393,9 +3411,9 @@ class Elasticsearch(BaseClient):
3393
3411
  requests_per_second: t.Optional[float] = None,
3394
3412
  ) -> ObjectApiResponse[t.Any]:
3395
3413
  """
3396
- Changes the number of requests per second for a particular Reindex operation.
3414
+ Copies documents from a source to a destination.
3397
3415
 
3398
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-reindex.html>`_
3416
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-reindex.html>`_
3399
3417
 
3400
3418
  :param task_id: Identifier for the task.
3401
3419
  :param requests_per_second: The throttle for this request in sub-requests per
@@ -3444,9 +3462,9 @@ class Elasticsearch(BaseClient):
3444
3462
  body: t.Optional[t.Dict[str, t.Any]] = None,
3445
3463
  ) -> ObjectApiResponse[t.Any]:
3446
3464
  """
3447
- Allows to use the Mustache language to pre-render a search definition.
3465
+ Renders a search template as a search request body.
3448
3466
 
3449
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/render-search-template-api.html>`_
3467
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/render-search-template-api.html>`_
3450
3468
 
3451
3469
  :param id: ID of the search template to render. If no `source` is specified,
3452
3470
  this or the `id` request body parameter is required.
@@ -3512,9 +3530,9 @@ class Elasticsearch(BaseClient):
3512
3530
  body: t.Optional[t.Dict[str, t.Any]] = None,
3513
3531
  ) -> ObjectApiResponse[t.Any]:
3514
3532
  """
3515
- Allows an arbitrary script to be executed and a result to be returned
3533
+ Runs a script and returns a result.
3516
3534
 
3517
- `<https://www.elastic.co/guide/en/elasticsearch/painless/8.13/painless-execute-api.html>`_
3535
+ `<https://www.elastic.co/guide/en/elasticsearch/painless/8.15/painless-execute-api.html>`_
3518
3536
 
3519
3537
  :param context: The context that the script should run in.
3520
3538
  :param context_setup: Additional parameters for the `context`.
@@ -3566,13 +3584,13 @@ class Elasticsearch(BaseClient):
3566
3584
  human: t.Optional[bool] = None,
3567
3585
  pretty: t.Optional[bool] = None,
3568
3586
  rest_total_hits_as_int: t.Optional[bool] = None,
3569
- scroll: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
3587
+ scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3570
3588
  body: t.Optional[t.Dict[str, t.Any]] = None,
3571
3589
  ) -> ObjectApiResponse[t.Any]:
3572
3590
  """
3573
3591
  Allows to retrieve a large numbers of results from a single search request.
3574
3592
 
3575
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-request-body.html#request-body-search-scroll>`_
3593
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-request-body.html#request-body-search-scroll>`_
3576
3594
 
3577
3595
  :param scroll_id: Scroll ID of the search.
3578
3596
  :param rest_total_hits_as_int: If true, the API response’s hit.total property
@@ -3636,6 +3654,7 @@ class Elasticsearch(BaseClient):
3636
3654
  "query",
3637
3655
  "rank",
3638
3656
  "rescore",
3657
+ "retriever",
3639
3658
  "runtime_mappings",
3640
3659
  "script_fields",
3641
3660
  "search_after",
@@ -3673,16 +3692,16 @@ class Elasticsearch(BaseClient):
3673
3692
  batched_reduce_size: t.Optional[int] = None,
3674
3693
  ccs_minimize_roundtrips: t.Optional[bool] = None,
3675
3694
  collapse: t.Optional[t.Mapping[str, t.Any]] = None,
3676
- default_operator: t.Optional[t.Union["t.Literal['and', 'or']", str]] = None,
3695
+ default_operator: t.Optional[t.Union[str, t.Literal["and", "or"]]] = None,
3677
3696
  df: t.Optional[str] = None,
3678
3697
  docvalue_fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
3679
3698
  error_trace: t.Optional[bool] = None,
3680
3699
  expand_wildcards: t.Optional[
3681
3700
  t.Union[
3682
3701
  t.Sequence[
3683
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str]
3702
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
3684
3703
  ],
3685
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
3704
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
3686
3705
  ]
3687
3706
  ] = None,
3688
3707
  explain: t.Optional[bool] = None,
@@ -3695,6 +3714,7 @@ class Elasticsearch(BaseClient):
3695
3714
  human: t.Optional[bool] = None,
3696
3715
  ignore_throttled: t.Optional[bool] = None,
3697
3716
  ignore_unavailable: t.Optional[bool] = None,
3717
+ include_named_queries_score: t.Optional[bool] = None,
3698
3718
  indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None,
3699
3719
  knn: t.Optional[
3700
3720
  t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
@@ -3717,15 +3737,16 @@ class Elasticsearch(BaseClient):
3717
3737
  t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
3718
3738
  ] = None,
3719
3739
  rest_total_hits_as_int: t.Optional[bool] = None,
3740
+ retriever: t.Optional[t.Mapping[str, t.Any]] = None,
3720
3741
  routing: t.Optional[str] = None,
3721
3742
  runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
3722
3743
  script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
3723
- scroll: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
3744
+ scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3724
3745
  search_after: t.Optional[
3725
3746
  t.Sequence[t.Union[None, bool, float, int, str, t.Any]]
3726
3747
  ] = None,
3727
3748
  search_type: t.Optional[
3728
- t.Union["t.Literal['dfs_query_then_fetch', 'query_then_fetch']", str]
3749
+ t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
3729
3750
  ] = None,
3730
3751
  seq_no_primary_term: t.Optional[bool] = None,
3731
3752
  size: t.Optional[int] = None,
@@ -3744,7 +3765,7 @@ class Elasticsearch(BaseClient):
3744
3765
  suggest: t.Optional[t.Mapping[str, t.Any]] = None,
3745
3766
  suggest_field: t.Optional[str] = None,
3746
3767
  suggest_mode: t.Optional[
3747
- t.Union["t.Literal['always', 'missing', 'popular']", str]
3768
+ t.Union[str, t.Literal["always", "missing", "popular"]]
3748
3769
  ] = None,
3749
3770
  suggest_size: t.Optional[int] = None,
3750
3771
  suggest_text: t.Optional[str] = None,
@@ -3757,9 +3778,11 @@ class Elasticsearch(BaseClient):
3757
3778
  body: t.Optional[t.Dict[str, t.Any]] = None,
3758
3779
  ) -> ObjectApiResponse[t.Any]:
3759
3780
  """
3760
- Returns results matching a query.
3781
+ Returns search hits that match the query defined in the request. You can provide
3782
+ search queries using the `q` query string parameter or the request body. If both
3783
+ are specified, only the query parameter is used.
3761
3784
 
3762
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-search.html>`_
3785
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-search.html>`_
3763
3786
 
3764
3787
  :param index: Comma-separated list of data streams, indices, and aliases to search.
3765
3788
  Supports wildcards (`*`). To search all data streams and indices, omit this
@@ -3819,6 +3842,13 @@ class Elasticsearch(BaseClient):
3819
3842
  be ignored when frozen.
3820
3843
  :param ignore_unavailable: If `false`, the request returns an error if it targets
3821
3844
  a missing or closed index.
3845
+ :param include_named_queries_score: Indicates whether hit.matched_queries should
3846
+ be rendered as a map that includes the name of the matched query associated
3847
+ with its score (true) or as an array containing the name of the matched queries
3848
+ (false) This functionality reruns each named query on every hit in a search
3849
+ response. Typically, this adds a small overhead to a request. However, using
3850
+ computationally expensive named queries on a large number of hits may add
3851
+ significant overhead.
3822
3852
  :param indices_boost: Boosts the _score of documents from specified indices.
3823
3853
  :param knn: Defines the approximate kNN search to run.
3824
3854
  :param lenient: If `true`, format-based query failures (such as providing text
@@ -3876,6 +3906,9 @@ class Elasticsearch(BaseClient):
3876
3906
  example 100 - 500) documents returned by the `query` and `post_filter` phases.
3877
3907
  :param rest_total_hits_as_int: Indicates whether `hits.total` should be rendered
3878
3908
  as an integer or an object in the rest search response.
3909
+ :param retriever: A retriever is a specification to describe top documents returned
3910
+ from a search. A retriever replaces other elements of the search API that
3911
+ also return top documents such as query and knn.
3879
3912
  :param routing: Custom value used to route operations to a specific shard.
3880
3913
  :param runtime_mappings: Defines one or more runtime fields in the search request.
3881
3914
  These fields take precedence over mapped fields with the same name.
@@ -3997,6 +4030,8 @@ class Elasticsearch(BaseClient):
3997
4030
  __query["ignore_throttled"] = ignore_throttled
3998
4031
  if ignore_unavailable is not None:
3999
4032
  __query["ignore_unavailable"] = ignore_unavailable
4033
+ if include_named_queries_score is not None:
4034
+ __query["include_named_queries_score"] = include_named_queries_score
4000
4035
  if lenient is not None:
4001
4036
  __query["lenient"] = lenient
4002
4037
  if max_concurrent_shard_requests is not None:
@@ -4072,6 +4107,8 @@ class Elasticsearch(BaseClient):
4072
4107
  __body["rank"] = rank
4073
4108
  if rescore is not None:
4074
4109
  __body["rescore"] = rescore
4110
+ if retriever is not None:
4111
+ __body["retriever"] = retriever
4075
4112
  if runtime_mappings is not None:
4076
4113
  __body["runtime_mappings"] = runtime_mappings
4077
4114
  if script_fields is not None:
@@ -4152,10 +4189,10 @@ class Elasticsearch(BaseClient):
4152
4189
  extent: t.Optional[int] = None,
4153
4190
  fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4154
4191
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4155
- grid_agg: t.Optional[t.Union["t.Literal['geohex', 'geotile']", str]] = None,
4192
+ grid_agg: t.Optional[t.Union[str, t.Literal["geohex", "geotile"]]] = None,
4156
4193
  grid_precision: t.Optional[int] = None,
4157
4194
  grid_type: t.Optional[
4158
- t.Union["t.Literal['centroid', 'grid', 'point']", str]
4195
+ t.Union[str, t.Literal["centroid", "grid", "point"]]
4159
4196
  ] = None,
4160
4197
  human: t.Optional[bool] = None,
4161
4198
  pretty: t.Optional[bool] = None,
@@ -4176,7 +4213,7 @@ class Elasticsearch(BaseClient):
4176
4213
  Searches a vector tile for geospatial values. Returns results as a binary Mapbox
4177
4214
  vector tile.
4178
4215
 
4179
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-vector-tile-api.html>`_
4216
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-vector-tile-api.html>`_
4180
4217
 
4181
4218
  :param index: Comma-separated list of data streams, indices, or aliases to search
4182
4219
  :param field: Field containing geospatial data to return
@@ -4314,9 +4351,9 @@ class Elasticsearch(BaseClient):
4314
4351
  expand_wildcards: t.Optional[
4315
4352
  t.Union[
4316
4353
  t.Sequence[
4317
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str]
4354
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
4318
4355
  ],
4319
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
4356
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
4320
4357
  ]
4321
4358
  ] = None,
4322
4359
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -4331,7 +4368,7 @@ class Elasticsearch(BaseClient):
4331
4368
  Returns information about the indices and shards that a search request would
4332
4369
  be executed against.
4333
4370
 
4334
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-shards.html>`_
4371
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-shards.html>`_
4335
4372
 
4336
4373
  :param index: Returns the indices and shards that a search request would be executed
4337
4374
  against.
@@ -4404,9 +4441,9 @@ class Elasticsearch(BaseClient):
4404
4441
  expand_wildcards: t.Optional[
4405
4442
  t.Union[
4406
4443
  t.Sequence[
4407
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str]
4444
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
4408
4445
  ],
4409
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
4446
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
4410
4447
  ]
4411
4448
  ] = None,
4412
4449
  explain: t.Optional[bool] = None,
@@ -4421,18 +4458,18 @@ class Elasticsearch(BaseClient):
4421
4458
  profile: t.Optional[bool] = None,
4422
4459
  rest_total_hits_as_int: t.Optional[bool] = None,
4423
4460
  routing: t.Optional[str] = None,
4424
- scroll: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
4461
+ scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4425
4462
  search_type: t.Optional[
4426
- t.Union["t.Literal['dfs_query_then_fetch', 'query_then_fetch']", str]
4463
+ t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
4427
4464
  ] = None,
4428
4465
  source: t.Optional[str] = None,
4429
4466
  typed_keys: t.Optional[bool] = None,
4430
4467
  body: t.Optional[t.Dict[str, t.Any]] = None,
4431
4468
  ) -> ObjectApiResponse[t.Any]:
4432
4469
  """
4433
- Allows to use the Mustache language to pre-render a search definition.
4470
+ Runs a search with a search template.
4434
4471
 
4435
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-template.html>`_
4472
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-template.html>`_
4436
4473
 
4437
4474
  :param index: Comma-separated list of data streams, indices, and aliases to search.
4438
4475
  Supports wildcards (*).
@@ -4558,7 +4595,7 @@ class Elasticsearch(BaseClient):
4558
4595
  search_after: t.Optional[str] = None,
4559
4596
  size: t.Optional[int] = None,
4560
4597
  string: t.Optional[str] = None,
4561
- timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
4598
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4562
4599
  body: t.Optional[t.Dict[str, t.Any]] = None,
4563
4600
  ) -> ObjectApiResponse[t.Any]:
4564
4601
  """
@@ -4566,7 +4603,7 @@ class Elasticsearch(BaseClient):
4566
4603
  the provided string. It is designed for low-latency look-ups used in auto-complete
4567
4604
  scenarios.
4568
4605
 
4569
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-terms-enum.html>`_
4606
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-terms-enum.html>`_
4570
4607
 
4571
4608
  :param index: Comma-separated list of data streams, indices, and index aliases
4572
4609
  to search. Wildcard (*) expressions are supported.
@@ -4657,7 +4694,7 @@ class Elasticsearch(BaseClient):
4657
4694
  term_statistics: t.Optional[bool] = None,
4658
4695
  version: t.Optional[int] = None,
4659
4696
  version_type: t.Optional[
4660
- t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str]
4697
+ t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
4661
4698
  ] = None,
4662
4699
  body: t.Optional[t.Dict[str, t.Any]] = None,
4663
4700
  ) -> ObjectApiResponse[t.Any]:
@@ -4665,7 +4702,7 @@ class Elasticsearch(BaseClient):
4665
4702
  Returns information and statistics about terms in the fields of a particular
4666
4703
  document.
4667
4704
 
4668
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-termvectors.html>`_
4705
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-termvectors.html>`_
4669
4706
 
4670
4707
  :param index: Name of the index that contains the document.
4671
4708
  :param id: Unique identifier of the document.
@@ -4787,7 +4824,7 @@ class Elasticsearch(BaseClient):
4787
4824
  lang: t.Optional[str] = None,
4788
4825
  pretty: t.Optional[bool] = None,
4789
4826
  refresh: t.Optional[
4790
- t.Union["t.Literal['false', 'true', 'wait_for']", bool, str]
4827
+ t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
4791
4828
  ] = None,
4792
4829
  require_alias: t.Optional[bool] = None,
4793
4830
  retry_on_conflict: t.Optional[int] = None,
@@ -4797,17 +4834,17 @@ class Elasticsearch(BaseClient):
4797
4834
  source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None,
4798
4835
  source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4799
4836
  source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4800
- timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
4837
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4801
4838
  upsert: t.Optional[t.Mapping[str, t.Any]] = None,
4802
4839
  wait_for_active_shards: t.Optional[
4803
- t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
4840
+ t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
4804
4841
  ] = None,
4805
4842
  body: t.Optional[t.Dict[str, t.Any]] = None,
4806
4843
  ) -> ObjectApiResponse[t.Any]:
4807
4844
  """
4808
4845
  Updates a document with a script or partial document.
4809
4846
 
4810
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-update.html>`_
4847
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-update.html>`_
4811
4848
 
4812
4849
  :param index: The name of the index
4813
4850
  :param id: Document ID
@@ -4920,16 +4957,16 @@ class Elasticsearch(BaseClient):
4920
4957
  allow_no_indices: t.Optional[bool] = None,
4921
4958
  analyze_wildcard: t.Optional[bool] = None,
4922
4959
  analyzer: t.Optional[str] = None,
4923
- conflicts: t.Optional[t.Union["t.Literal['abort', 'proceed']", str]] = None,
4924
- default_operator: t.Optional[t.Union["t.Literal['and', 'or']", str]] = None,
4960
+ conflicts: t.Optional[t.Union[str, t.Literal["abort", "proceed"]]] = None,
4961
+ default_operator: t.Optional[t.Union[str, t.Literal["and", "or"]]] = None,
4925
4962
  df: t.Optional[str] = None,
4926
4963
  error_trace: t.Optional[bool] = None,
4927
4964
  expand_wildcards: t.Optional[
4928
4965
  t.Union[
4929
4966
  t.Sequence[
4930
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str]
4967
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
4931
4968
  ],
4932
- t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
4969
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
4933
4970
  ]
4934
4971
  ] = None,
4935
4972
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -4947,34 +4984,32 @@ class Elasticsearch(BaseClient):
4947
4984
  requests_per_second: t.Optional[float] = None,
4948
4985
  routing: t.Optional[str] = None,
4949
4986
  script: t.Optional[t.Mapping[str, t.Any]] = None,
4950
- scroll: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
4987
+ scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4951
4988
  scroll_size: t.Optional[int] = None,
4952
- search_timeout: t.Optional[
4953
- t.Union["t.Literal[-1]", "t.Literal[0]", str]
4954
- ] = None,
4989
+ search_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4955
4990
  search_type: t.Optional[
4956
- t.Union["t.Literal['dfs_query_then_fetch', 'query_then_fetch']", str]
4991
+ t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
4957
4992
  ] = None,
4958
4993
  slice: t.Optional[t.Mapping[str, t.Any]] = None,
4959
- slices: t.Optional[t.Union[int, t.Union["t.Literal['auto']", str]]] = None,
4994
+ slices: t.Optional[t.Union[int, t.Union[str, t.Literal["auto"]]]] = None,
4960
4995
  sort: t.Optional[t.Sequence[str]] = None,
4961
4996
  stats: t.Optional[t.Sequence[str]] = None,
4962
4997
  terminate_after: t.Optional[int] = None,
4963
- timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
4998
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4964
4999
  version: t.Optional[bool] = None,
4965
5000
  version_type: t.Optional[bool] = None,
4966
5001
  wait_for_active_shards: t.Optional[
4967
- t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
5002
+ t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
4968
5003
  ] = None,
4969
5004
  wait_for_completion: t.Optional[bool] = None,
4970
5005
  body: t.Optional[t.Dict[str, t.Any]] = None,
4971
5006
  ) -> ObjectApiResponse[t.Any]:
4972
5007
  """
4973
5008
  Updates documents that match the specified query. If no query is specified, performs
4974
- an update on every document in the index without changing the source, for example
4975
- to pick up a mapping change.
5009
+ an update on every document in the data stream or index without modifying the
5010
+ source, which is useful for picking up mapping changes.
4976
5011
 
4977
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-update-by-query.html>`_
5012
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-update-by-query.html>`_
4978
5013
 
4979
5014
  :param index: Comma-separated list of data streams, indices, and aliases to search.
4980
5015
  Supports wildcards (`*`). To search all data streams or indices, omit this
@@ -5167,7 +5202,7 @@ class Elasticsearch(BaseClient):
5167
5202
  """
5168
5203
  Changes the number of requests per second for a particular Update By Query operation.
5169
5204
 
5170
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-update-by-query.html>`_
5205
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-update-by-query.html>`_
5171
5206
 
5172
5207
  :param task_id: The ID for the task.
5173
5208
  :param requests_per_second: The throttle for this request in sub-requests per