elasticsearch 8.12.1__py3-none-any.whl → 8.13.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. elasticsearch/__init__.py +7 -0
  2. elasticsearch/_async/client/__init__.py +477 -128
  3. elasticsearch/_async/client/_base.py +41 -1
  4. elasticsearch/_async/client/async_search.py +40 -12
  5. elasticsearch/_async/client/autoscaling.py +37 -11
  6. elasticsearch/_async/client/cat.py +260 -69
  7. elasticsearch/_async/client/ccr.py +123 -38
  8. elasticsearch/_async/client/cluster.py +153 -42
  9. elasticsearch/_async/client/dangling_indices.py +27 -8
  10. elasticsearch/_async/client/enrich.py +48 -14
  11. elasticsearch/_async/client/eql.py +38 -12
  12. elasticsearch/_async/client/esql.py +10 -2
  13. elasticsearch/_async/client/features.py +17 -4
  14. elasticsearch/_async/client/fleet.py +30 -7
  15. elasticsearch/_async/client/graph.py +11 -3
  16. elasticsearch/_async/client/ilm.py +101 -29
  17. elasticsearch/_async/client/indices.py +688 -181
  18. elasticsearch/_async/client/inference.py +111 -44
  19. elasticsearch/_async/client/ingest.py +59 -16
  20. elasticsearch/_async/client/license.py +58 -14
  21. elasticsearch/_async/client/logstash.py +31 -9
  22. elasticsearch/_async/client/migration.py +28 -7
  23. elasticsearch/_async/client/ml.py +781 -214
  24. elasticsearch/_async/client/monitoring.py +10 -2
  25. elasticsearch/_async/client/nodes.py +103 -29
  26. elasticsearch/_async/client/query_ruleset.py +37 -11
  27. elasticsearch/_async/client/rollup.py +79 -24
  28. elasticsearch/_async/client/search_application.py +76 -23
  29. elasticsearch/_async/client/searchable_snapshots.py +49 -12
  30. elasticsearch/_async/client/security.py +544 -143
  31. elasticsearch/_async/client/shutdown.py +28 -6
  32. elasticsearch/_async/client/slm.py +80 -22
  33. elasticsearch/_async/client/snapshot.py +140 -54
  34. elasticsearch/_async/client/sql.py +55 -15
  35. elasticsearch/_async/client/ssl.py +9 -2
  36. elasticsearch/_async/client/synonyms.py +75 -21
  37. elasticsearch/_async/client/tasks.py +29 -8
  38. elasticsearch/_async/client/text_structure.py +74 -2
  39. elasticsearch/_async/client/transform.py +106 -32
  40. elasticsearch/_async/client/watcher.py +110 -31
  41. elasticsearch/_async/client/xpack.py +16 -4
  42. elasticsearch/_async/helpers.py +1 -1
  43. elasticsearch/_otel.py +92 -0
  44. elasticsearch/_sync/client/__init__.py +477 -128
  45. elasticsearch/_sync/client/_base.py +41 -1
  46. elasticsearch/_sync/client/async_search.py +40 -12
  47. elasticsearch/_sync/client/autoscaling.py +37 -11
  48. elasticsearch/_sync/client/cat.py +260 -69
  49. elasticsearch/_sync/client/ccr.py +123 -38
  50. elasticsearch/_sync/client/cluster.py +153 -42
  51. elasticsearch/_sync/client/dangling_indices.py +27 -8
  52. elasticsearch/_sync/client/enrich.py +48 -14
  53. elasticsearch/_sync/client/eql.py +38 -12
  54. elasticsearch/_sync/client/esql.py +10 -2
  55. elasticsearch/_sync/client/features.py +17 -4
  56. elasticsearch/_sync/client/fleet.py +30 -7
  57. elasticsearch/_sync/client/graph.py +11 -3
  58. elasticsearch/_sync/client/ilm.py +101 -29
  59. elasticsearch/_sync/client/indices.py +688 -181
  60. elasticsearch/_sync/client/inference.py +111 -44
  61. elasticsearch/_sync/client/ingest.py +59 -16
  62. elasticsearch/_sync/client/license.py +58 -14
  63. elasticsearch/_sync/client/logstash.py +31 -9
  64. elasticsearch/_sync/client/migration.py +28 -7
  65. elasticsearch/_sync/client/ml.py +781 -214
  66. elasticsearch/_sync/client/monitoring.py +10 -2
  67. elasticsearch/_sync/client/nodes.py +103 -29
  68. elasticsearch/_sync/client/query_ruleset.py +37 -11
  69. elasticsearch/_sync/client/rollup.py +79 -24
  70. elasticsearch/_sync/client/search_application.py +76 -23
  71. elasticsearch/_sync/client/searchable_snapshots.py +49 -12
  72. elasticsearch/_sync/client/security.py +544 -143
  73. elasticsearch/_sync/client/shutdown.py +28 -6
  74. elasticsearch/_sync/client/slm.py +80 -22
  75. elasticsearch/_sync/client/snapshot.py +140 -54
  76. elasticsearch/_sync/client/sql.py +55 -15
  77. elasticsearch/_sync/client/ssl.py +9 -2
  78. elasticsearch/_sync/client/synonyms.py +75 -21
  79. elasticsearch/_sync/client/tasks.py +29 -8
  80. elasticsearch/_sync/client/text_structure.py +74 -2
  81. elasticsearch/_sync/client/transform.py +106 -32
  82. elasticsearch/_sync/client/watcher.py +110 -31
  83. elasticsearch/_sync/client/xpack.py +16 -4
  84. elasticsearch/_version.py +1 -1
  85. elasticsearch/helpers/actions.py +1 -1
  86. elasticsearch/helpers/vectorstore/__init__.py +62 -0
  87. elasticsearch/helpers/vectorstore/_async/__init__.py +16 -0
  88. elasticsearch/helpers/vectorstore/_async/_utils.py +39 -0
  89. elasticsearch/helpers/vectorstore/_async/embedding_service.py +89 -0
  90. elasticsearch/helpers/vectorstore/_async/strategies.py +466 -0
  91. elasticsearch/helpers/vectorstore/_async/vectorstore.py +391 -0
  92. elasticsearch/helpers/vectorstore/_sync/__init__.py +16 -0
  93. elasticsearch/helpers/vectorstore/_sync/_utils.py +39 -0
  94. elasticsearch/helpers/vectorstore/_sync/embedding_service.py +89 -0
  95. elasticsearch/helpers/vectorstore/_sync/strategies.py +466 -0
  96. elasticsearch/helpers/vectorstore/_sync/vectorstore.py +388 -0
  97. elasticsearch/helpers/vectorstore/_utils.py +116 -0
  98. elasticsearch/serializer.py +14 -0
  99. {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/METADATA +28 -8
  100. elasticsearch-8.13.1.dist-info/RECORD +116 -0
  101. {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/WHEEL +1 -1
  102. elasticsearch-8.12.1.dist-info/RECORD +0 -103
  103. {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/LICENSE +0 -0
  104. {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/NOTICE +0 -0
  105. {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/top_level.txt +0 -0
@@ -122,12 +122,12 @@ class AsyncElasticsearch(BaseClient):
122
122
  # Set 'api_key' on the constructor
123
123
  client = Elasticsearch(
124
124
  "http://localhost:9200",
125
- api_key=("id", "api_key")
125
+ api_key="api_key",
126
126
  )
127
127
  client.search(...)
128
128
 
129
129
  # Set 'api_key' per request
130
- client.options(api_key=("id", "api_key")).search(...)
130
+ client.options(api_key="api_key").search(...)
131
131
  """
132
132
 
133
133
  def __init__(
@@ -640,7 +640,7 @@ class AsyncElasticsearch(BaseClient):
640
640
  """
641
641
  Allows to perform multiple index/update/delete operations in a single request.
642
642
 
643
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-bulk.html>`_
643
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-bulk.html>`_
644
644
 
645
645
  :param operations:
646
646
  :param index: Name of the data stream, index, or index alias to perform bulk
@@ -674,9 +674,12 @@ class AsyncElasticsearch(BaseClient):
674
674
  )
675
675
  elif operations is not None and body is not None:
676
676
  raise ValueError("Cannot set both 'operations' and 'body'")
677
+ __path_parts: t.Dict[str, str]
677
678
  if index not in SKIP_IN_PATH:
678
- __path = f"/{_quote(index)}/_bulk"
679
+ __path_parts = {"index": _quote(index)}
680
+ __path = f'/{__path_parts["index"]}/_bulk'
679
681
  else:
682
+ __path_parts = {}
680
683
  __path = "/_bulk"
681
684
  __query: t.Dict[str, t.Any] = {}
682
685
  if error_trace is not None:
@@ -711,7 +714,13 @@ class AsyncElasticsearch(BaseClient):
711
714
  "content-type": "application/x-ndjson",
712
715
  }
713
716
  return await self.perform_request( # type: ignore[return-value]
714
- "PUT", __path, params=__query, headers=__headers, body=__body
717
+ "PUT",
718
+ __path,
719
+ params=__query,
720
+ headers=__headers,
721
+ body=__body,
722
+ endpoint_id="bulk",
723
+ path_parts=__path_parts,
715
724
  )
716
725
 
717
726
  @_rewrite_parameters(
@@ -730,10 +739,11 @@ class AsyncElasticsearch(BaseClient):
730
739
  """
731
740
  Explicitly clears the search context for a scroll.
732
741
 
733
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/clear-scroll-api.html>`_
742
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/clear-scroll-api.html>`_
734
743
 
735
744
  :param scroll_id: Scroll IDs to clear. To clear all scroll IDs, use `_all`.
736
745
  """
746
+ __path_parts: t.Dict[str, str] = {}
737
747
  __path = "/_search/scroll"
738
748
  __query: t.Dict[str, t.Any] = {}
739
749
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -754,7 +764,13 @@ class AsyncElasticsearch(BaseClient):
754
764
  if __body is not None:
755
765
  __headers["content-type"] = "application/json"
756
766
  return await self.perform_request( # type: ignore[return-value]
757
- "DELETE", __path, params=__query, headers=__headers, body=__body
767
+ "DELETE",
768
+ __path,
769
+ params=__query,
770
+ headers=__headers,
771
+ body=__body,
772
+ endpoint_id="clear_scroll",
773
+ path_parts=__path_parts,
758
774
  )
759
775
 
760
776
  @_rewrite_parameters(
@@ -773,12 +789,13 @@ class AsyncElasticsearch(BaseClient):
773
789
  """
774
790
  Close a point in time
775
791
 
776
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/point-in-time-api.html>`_
792
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/point-in-time-api.html>`_
777
793
 
778
794
  :param id: The ID of the point-in-time.
779
795
  """
780
796
  if id is None and body is None:
781
797
  raise ValueError("Empty value passed for parameter 'id'")
798
+ __path_parts: t.Dict[str, str] = {}
782
799
  __path = "/_pit"
783
800
  __query: t.Dict[str, t.Any] = {}
784
801
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -799,7 +816,13 @@ class AsyncElasticsearch(BaseClient):
799
816
  if __body is not None:
800
817
  __headers["content-type"] = "application/json"
801
818
  return await self.perform_request( # type: ignore[return-value]
802
- "DELETE", __path, params=__query, headers=__headers, body=__body
819
+ "DELETE",
820
+ __path,
821
+ params=__query,
822
+ headers=__headers,
823
+ body=__body,
824
+ endpoint_id="close_point_in_time",
825
+ path_parts=__path_parts,
803
826
  )
804
827
 
805
828
  @_rewrite_parameters(
@@ -840,7 +863,7 @@ class AsyncElasticsearch(BaseClient):
840
863
  """
841
864
  Returns number of documents matching a query.
842
865
 
843
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-count.html>`_
866
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-count.html>`_
844
867
 
845
868
  :param index: Comma-separated list of data streams, indices, and aliases to search.
846
869
  Supports wildcards (`*`). To search all data streams and indices, omit this
@@ -879,9 +902,12 @@ class AsyncElasticsearch(BaseClient):
879
902
  If a query reaches this limit, Elasticsearch terminates the query early.
880
903
  Elasticsearch collects documents before sorting.
881
904
  """
905
+ __path_parts: t.Dict[str, str]
882
906
  if index not in SKIP_IN_PATH:
883
- __path = f"/{_quote(index)}/_count"
907
+ __path_parts = {"index": _quote(index)}
908
+ __path = f'/{__path_parts["index"]}/_count'
884
909
  else:
910
+ __path_parts = {}
885
911
  __path = "/_count"
886
912
  __query: t.Dict[str, t.Any] = {}
887
913
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -930,7 +956,13 @@ class AsyncElasticsearch(BaseClient):
930
956
  if __body is not None:
931
957
  __headers["content-type"] = "application/json"
932
958
  return await self.perform_request( # type: ignore[return-value]
933
- "POST", __path, params=__query, headers=__headers, body=__body
959
+ "POST",
960
+ __path,
961
+ params=__query,
962
+ headers=__headers,
963
+ body=__body,
964
+ endpoint_id="count",
965
+ path_parts=__path_parts,
934
966
  )
935
967
 
936
968
  @_rewrite_parameters(
@@ -965,7 +997,7 @@ class AsyncElasticsearch(BaseClient):
965
997
  Creates a new document in the index. Returns a 409 response when a document with
966
998
  a same ID already exists in the index.
967
999
 
968
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-index_.html>`_
1000
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-index_.html>`_
969
1001
 
970
1002
  :param index: Name of the data stream or index to target. If the target doesn’t
971
1003
  exist and matches the name or wildcard (`*`) pattern of an index template
@@ -1004,7 +1036,8 @@ class AsyncElasticsearch(BaseClient):
1004
1036
  )
1005
1037
  elif document is not None and body is not None:
1006
1038
  raise ValueError("Cannot set both 'document' and 'body'")
1007
- __path = f"/{_quote(index)}/_create/{_quote(id)}"
1039
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
1040
+ __path = f'/{__path_parts["index"]}/_create/{__path_parts["id"]}'
1008
1041
  __query: t.Dict[str, t.Any] = {}
1009
1042
  if error_trace is not None:
1010
1043
  __query["error_trace"] = error_trace
@@ -1031,7 +1064,13 @@ class AsyncElasticsearch(BaseClient):
1031
1064
  __body = document if document is not None else body
1032
1065
  __headers = {"accept": "application/json", "content-type": "application/json"}
1033
1066
  return await self.perform_request( # type: ignore[return-value]
1034
- "PUT", __path, params=__query, headers=__headers, body=__body
1067
+ "PUT",
1068
+ __path,
1069
+ params=__query,
1070
+ headers=__headers,
1071
+ body=__body,
1072
+ endpoint_id="create",
1073
+ path_parts=__path_parts,
1035
1074
  )
1036
1075
 
1037
1076
  @_rewrite_parameters()
@@ -1062,7 +1101,7 @@ class AsyncElasticsearch(BaseClient):
1062
1101
  """
1063
1102
  Removes a document from the index.
1064
1103
 
1065
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-delete.html>`_
1104
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-delete.html>`_
1066
1105
 
1067
1106
  :param index: Name of the target index.
1068
1107
  :param id: Unique identifier for the document.
@@ -1088,7 +1127,8 @@ class AsyncElasticsearch(BaseClient):
1088
1127
  raise ValueError("Empty value passed for parameter 'index'")
1089
1128
  if id in SKIP_IN_PATH:
1090
1129
  raise ValueError("Empty value passed for parameter 'id'")
1091
- __path = f"/{_quote(index)}/_doc/{_quote(id)}"
1130
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
1131
+ __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}'
1092
1132
  __query: t.Dict[str, t.Any] = {}
1093
1133
  if error_trace is not None:
1094
1134
  __query["error_trace"] = error_trace
@@ -1116,7 +1156,12 @@ class AsyncElasticsearch(BaseClient):
1116
1156
  __query["wait_for_active_shards"] = wait_for_active_shards
1117
1157
  __headers = {"accept": "application/json"}
1118
1158
  return await self.perform_request( # type: ignore[return-value]
1119
- "DELETE", __path, params=__query, headers=__headers
1159
+ "DELETE",
1160
+ __path,
1161
+ params=__query,
1162
+ headers=__headers,
1163
+ endpoint_id="delete",
1164
+ path_parts=__path_parts,
1120
1165
  )
1121
1166
 
1122
1167
  @_rewrite_parameters(
@@ -1180,7 +1225,7 @@ class AsyncElasticsearch(BaseClient):
1180
1225
  """
1181
1226
  Deletes documents matching the provided query.
1182
1227
 
1183
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-delete-by-query.html>`_
1228
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-delete-by-query.html>`_
1184
1229
 
1185
1230
  :param index: Comma-separated list of data streams, indices, and aliases to search.
1186
1231
  Supports wildcards (`*`). To search all data streams or indices, omit this
@@ -1247,7 +1292,8 @@ class AsyncElasticsearch(BaseClient):
1247
1292
  """
1248
1293
  if index in SKIP_IN_PATH:
1249
1294
  raise ValueError("Empty value passed for parameter 'index'")
1250
- __path = f"/{_quote(index)}/_delete_by_query"
1295
+ __path_parts: t.Dict[str, str] = {"index": _quote(index)}
1296
+ __path = f'/{__path_parts["index"]}/_delete_by_query'
1251
1297
  __query: t.Dict[str, t.Any] = {}
1252
1298
  __body: t.Dict[str, t.Any] = body if body is not None else {}
1253
1299
  # The 'sort' parameter with a colon can't be encoded to the body.
@@ -1334,7 +1380,13 @@ class AsyncElasticsearch(BaseClient):
1334
1380
  __body["slice"] = slice
1335
1381
  __headers = {"accept": "application/json", "content-type": "application/json"}
1336
1382
  return await self.perform_request( # type: ignore[return-value]
1337
- "POST", __path, params=__query, headers=__headers, body=__body
1383
+ "POST",
1384
+ __path,
1385
+ params=__query,
1386
+ headers=__headers,
1387
+ body=__body,
1388
+ endpoint_id="delete_by_query",
1389
+ path_parts=__path_parts,
1338
1390
  )
1339
1391
 
1340
1392
  @_rewrite_parameters()
@@ -1351,7 +1403,7 @@ class AsyncElasticsearch(BaseClient):
1351
1403
  """
1352
1404
  Changes the number of requests per second for a particular Delete By Query operation.
1353
1405
 
1354
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-delete-by-query.html>`_
1406
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-delete-by-query.html>`_
1355
1407
 
1356
1408
  :param task_id: The ID for the task.
1357
1409
  :param requests_per_second: The throttle for this request in sub-requests per
@@ -1359,7 +1411,8 @@ class AsyncElasticsearch(BaseClient):
1359
1411
  """
1360
1412
  if task_id in SKIP_IN_PATH:
1361
1413
  raise ValueError("Empty value passed for parameter 'task_id'")
1362
- __path = f"/_delete_by_query/{_quote(task_id)}/_rethrottle"
1414
+ __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
1415
+ __path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle'
1363
1416
  __query: t.Dict[str, t.Any] = {}
1364
1417
  if error_trace is not None:
1365
1418
  __query["error_trace"] = error_trace
@@ -1373,7 +1426,12 @@ class AsyncElasticsearch(BaseClient):
1373
1426
  __query["requests_per_second"] = requests_per_second
1374
1427
  __headers = {"accept": "application/json"}
1375
1428
  return await self.perform_request( # type: ignore[return-value]
1376
- "POST", __path, params=__query, headers=__headers
1429
+ "POST",
1430
+ __path,
1431
+ params=__query,
1432
+ headers=__headers,
1433
+ endpoint_id="delete_by_query_rethrottle",
1434
+ path_parts=__path_parts,
1377
1435
  )
1378
1436
 
1379
1437
  @_rewrite_parameters()
@@ -1393,7 +1451,7 @@ class AsyncElasticsearch(BaseClient):
1393
1451
  """
1394
1452
  Deletes a script.
1395
1453
 
1396
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-scripting.html>`_
1454
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-scripting.html>`_
1397
1455
 
1398
1456
  :param id: Identifier for the stored script or search template.
1399
1457
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -1404,7 +1462,8 @@ class AsyncElasticsearch(BaseClient):
1404
1462
  """
1405
1463
  if id in SKIP_IN_PATH:
1406
1464
  raise ValueError("Empty value passed for parameter 'id'")
1407
- __path = f"/_scripts/{_quote(id)}"
1465
+ __path_parts: t.Dict[str, str] = {"id": _quote(id)}
1466
+ __path = f'/_scripts/{__path_parts["id"]}'
1408
1467
  __query: t.Dict[str, t.Any] = {}
1409
1468
  if error_trace is not None:
1410
1469
  __query["error_trace"] = error_trace
@@ -1420,7 +1479,12 @@ class AsyncElasticsearch(BaseClient):
1420
1479
  __query["timeout"] = timeout
1421
1480
  __headers = {"accept": "application/json"}
1422
1481
  return await self.perform_request( # type: ignore[return-value]
1423
- "DELETE", __path, params=__query, headers=__headers
1482
+ "DELETE",
1483
+ __path,
1484
+ params=__query,
1485
+ headers=__headers,
1486
+ endpoint_id="delete_script",
1487
+ path_parts=__path_parts,
1424
1488
  )
1425
1489
 
1426
1490
  @_rewrite_parameters(
@@ -1455,7 +1519,7 @@ class AsyncElasticsearch(BaseClient):
1455
1519
  """
1456
1520
  Returns information about whether a document exists in an index.
1457
1521
 
1458
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-get.html>`_
1522
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-get.html>`_
1459
1523
 
1460
1524
  :param index: Comma-separated list of data streams, indices, and aliases. Supports
1461
1525
  wildcards (`*`).
@@ -1484,7 +1548,8 @@ class AsyncElasticsearch(BaseClient):
1484
1548
  raise ValueError("Empty value passed for parameter 'index'")
1485
1549
  if id in SKIP_IN_PATH:
1486
1550
  raise ValueError("Empty value passed for parameter 'id'")
1487
- __path = f"/{_quote(index)}/_doc/{_quote(id)}"
1551
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
1552
+ __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}'
1488
1553
  __query: t.Dict[str, t.Any] = {}
1489
1554
  if error_trace is not None:
1490
1555
  __query["error_trace"] = error_trace
@@ -1516,7 +1581,12 @@ class AsyncElasticsearch(BaseClient):
1516
1581
  __query["version_type"] = version_type
1517
1582
  __headers = {"accept": "application/json"}
1518
1583
  return await self.perform_request( # type: ignore[return-value]
1519
- "HEAD", __path, params=__query, headers=__headers
1584
+ "HEAD",
1585
+ __path,
1586
+ params=__query,
1587
+ headers=__headers,
1588
+ endpoint_id="exists",
1589
+ path_parts=__path_parts,
1520
1590
  )
1521
1591
 
1522
1592
  @_rewrite_parameters(
@@ -1550,7 +1620,7 @@ class AsyncElasticsearch(BaseClient):
1550
1620
  """
1551
1621
  Returns information about whether a document source exists in an index.
1552
1622
 
1553
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-get.html>`_
1623
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-get.html>`_
1554
1624
 
1555
1625
  :param index: Comma-separated list of data streams, indices, and aliases. Supports
1556
1626
  wildcards (`*`).
@@ -1576,7 +1646,8 @@ class AsyncElasticsearch(BaseClient):
1576
1646
  raise ValueError("Empty value passed for parameter 'index'")
1577
1647
  if id in SKIP_IN_PATH:
1578
1648
  raise ValueError("Empty value passed for parameter 'id'")
1579
- __path = f"/{_quote(index)}/_source/{_quote(id)}"
1649
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
1650
+ __path = f'/{__path_parts["index"]}/_source/{__path_parts["id"]}'
1580
1651
  __query: t.Dict[str, t.Any] = {}
1581
1652
  if error_trace is not None:
1582
1653
  __query["error_trace"] = error_trace
@@ -1606,7 +1677,12 @@ class AsyncElasticsearch(BaseClient):
1606
1677
  __query["version_type"] = version_type
1607
1678
  __headers = {"accept": "application/json"}
1608
1679
  return await self.perform_request( # type: ignore[return-value]
1609
- "HEAD", __path, params=__query, headers=__headers
1680
+ "HEAD",
1681
+ __path,
1682
+ params=__query,
1683
+ headers=__headers,
1684
+ endpoint_id="exists_source",
1685
+ path_parts=__path_parts,
1610
1686
  )
1611
1687
 
1612
1688
  @_rewrite_parameters(
@@ -1644,7 +1720,7 @@ class AsyncElasticsearch(BaseClient):
1644
1720
  """
1645
1721
  Returns information about why a specific matches (or doesn't match) a query.
1646
1722
 
1647
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-explain.html>`_
1723
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-explain.html>`_
1648
1724
 
1649
1725
  :param index: Index names used to limit the request. Only a single index name
1650
1726
  can be provided to this parameter.
@@ -1676,7 +1752,8 @@ class AsyncElasticsearch(BaseClient):
1676
1752
  raise ValueError("Empty value passed for parameter 'index'")
1677
1753
  if id in SKIP_IN_PATH:
1678
1754
  raise ValueError("Empty value passed for parameter 'id'")
1679
- __path = f"/{_quote(index)}/_explain/{_quote(id)}"
1755
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
1756
+ __path = f'/{__path_parts["index"]}/_explain/{__path_parts["id"]}'
1680
1757
  __query: t.Dict[str, t.Any] = {}
1681
1758
  __body: t.Dict[str, t.Any] = body if body is not None else {}
1682
1759
  if analyze_wildcard is not None:
@@ -1720,7 +1797,13 @@ class AsyncElasticsearch(BaseClient):
1720
1797
  if __body is not None:
1721
1798
  __headers["content-type"] = "application/json"
1722
1799
  return await self.perform_request( # type: ignore[return-value]
1723
- "POST", __path, params=__query, headers=__headers, body=__body
1800
+ "POST",
1801
+ __path,
1802
+ params=__query,
1803
+ headers=__headers,
1804
+ body=__body,
1805
+ endpoint_id="explain",
1806
+ path_parts=__path_parts,
1724
1807
  )
1725
1808
 
1726
1809
  @_rewrite_parameters(
@@ -1745,6 +1828,7 @@ class AsyncElasticsearch(BaseClient):
1745
1828
  filters: t.Optional[str] = None,
1746
1829
  human: t.Optional[bool] = None,
1747
1830
  ignore_unavailable: t.Optional[bool] = None,
1831
+ include_empty_fields: t.Optional[bool] = None,
1748
1832
  include_unmapped: t.Optional[bool] = None,
1749
1833
  index_filter: t.Optional[t.Mapping[str, t.Any]] = None,
1750
1834
  pretty: t.Optional[bool] = None,
@@ -1755,7 +1839,7 @@ class AsyncElasticsearch(BaseClient):
1755
1839
  """
1756
1840
  Returns the information about the capabilities of fields among multiple indices.
1757
1841
 
1758
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-field-caps.html>`_
1842
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-field-caps.html>`_
1759
1843
 
1760
1844
  :param index: Comma-separated list of data streams, indices, and aliases used
1761
1845
  to limit the request. Supports wildcards (*). To target all data streams
@@ -1774,6 +1858,7 @@ class AsyncElasticsearch(BaseClient):
1774
1858
  :param filters: An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent
1775
1859
  :param ignore_unavailable: If `true`, missing or closed indices are not included
1776
1860
  in the response.
1861
+ :param include_empty_fields: If false, empty fields are not included in the response.
1777
1862
  :param include_unmapped: If true, unmapped fields are included in the response.
1778
1863
  :param index_filter: Allows to filter indices if the provided query rewrites
1779
1864
  to match_none on every shard.
@@ -1784,9 +1869,12 @@ class AsyncElasticsearch(BaseClient):
1784
1869
  :param types: Only return results for fields that have one of the types in the
1785
1870
  list
1786
1871
  """
1872
+ __path_parts: t.Dict[str, str]
1787
1873
  if index not in SKIP_IN_PATH:
1788
- __path = f"/{_quote(index)}/_field_caps"
1874
+ __path_parts = {"index": _quote(index)}
1875
+ __path = f'/{__path_parts["index"]}/_field_caps'
1789
1876
  else:
1877
+ __path_parts = {}
1790
1878
  __path = "/_field_caps"
1791
1879
  __query: t.Dict[str, t.Any] = {}
1792
1880
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -1804,6 +1892,8 @@ class AsyncElasticsearch(BaseClient):
1804
1892
  __query["human"] = human
1805
1893
  if ignore_unavailable is not None:
1806
1894
  __query["ignore_unavailable"] = ignore_unavailable
1895
+ if include_empty_fields is not None:
1896
+ __query["include_empty_fields"] = include_empty_fields
1807
1897
  if include_unmapped is not None:
1808
1898
  __query["include_unmapped"] = include_unmapped
1809
1899
  if pretty is not None:
@@ -1823,7 +1913,13 @@ class AsyncElasticsearch(BaseClient):
1823
1913
  if __body is not None:
1824
1914
  __headers["content-type"] = "application/json"
1825
1915
  return await self.perform_request( # type: ignore[return-value]
1826
- "POST", __path, params=__query, headers=__headers, body=__body
1916
+ "POST",
1917
+ __path,
1918
+ params=__query,
1919
+ headers=__headers,
1920
+ body=__body,
1921
+ endpoint_id="field_caps",
1922
+ path_parts=__path_parts,
1827
1923
  )
1828
1924
 
1829
1925
  @_rewrite_parameters(
@@ -1840,6 +1936,7 @@ class AsyncElasticsearch(BaseClient):
1840
1936
  id: str,
1841
1937
  error_trace: t.Optional[bool] = None,
1842
1938
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1939
+ force_synthetic_source: t.Optional[bool] = None,
1843
1940
  human: t.Optional[bool] = None,
1844
1941
  preference: t.Optional[str] = None,
1845
1942
  pretty: t.Optional[bool] = None,
@@ -1858,10 +1955,14 @@ class AsyncElasticsearch(BaseClient):
1858
1955
  """
1859
1956
  Returns a document.
1860
1957
 
1861
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-get.html>`_
1958
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-get.html>`_
1862
1959
 
1863
1960
  :param index: Name of the index that contains the document.
1864
1961
  :param id: Unique identifier of the document.
1962
+ :param force_synthetic_source: Should this request force synthetic _source? Use
1963
+ this to test if the mapping supports synthetic _source and to get a sense
1964
+ of the worst case performance. Fetches with this enabled will be slower the
1965
+ enabling synthetic source natively in the index.
1865
1966
  :param preference: Specifies the node or shard the operation should be performed
1866
1967
  on. Random by default.
1867
1968
  :param realtime: If `true`, the request is real-time as opposed to near-real-time.
@@ -1886,12 +1987,15 @@ class AsyncElasticsearch(BaseClient):
1886
1987
  raise ValueError("Empty value passed for parameter 'index'")
1887
1988
  if id in SKIP_IN_PATH:
1888
1989
  raise ValueError("Empty value passed for parameter 'id'")
1889
- __path = f"/{_quote(index)}/_doc/{_quote(id)}"
1990
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
1991
+ __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}'
1890
1992
  __query: t.Dict[str, t.Any] = {}
1891
1993
  if error_trace is not None:
1892
1994
  __query["error_trace"] = error_trace
1893
1995
  if filter_path is not None:
1894
1996
  __query["filter_path"] = filter_path
1997
+ if force_synthetic_source is not None:
1998
+ __query["force_synthetic_source"] = force_synthetic_source
1895
1999
  if human is not None:
1896
2000
  __query["human"] = human
1897
2001
  if preference is not None:
@@ -1918,7 +2022,12 @@ class AsyncElasticsearch(BaseClient):
1918
2022
  __query["version_type"] = version_type
1919
2023
  __headers = {"accept": "application/json"}
1920
2024
  return await self.perform_request( # type: ignore[return-value]
1921
- "GET", __path, params=__query, headers=__headers
2025
+ "GET",
2026
+ __path,
2027
+ params=__query,
2028
+ headers=__headers,
2029
+ endpoint_id="get",
2030
+ path_parts=__path_parts,
1922
2031
  )
1923
2032
 
1924
2033
  @_rewrite_parameters()
@@ -1937,14 +2046,15 @@ class AsyncElasticsearch(BaseClient):
1937
2046
  """
1938
2047
  Returns a script.
1939
2048
 
1940
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-scripting.html>`_
2049
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-scripting.html>`_
1941
2050
 
1942
2051
  :param id: Identifier for the stored script or search template.
1943
2052
  :param master_timeout: Specify timeout for connection to master
1944
2053
  """
1945
2054
  if id in SKIP_IN_PATH:
1946
2055
  raise ValueError("Empty value passed for parameter 'id'")
1947
- __path = f"/_scripts/{_quote(id)}"
2056
+ __path_parts: t.Dict[str, str] = {"id": _quote(id)}
2057
+ __path = f'/_scripts/{__path_parts["id"]}'
1948
2058
  __query: t.Dict[str, t.Any] = {}
1949
2059
  if error_trace is not None:
1950
2060
  __query["error_trace"] = error_trace
@@ -1958,7 +2068,12 @@ class AsyncElasticsearch(BaseClient):
1958
2068
  __query["pretty"] = pretty
1959
2069
  __headers = {"accept": "application/json"}
1960
2070
  return await self.perform_request( # type: ignore[return-value]
1961
- "GET", __path, params=__query, headers=__headers
2071
+ "GET",
2072
+ __path,
2073
+ params=__query,
2074
+ headers=__headers,
2075
+ endpoint_id="get_script",
2076
+ path_parts=__path_parts,
1962
2077
  )
1963
2078
 
1964
2079
  @_rewrite_parameters()
@@ -1973,8 +2088,9 @@ class AsyncElasticsearch(BaseClient):
1973
2088
  """
1974
2089
  Returns all script contexts.
1975
2090
 
1976
- `<https://www.elastic.co/guide/en/elasticsearch/painless/8.12/painless-contexts.html>`_
2091
+ `<https://www.elastic.co/guide/en/elasticsearch/painless/8.13/painless-contexts.html>`_
1977
2092
  """
2093
+ __path_parts: t.Dict[str, str] = {}
1978
2094
  __path = "/_script_context"
1979
2095
  __query: t.Dict[str, t.Any] = {}
1980
2096
  if error_trace is not None:
@@ -1987,7 +2103,12 @@ class AsyncElasticsearch(BaseClient):
1987
2103
  __query["pretty"] = pretty
1988
2104
  __headers = {"accept": "application/json"}
1989
2105
  return await self.perform_request( # type: ignore[return-value]
1990
- "GET", __path, params=__query, headers=__headers
2106
+ "GET",
2107
+ __path,
2108
+ params=__query,
2109
+ headers=__headers,
2110
+ endpoint_id="get_script_context",
2111
+ path_parts=__path_parts,
1991
2112
  )
1992
2113
 
1993
2114
  @_rewrite_parameters()
@@ -2002,8 +2123,9 @@ class AsyncElasticsearch(BaseClient):
2002
2123
  """
2003
2124
  Returns available script types, languages and contexts
2004
2125
 
2005
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-scripting.html>`_
2126
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-scripting.html>`_
2006
2127
  """
2128
+ __path_parts: t.Dict[str, str] = {}
2007
2129
  __path = "/_script_language"
2008
2130
  __query: t.Dict[str, t.Any] = {}
2009
2131
  if error_trace is not None:
@@ -2016,7 +2138,12 @@ class AsyncElasticsearch(BaseClient):
2016
2138
  __query["pretty"] = pretty
2017
2139
  __headers = {"accept": "application/json"}
2018
2140
  return await self.perform_request( # type: ignore[return-value]
2019
- "GET", __path, params=__query, headers=__headers
2141
+ "GET",
2142
+ __path,
2143
+ params=__query,
2144
+ headers=__headers,
2145
+ endpoint_id="get_script_languages",
2146
+ path_parts=__path_parts,
2020
2147
  )
2021
2148
 
2022
2149
  @_rewrite_parameters(
@@ -2051,7 +2178,7 @@ class AsyncElasticsearch(BaseClient):
2051
2178
  """
2052
2179
  Returns the source of a document.
2053
2180
 
2054
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-get.html>`_
2181
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-get.html>`_
2055
2182
 
2056
2183
  :param index: Name of the index that contains the document.
2057
2184
  :param id: Unique identifier of the document.
@@ -2077,7 +2204,8 @@ class AsyncElasticsearch(BaseClient):
2077
2204
  raise ValueError("Empty value passed for parameter 'index'")
2078
2205
  if id in SKIP_IN_PATH:
2079
2206
  raise ValueError("Empty value passed for parameter 'id'")
2080
- __path = f"/{_quote(index)}/_source/{_quote(id)}"
2207
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
2208
+ __path = f'/{__path_parts["index"]}/_source/{__path_parts["id"]}'
2081
2209
  __query: t.Dict[str, t.Any] = {}
2082
2210
  if error_trace is not None:
2083
2211
  __query["error_trace"] = error_trace
@@ -2109,7 +2237,12 @@ class AsyncElasticsearch(BaseClient):
2109
2237
  __query["version_type"] = version_type
2110
2238
  __headers = {"accept": "application/json"}
2111
2239
  return await self.perform_request( # type: ignore[return-value]
2112
- "GET", __path, params=__query, headers=__headers
2240
+ "GET",
2241
+ __path,
2242
+ params=__query,
2243
+ headers=__headers,
2244
+ endpoint_id="get_source",
2245
+ path_parts=__path_parts,
2113
2246
  )
2114
2247
 
2115
2248
  @_rewrite_parameters()
@@ -2128,7 +2261,7 @@ class AsyncElasticsearch(BaseClient):
2128
2261
  """
2129
2262
  Returns the health of the cluster.
2130
2263
 
2131
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/health-api.html>`_
2264
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/health-api.html>`_
2132
2265
 
2133
2266
  :param feature: A feature of the cluster, as returned by the top-level health
2134
2267
  report API.
@@ -2136,9 +2269,12 @@ class AsyncElasticsearch(BaseClient):
2136
2269
  :param timeout: Explicit operation timeout.
2137
2270
  :param verbose: Opt-in for more information about the health of the system.
2138
2271
  """
2272
+ __path_parts: t.Dict[str, str]
2139
2273
  if feature not in SKIP_IN_PATH:
2140
- __path = f"/_health_report/{_quote(feature)}"
2274
+ __path_parts = {"feature": _quote(feature)}
2275
+ __path = f'/_health_report/{__path_parts["feature"]}'
2141
2276
  else:
2277
+ __path_parts = {}
2142
2278
  __path = "/_health_report"
2143
2279
  __query: t.Dict[str, t.Any] = {}
2144
2280
  if error_trace is not None:
@@ -2157,7 +2293,12 @@ class AsyncElasticsearch(BaseClient):
2157
2293
  __query["verbose"] = verbose
2158
2294
  __headers = {"accept": "application/json"}
2159
2295
  return await self.perform_request( # type: ignore[return-value]
2160
- "GET", __path, params=__query, headers=__headers
2296
+ "GET",
2297
+ __path,
2298
+ params=__query,
2299
+ headers=__headers,
2300
+ endpoint_id="health_report",
2301
+ path_parts=__path_parts,
2161
2302
  )
2162
2303
 
2163
2304
  @_rewrite_parameters(
@@ -2195,7 +2336,7 @@ class AsyncElasticsearch(BaseClient):
2195
2336
  """
2196
2337
  Creates or updates a document in an index.
2197
2338
 
2198
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-index_.html>`_
2339
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-index_.html>`_
2199
2340
 
2200
2341
  :param index: Name of the data stream or index to target.
2201
2342
  :param document:
@@ -2238,11 +2379,14 @@ class AsyncElasticsearch(BaseClient):
2238
2379
  )
2239
2380
  elif document is not None and body is not None:
2240
2381
  raise ValueError("Cannot set both 'document' and 'body'")
2382
+ __path_parts: t.Dict[str, str]
2241
2383
  if index not in SKIP_IN_PATH and id not in SKIP_IN_PATH:
2242
- __path = f"/{_quote(index)}/_doc/{_quote(id)}"
2384
+ __path_parts = {"index": _quote(index), "id": _quote(id)}
2385
+ __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}'
2243
2386
  __method = "PUT"
2244
2387
  elif index not in SKIP_IN_PATH:
2245
- __path = f"/{_quote(index)}/_doc"
2388
+ __path_parts = {"index": _quote(index)}
2389
+ __path = f'/{__path_parts["index"]}/_doc'
2246
2390
  __method = "POST"
2247
2391
  else:
2248
2392
  raise ValueError("Couldn't find a path for the given parameters")
@@ -2280,7 +2424,13 @@ class AsyncElasticsearch(BaseClient):
2280
2424
  __body = document if document is not None else body
2281
2425
  __headers = {"accept": "application/json", "content-type": "application/json"}
2282
2426
  return await self.perform_request( # type: ignore[return-value]
2283
- __method, __path, params=__query, headers=__headers, body=__body
2427
+ __method,
2428
+ __path,
2429
+ params=__query,
2430
+ headers=__headers,
2431
+ body=__body,
2432
+ endpoint_id="index",
2433
+ path_parts=__path_parts,
2284
2434
  )
2285
2435
 
2286
2436
  @_rewrite_parameters()
@@ -2295,8 +2445,9 @@ class AsyncElasticsearch(BaseClient):
2295
2445
  """
2296
2446
  Returns basic information about the cluster.
2297
2447
 
2298
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/index.html>`_
2448
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/index.html>`_
2299
2449
  """
2450
+ __path_parts: t.Dict[str, str] = {}
2300
2451
  __path = "/"
2301
2452
  __query: t.Dict[str, t.Any] = {}
2302
2453
  if error_trace is not None:
@@ -2309,7 +2460,12 @@ class AsyncElasticsearch(BaseClient):
2309
2460
  __query["pretty"] = pretty
2310
2461
  __headers = {"accept": "application/json"}
2311
2462
  return await self.perform_request( # type: ignore[return-value]
2312
- "GET", __path, params=__query, headers=__headers
2463
+ "GET",
2464
+ __path,
2465
+ params=__query,
2466
+ headers=__headers,
2467
+ endpoint_id="info",
2468
+ path_parts=__path_parts,
2313
2469
  )
2314
2470
 
2315
2471
  @_rewrite_parameters(
@@ -2345,7 +2501,7 @@ class AsyncElasticsearch(BaseClient):
2345
2501
  """
2346
2502
  Performs a kNN search.
2347
2503
 
2348
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-search.html>`_
2504
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-search.html>`_
2349
2505
 
2350
2506
  :param index: A comma-separated list of index names to search; use `_all` or
2351
2507
  to perform the operation on all indices
@@ -2372,7 +2528,8 @@ class AsyncElasticsearch(BaseClient):
2372
2528
  raise ValueError("Empty value passed for parameter 'index'")
2373
2529
  if knn is None and body is None:
2374
2530
  raise ValueError("Empty value passed for parameter 'knn'")
2375
- __path = f"/{_quote(index)}/_knn_search"
2531
+ __path_parts: t.Dict[str, str] = {"index": _quote(index)}
2532
+ __path = f'/{__path_parts["index"]}/_knn_search'
2376
2533
  __query: t.Dict[str, t.Any] = {}
2377
2534
  __body: t.Dict[str, t.Any] = body if body is not None else {}
2378
2535
  if error_trace is not None:
@@ -2404,7 +2561,13 @@ class AsyncElasticsearch(BaseClient):
2404
2561
  if __body is not None:
2405
2562
  __headers["content-type"] = "application/json"
2406
2563
  return await self.perform_request( # type: ignore[return-value]
2407
- "POST", __path, params=__query, headers=__headers, body=__body
2564
+ "POST",
2565
+ __path,
2566
+ params=__query,
2567
+ headers=__headers,
2568
+ body=__body,
2569
+ endpoint_id="knn_search",
2570
+ path_parts=__path_parts,
2408
2571
  )
2409
2572
 
2410
2573
  @_rewrite_parameters(
@@ -2422,6 +2585,7 @@ class AsyncElasticsearch(BaseClient):
2422
2585
  docs: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
2423
2586
  error_trace: t.Optional[bool] = None,
2424
2587
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2588
+ force_synthetic_source: t.Optional[bool] = None,
2425
2589
  human: t.Optional[bool] = None,
2426
2590
  ids: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2427
2591
  preference: t.Optional[str] = None,
@@ -2438,12 +2602,16 @@ class AsyncElasticsearch(BaseClient):
2438
2602
  """
2439
2603
  Allows to get multiple documents in one request.
2440
2604
 
2441
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-multi-get.html>`_
2605
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-multi-get.html>`_
2442
2606
 
2443
2607
  :param index: Name of the index to retrieve documents from when `ids` are specified,
2444
2608
  or when a document in the `docs` array does not specify an index.
2445
2609
  :param docs: The documents you want to retrieve. Required if no index is specified
2446
2610
  in the request URI.
2611
+ :param force_synthetic_source: Should this request force synthetic _source? Use
2612
+ this to test if the mapping supports synthetic _source and to get a sense
2613
+ of the worst case performance. Fetches with this enabled will be slower the
2614
+ enabling synthetic source natively in the index.
2447
2615
  :param ids: The IDs of the documents you want to retrieve. Allowed when the index
2448
2616
  is specified in the request URI.
2449
2617
  :param preference: Specifies the node or shard the operation should be performed
@@ -2465,9 +2633,12 @@ class AsyncElasticsearch(BaseClient):
2465
2633
  :param stored_fields: If `true`, retrieves the document fields stored in the
2466
2634
  index rather than the document `_source`.
2467
2635
  """
2636
+ __path_parts: t.Dict[str, str]
2468
2637
  if index not in SKIP_IN_PATH:
2469
- __path = f"/{_quote(index)}/_mget"
2638
+ __path_parts = {"index": _quote(index)}
2639
+ __path = f'/{__path_parts["index"]}/_mget'
2470
2640
  else:
2641
+ __path_parts = {}
2471
2642
  __path = "/_mget"
2472
2643
  __query: t.Dict[str, t.Any] = {}
2473
2644
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -2475,6 +2646,8 @@ class AsyncElasticsearch(BaseClient):
2475
2646
  __query["error_trace"] = error_trace
2476
2647
  if filter_path is not None:
2477
2648
  __query["filter_path"] = filter_path
2649
+ if force_synthetic_source is not None:
2650
+ __query["force_synthetic_source"] = force_synthetic_source
2478
2651
  if human is not None:
2479
2652
  __query["human"] = human
2480
2653
  if preference is not None:
@@ -2502,7 +2675,13 @@ class AsyncElasticsearch(BaseClient):
2502
2675
  __body["ids"] = ids
2503
2676
  __headers = {"accept": "application/json", "content-type": "application/json"}
2504
2677
  return await self.perform_request( # type: ignore[return-value]
2505
- "POST", __path, params=__query, headers=__headers, body=__body
2678
+ "POST",
2679
+ __path,
2680
+ params=__query,
2681
+ headers=__headers,
2682
+ body=__body,
2683
+ endpoint_id="mget",
2684
+ path_parts=__path_parts,
2506
2685
  )
2507
2686
 
2508
2687
  @_rewrite_parameters(
@@ -2543,7 +2722,7 @@ class AsyncElasticsearch(BaseClient):
2543
2722
  """
2544
2723
  Allows to execute several search operations in one request.
2545
2724
 
2546
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-multi-search.html>`_
2725
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-multi-search.html>`_
2547
2726
 
2548
2727
  :param searches:
2549
2728
  :param index: Comma-separated list of data streams, indices, and index aliases
@@ -2587,9 +2766,12 @@ class AsyncElasticsearch(BaseClient):
2587
2766
  )
2588
2767
  elif searches is not None and body is not None:
2589
2768
  raise ValueError("Cannot set both 'searches' and 'body'")
2769
+ __path_parts: t.Dict[str, str]
2590
2770
  if index not in SKIP_IN_PATH:
2591
- __path = f"/{_quote(index)}/_msearch"
2771
+ __path_parts = {"index": _quote(index)}
2772
+ __path = f'/{__path_parts["index"]}/_msearch'
2592
2773
  else:
2774
+ __path_parts = {}
2593
2775
  __path = "/_msearch"
2594
2776
  __query: t.Dict[str, t.Any] = {}
2595
2777
  if allow_no_indices is not None:
@@ -2630,7 +2812,13 @@ class AsyncElasticsearch(BaseClient):
2630
2812
  "content-type": "application/x-ndjson",
2631
2813
  }
2632
2814
  return await self.perform_request( # type: ignore[return-value]
2633
- "POST", __path, params=__query, headers=__headers, body=__body
2815
+ "POST",
2816
+ __path,
2817
+ params=__query,
2818
+ headers=__headers,
2819
+ body=__body,
2820
+ endpoint_id="msearch",
2821
+ path_parts=__path_parts,
2634
2822
  )
2635
2823
 
2636
2824
  @_rewrite_parameters(
@@ -2657,7 +2845,7 @@ class AsyncElasticsearch(BaseClient):
2657
2845
  """
2658
2846
  Allows to execute several search template operations in one request.
2659
2847
 
2660
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-multi-search.html>`_
2848
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-multi-search.html>`_
2661
2849
 
2662
2850
  :param search_templates:
2663
2851
  :param index: Comma-separated list of data streams, indices, and aliases to search.
@@ -2680,9 +2868,12 @@ class AsyncElasticsearch(BaseClient):
2680
2868
  )
2681
2869
  elif search_templates is not None and body is not None:
2682
2870
  raise ValueError("Cannot set both 'search_templates' and 'body'")
2871
+ __path_parts: t.Dict[str, str]
2683
2872
  if index not in SKIP_IN_PATH:
2684
- __path = f"/{_quote(index)}/_msearch/template"
2873
+ __path_parts = {"index": _quote(index)}
2874
+ __path = f'/{__path_parts["index"]}/_msearch/template'
2685
2875
  else:
2876
+ __path_parts = {}
2686
2877
  __path = "/_msearch/template"
2687
2878
  __query: t.Dict[str, t.Any] = {}
2688
2879
  if ccs_minimize_roundtrips is not None:
@@ -2709,7 +2900,13 @@ class AsyncElasticsearch(BaseClient):
2709
2900
  "content-type": "application/x-ndjson",
2710
2901
  }
2711
2902
  return await self.perform_request( # type: ignore[return-value]
2712
- "POST", __path, params=__query, headers=__headers, body=__body
2903
+ "POST",
2904
+ __path,
2905
+ params=__query,
2906
+ headers=__headers,
2907
+ body=__body,
2908
+ endpoint_id="msearch_template",
2909
+ path_parts=__path_parts,
2713
2910
  )
2714
2911
 
2715
2912
  @_rewrite_parameters(
@@ -2743,7 +2940,7 @@ class AsyncElasticsearch(BaseClient):
2743
2940
  """
2744
2941
  Returns multiple termvectors in one request.
2745
2942
 
2746
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-multi-termvectors.html>`_
2943
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-multi-termvectors.html>`_
2747
2944
 
2748
2945
  :param index: Name of the index that contains the documents.
2749
2946
  :param docs: Array of existing or artificial documents.
@@ -2766,9 +2963,12 @@ class AsyncElasticsearch(BaseClient):
2766
2963
  :param version: If `true`, returns the document version as part of a hit.
2767
2964
  :param version_type: Specific version type.
2768
2965
  """
2966
+ __path_parts: t.Dict[str, str]
2769
2967
  if index not in SKIP_IN_PATH:
2770
- __path = f"/{_quote(index)}/_mtermvectors"
2968
+ __path_parts = {"index": _quote(index)}
2969
+ __path = f'/{__path_parts["index"]}/_mtermvectors'
2771
2970
  else:
2971
+ __path_parts = {}
2772
2972
  __path = "/_mtermvectors"
2773
2973
  __query: t.Dict[str, t.Any] = {}
2774
2974
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -2813,7 +3013,13 @@ class AsyncElasticsearch(BaseClient):
2813
3013
  if __body is not None:
2814
3014
  __headers["content-type"] = "application/json"
2815
3015
  return await self.perform_request( # type: ignore[return-value]
2816
- "POST", __path, params=__query, headers=__headers, body=__body
3016
+ "POST",
3017
+ __path,
3018
+ params=__query,
3019
+ headers=__headers,
3020
+ body=__body,
3021
+ endpoint_id="mtermvectors",
3022
+ path_parts=__path_parts,
2817
3023
  )
2818
3024
 
2819
3025
  @_rewrite_parameters()
@@ -2841,7 +3047,7 @@ class AsyncElasticsearch(BaseClient):
2841
3047
  """
2842
3048
  Open a point in time that can be used in subsequent searches
2843
3049
 
2844
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/point-in-time-api.html>`_
3050
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/point-in-time-api.html>`_
2845
3051
 
2846
3052
  :param index: A comma-separated list of index names to open point in time; use
2847
3053
  `_all` or empty string to perform the operation on all indices
@@ -2860,7 +3066,8 @@ class AsyncElasticsearch(BaseClient):
2860
3066
  raise ValueError("Empty value passed for parameter 'index'")
2861
3067
  if keep_alive is None:
2862
3068
  raise ValueError("Empty value passed for parameter 'keep_alive'")
2863
- __path = f"/{_quote(index)}/_pit"
3069
+ __path_parts: t.Dict[str, str] = {"index": _quote(index)}
3070
+ __path = f'/{__path_parts["index"]}/_pit'
2864
3071
  __query: t.Dict[str, t.Any] = {}
2865
3072
  if keep_alive is not None:
2866
3073
  __query["keep_alive"] = keep_alive
@@ -2882,7 +3089,12 @@ class AsyncElasticsearch(BaseClient):
2882
3089
  __query["routing"] = routing
2883
3090
  __headers = {"accept": "application/json"}
2884
3091
  return await self.perform_request( # type: ignore[return-value]
2885
- "POST", __path, params=__query, headers=__headers
3092
+ "POST",
3093
+ __path,
3094
+ params=__query,
3095
+ headers=__headers,
3096
+ endpoint_id="open_point_in_time",
3097
+ path_parts=__path_parts,
2886
3098
  )
2887
3099
 
2888
3100
  @_rewrite_parameters(
@@ -2907,7 +3119,7 @@ class AsyncElasticsearch(BaseClient):
2907
3119
  """
2908
3120
  Creates or updates a script.
2909
3121
 
2910
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-scripting.html>`_
3122
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-scripting.html>`_
2911
3123
 
2912
3124
  :param id: Identifier for the stored script or search template. Must be unique
2913
3125
  within the cluster.
@@ -2926,10 +3138,13 @@ class AsyncElasticsearch(BaseClient):
2926
3138
  raise ValueError("Empty value passed for parameter 'id'")
2927
3139
  if script is None and body is None:
2928
3140
  raise ValueError("Empty value passed for parameter 'script'")
3141
+ __path_parts: t.Dict[str, str]
2929
3142
  if id not in SKIP_IN_PATH and context not in SKIP_IN_PATH:
2930
- __path = f"/_scripts/{_quote(id)}/{_quote(context)}"
3143
+ __path_parts = {"id": _quote(id), "context": _quote(context)}
3144
+ __path = f'/_scripts/{__path_parts["id"]}/{__path_parts["context"]}'
2931
3145
  elif id not in SKIP_IN_PATH:
2932
- __path = f"/_scripts/{_quote(id)}"
3146
+ __path_parts = {"id": _quote(id)}
3147
+ __path = f'/_scripts/{__path_parts["id"]}'
2933
3148
  else:
2934
3149
  raise ValueError("Couldn't find a path for the given parameters")
2935
3150
  __query: t.Dict[str, t.Any] = {}
@@ -2951,7 +3166,13 @@ class AsyncElasticsearch(BaseClient):
2951
3166
  __body["script"] = script
2952
3167
  __headers = {"accept": "application/json", "content-type": "application/json"}
2953
3168
  return await self.perform_request( # type: ignore[return-value]
2954
- "PUT", __path, params=__query, headers=__headers, body=__body
3169
+ "PUT",
3170
+ __path,
3171
+ params=__query,
3172
+ headers=__headers,
3173
+ body=__body,
3174
+ endpoint_id="put_script",
3175
+ path_parts=__path_parts,
2955
3176
  )
2956
3177
 
2957
3178
  @_rewrite_parameters(
@@ -2984,7 +3205,7 @@ class AsyncElasticsearch(BaseClient):
2984
3205
  Allows to evaluate the quality of ranked search results over a set of typical
2985
3206
  search queries
2986
3207
 
2987
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-rank-eval.html>`_
3208
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-rank-eval.html>`_
2988
3209
 
2989
3210
  :param requests: A set of typical search requests, together with their provided
2990
3211
  ratings.
@@ -3006,9 +3227,12 @@ class AsyncElasticsearch(BaseClient):
3006
3227
  """
3007
3228
  if requests is None and body is None:
3008
3229
  raise ValueError("Empty value passed for parameter 'requests'")
3230
+ __path_parts: t.Dict[str, str]
3009
3231
  if index not in SKIP_IN_PATH:
3010
- __path = f"/{_quote(index)}/_rank_eval"
3232
+ __path_parts = {"index": _quote(index)}
3233
+ __path = f'/{__path_parts["index"]}/_rank_eval'
3011
3234
  else:
3235
+ __path_parts = {}
3012
3236
  __path = "/_rank_eval"
3013
3237
  __query: t.Dict[str, t.Any] = {}
3014
3238
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3035,7 +3259,13 @@ class AsyncElasticsearch(BaseClient):
3035
3259
  __body["metric"] = metric
3036
3260
  __headers = {"accept": "application/json", "content-type": "application/json"}
3037
3261
  return await self.perform_request( # type: ignore[return-value]
3038
- "POST", __path, params=__query, headers=__headers, body=__body
3262
+ "POST",
3263
+ __path,
3264
+ params=__query,
3265
+ headers=__headers,
3266
+ body=__body,
3267
+ endpoint_id="rank_eval",
3268
+ path_parts=__path_parts,
3039
3269
  )
3040
3270
 
3041
3271
  @_rewrite_parameters(
@@ -3071,7 +3301,7 @@ class AsyncElasticsearch(BaseClient):
3071
3301
  source documents by a query, changing the destination index settings, or fetching
3072
3302
  the documents from a remote cluster.
3073
3303
 
3074
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-reindex.html>`_
3304
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-reindex.html>`_
3075
3305
 
3076
3306
  :param dest: The destination you are copying to.
3077
3307
  :param source: The source you are copying from.
@@ -3101,6 +3331,7 @@ class AsyncElasticsearch(BaseClient):
3101
3331
  raise ValueError("Empty value passed for parameter 'dest'")
3102
3332
  if source is None and body is None:
3103
3333
  raise ValueError("Empty value passed for parameter 'source'")
3334
+ __path_parts: t.Dict[str, str] = {}
3104
3335
  __path = "/_reindex"
3105
3336
  __query: t.Dict[str, t.Any] = {}
3106
3337
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3143,7 +3374,13 @@ class AsyncElasticsearch(BaseClient):
3143
3374
  __body["size"] = size
3144
3375
  __headers = {"accept": "application/json", "content-type": "application/json"}
3145
3376
  return await self.perform_request( # type: ignore[return-value]
3146
- "POST", __path, params=__query, headers=__headers, body=__body
3377
+ "POST",
3378
+ __path,
3379
+ params=__query,
3380
+ headers=__headers,
3381
+ body=__body,
3382
+ endpoint_id="reindex",
3383
+ path_parts=__path_parts,
3147
3384
  )
3148
3385
 
3149
3386
  @_rewrite_parameters()
@@ -3160,7 +3397,7 @@ class AsyncElasticsearch(BaseClient):
3160
3397
  """
3161
3398
  Changes the number of requests per second for a particular Reindex operation.
3162
3399
 
3163
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-reindex.html>`_
3400
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-reindex.html>`_
3164
3401
 
3165
3402
  :param task_id: Identifier for the task.
3166
3403
  :param requests_per_second: The throttle for this request in sub-requests per
@@ -3168,7 +3405,8 @@ class AsyncElasticsearch(BaseClient):
3168
3405
  """
3169
3406
  if task_id in SKIP_IN_PATH:
3170
3407
  raise ValueError("Empty value passed for parameter 'task_id'")
3171
- __path = f"/_reindex/{_quote(task_id)}/_rethrottle"
3408
+ __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
3409
+ __path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle'
3172
3410
  __query: t.Dict[str, t.Any] = {}
3173
3411
  if error_trace is not None:
3174
3412
  __query["error_trace"] = error_trace
@@ -3182,7 +3420,12 @@ class AsyncElasticsearch(BaseClient):
3182
3420
  __query["requests_per_second"] = requests_per_second
3183
3421
  __headers = {"accept": "application/json"}
3184
3422
  return await self.perform_request( # type: ignore[return-value]
3185
- "POST", __path, params=__query, headers=__headers
3423
+ "POST",
3424
+ __path,
3425
+ params=__query,
3426
+ headers=__headers,
3427
+ endpoint_id="reindex_rethrottle",
3428
+ path_parts=__path_parts,
3186
3429
  )
3187
3430
 
3188
3431
  @_rewrite_parameters(
@@ -3205,7 +3448,7 @@ class AsyncElasticsearch(BaseClient):
3205
3448
  """
3206
3449
  Allows to use the Mustache language to pre-render a search definition.
3207
3450
 
3208
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/render-search-template-api.html>`_
3451
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/render-search-template-api.html>`_
3209
3452
 
3210
3453
  :param id: ID of the search template to render. If no `source` is specified,
3211
3454
  this or the `id` request body parameter is required.
@@ -3216,9 +3459,12 @@ class AsyncElasticsearch(BaseClient):
3216
3459
  search API's request body. These parameters also support Mustache variables.
3217
3460
  If no `id` or `<templated-id>` is specified, this parameter is required.
3218
3461
  """
3462
+ __path_parts: t.Dict[str, str]
3219
3463
  if id not in SKIP_IN_PATH:
3220
- __path = f"/_render/template/{_quote(id)}"
3464
+ __path_parts = {"id": _quote(id)}
3465
+ __path = f'/_render/template/{__path_parts["id"]}'
3221
3466
  else:
3467
+ __path_parts = {}
3222
3468
  __path = "/_render/template"
3223
3469
  __query: t.Dict[str, t.Any] = {}
3224
3470
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3243,7 +3489,13 @@ class AsyncElasticsearch(BaseClient):
3243
3489
  if __body is not None:
3244
3490
  __headers["content-type"] = "application/json"
3245
3491
  return await self.perform_request( # type: ignore[return-value]
3246
- "POST", __path, params=__query, headers=__headers, body=__body
3492
+ "POST",
3493
+ __path,
3494
+ params=__query,
3495
+ headers=__headers,
3496
+ body=__body,
3497
+ endpoint_id="render_search_template",
3498
+ path_parts=__path_parts,
3247
3499
  )
3248
3500
 
3249
3501
  @_rewrite_parameters(
@@ -3264,12 +3516,13 @@ class AsyncElasticsearch(BaseClient):
3264
3516
  """
3265
3517
  Allows an arbitrary script to be executed and a result to be returned
3266
3518
 
3267
- `<https://www.elastic.co/guide/en/elasticsearch/painless/8.12/painless-execute-api.html>`_
3519
+ `<https://www.elastic.co/guide/en/elasticsearch/painless/8.13/painless-execute-api.html>`_
3268
3520
 
3269
3521
  :param context: The context that the script should run in.
3270
3522
  :param context_setup: Additional parameters for the `context`.
3271
3523
  :param script: The Painless script to execute.
3272
3524
  """
3525
+ __path_parts: t.Dict[str, str] = {}
3273
3526
  __path = "/_scripts/painless/_execute"
3274
3527
  __query: t.Dict[str, t.Any] = {}
3275
3528
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3294,7 +3547,13 @@ class AsyncElasticsearch(BaseClient):
3294
3547
  if __body is not None:
3295
3548
  __headers["content-type"] = "application/json"
3296
3549
  return await self.perform_request( # type: ignore[return-value]
3297
- "POST", __path, params=__query, headers=__headers, body=__body
3550
+ "POST",
3551
+ __path,
3552
+ params=__query,
3553
+ headers=__headers,
3554
+ body=__body,
3555
+ endpoint_id="scripts_painless_execute",
3556
+ path_parts=__path_parts,
3298
3557
  )
3299
3558
 
3300
3559
  @_rewrite_parameters(
@@ -3315,7 +3574,7 @@ class AsyncElasticsearch(BaseClient):
3315
3574
  """
3316
3575
  Allows to retrieve a large numbers of results from a single search request.
3317
3576
 
3318
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-request-body.html#request-body-search-scroll>`_
3577
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-request-body.html#request-body-search-scroll>`_
3319
3578
 
3320
3579
  :param scroll_id: Scroll ID of the search.
3321
3580
  :param rest_total_hits_as_int: If true, the API response’s hit.total property
@@ -3325,6 +3584,7 @@ class AsyncElasticsearch(BaseClient):
3325
3584
  """
3326
3585
  if scroll_id is None and body is None:
3327
3586
  raise ValueError("Empty value passed for parameter 'scroll_id'")
3587
+ __path_parts: t.Dict[str, str] = {}
3328
3588
  __path = "/_search/scroll"
3329
3589
  __query: t.Dict[str, t.Any] = {}
3330
3590
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3349,7 +3609,13 @@ class AsyncElasticsearch(BaseClient):
3349
3609
  if __body is not None:
3350
3610
  __headers["content-type"] = "application/json"
3351
3611
  return await self.perform_request( # type: ignore[return-value]
3352
- "POST", __path, params=__query, headers=__headers, body=__body
3612
+ "POST",
3613
+ __path,
3614
+ params=__query,
3615
+ headers=__headers,
3616
+ body=__body,
3617
+ endpoint_id="scroll",
3618
+ path_parts=__path_parts,
3353
3619
  )
3354
3620
 
3355
3621
  @_rewrite_parameters(
@@ -3425,6 +3691,7 @@ class AsyncElasticsearch(BaseClient):
3425
3691
  ext: t.Optional[t.Mapping[str, t.Any]] = None,
3426
3692
  fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
3427
3693
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3694
+ force_synthetic_source: t.Optional[bool] = None,
3428
3695
  from_: t.Optional[int] = None,
3429
3696
  highlight: t.Optional[t.Mapping[str, t.Any]] = None,
3430
3697
  human: t.Optional[bool] = None,
@@ -3494,7 +3761,7 @@ class AsyncElasticsearch(BaseClient):
3494
3761
  """
3495
3762
  Returns results matching a query.
3496
3763
 
3497
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-search.html>`_
3764
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-search.html>`_
3498
3765
 
3499
3766
  :param index: Comma-separated list of data streams, indices, and aliases to search.
3500
3767
  Supports wildcards (`*`). To search all data streams and indices, omit this
@@ -3541,6 +3808,10 @@ class AsyncElasticsearch(BaseClient):
3541
3808
  :param fields: Array of wildcard (`*`) patterns. The request returns values for
3542
3809
  field names matching these patterns in the `hits.fields` property of the
3543
3810
  response.
3811
+ :param force_synthetic_source: Should this request force synthetic _source? Use
3812
+ this to test if the mapping supports synthetic _source and to get a sense
3813
+ of the worst case performance. Fetches with this enabled will be slower the
3814
+ enabling synthetic source natively in the index.
3544
3815
  :param from_: Starting document offset. Needs to be non-negative. By default,
3545
3816
  you cannot page through more than 10,000 hits using the `from` and `size`
3546
3817
  parameters. To page through more hits, use the `search_after` parameter.
@@ -3678,9 +3949,12 @@ class AsyncElasticsearch(BaseClient):
3678
3949
  by their respective types in the response.
3679
3950
  :param version: If true, returns document version as part of a hit.
3680
3951
  """
3952
+ __path_parts: t.Dict[str, str]
3681
3953
  if index not in SKIP_IN_PATH:
3682
- __path = f"/{_quote(index)}/_search"
3954
+ __path_parts = {"index": _quote(index)}
3955
+ __path = f'/{__path_parts["index"]}/_search'
3683
3956
  else:
3957
+ __path_parts = {}
3684
3958
  __path = "/_search"
3685
3959
  __query: t.Dict[str, t.Any] = {}
3686
3960
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3717,6 +3991,8 @@ class AsyncElasticsearch(BaseClient):
3717
3991
  __query["expand_wildcards"] = expand_wildcards
3718
3992
  if filter_path is not None:
3719
3993
  __query["filter_path"] = filter_path
3994
+ if force_synthetic_source is not None:
3995
+ __query["force_synthetic_source"] = force_synthetic_source
3720
3996
  if human is not None:
3721
3997
  __query["human"] = human
3722
3998
  if ignore_throttled is not None:
@@ -3836,7 +4112,13 @@ class AsyncElasticsearch(BaseClient):
3836
4112
  if __body is not None:
3837
4113
  __headers["content-type"] = "application/json"
3838
4114
  return await self.perform_request( # type: ignore[return-value]
3839
- "POST", __path, params=__query, headers=__headers, body=__body
4115
+ "POST",
4116
+ __path,
4117
+ params=__query,
4118
+ headers=__headers,
4119
+ body=__body,
4120
+ endpoint_id="search",
4121
+ path_parts=__path_parts,
3840
4122
  )
3841
4123
 
3842
4124
  @_rewrite_parameters(
@@ -3896,7 +4178,7 @@ class AsyncElasticsearch(BaseClient):
3896
4178
  Searches a vector tile for geospatial values. Returns results as a binary Mapbox
3897
4179
  vector tile.
3898
4180
 
3899
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-vector-tile-api.html>`_
4181
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-vector-tile-api.html>`_
3900
4182
 
3901
4183
  :param index: Comma-separated list of data streams, indices, or aliases to search
3902
4184
  :param field: Field containing geospatial data to return
@@ -3951,7 +4233,14 @@ class AsyncElasticsearch(BaseClient):
3951
4233
  raise ValueError("Empty value passed for parameter 'x'")
3952
4234
  if y in SKIP_IN_PATH:
3953
4235
  raise ValueError("Empty value passed for parameter 'y'")
3954
- __path = f"/{_quote(index)}/_mvt/{_quote(field)}/{_quote(zoom)}/{_quote(x)}/{_quote(y)}"
4236
+ __path_parts: t.Dict[str, str] = {
4237
+ "index": _quote(index),
4238
+ "field": _quote(field),
4239
+ "zoom": _quote(zoom),
4240
+ "x": _quote(x),
4241
+ "y": _quote(y),
4242
+ }
4243
+ __path = f'/{__path_parts["index"]}/_mvt/{__path_parts["field"]}/{__path_parts["zoom"]}/{__path_parts["x"]}/{__path_parts["y"]}'
3955
4244
  __query: t.Dict[str, t.Any] = {}
3956
4245
  __body: t.Dict[str, t.Any] = body if body is not None else {}
3957
4246
  # The 'sort' parameter with a colon can't be encoded to the body.
@@ -4008,7 +4297,13 @@ class AsyncElasticsearch(BaseClient):
4008
4297
  if __body is not None:
4009
4298
  __headers["content-type"] = "application/json"
4010
4299
  return await self.perform_request( # type: ignore[return-value]
4011
- "POST", __path, params=__query, headers=__headers, body=__body
4300
+ "POST",
4301
+ __path,
4302
+ params=__query,
4303
+ headers=__headers,
4304
+ body=__body,
4305
+ endpoint_id="search_mvt",
4306
+ path_parts=__path_parts,
4012
4307
  )
4013
4308
 
4014
4309
  @_rewrite_parameters()
@@ -4038,7 +4333,7 @@ class AsyncElasticsearch(BaseClient):
4038
4333
  Returns information about the indices and shards that a search request would
4039
4334
  be executed against.
4040
4335
 
4041
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-shards.html>`_
4336
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-shards.html>`_
4042
4337
 
4043
4338
  :param index: Returns the indices and shards that a search request would be executed
4044
4339
  against.
@@ -4059,9 +4354,12 @@ class AsyncElasticsearch(BaseClient):
4059
4354
  on. Random by default.
4060
4355
  :param routing: Custom value used to route operations to a specific shard.
4061
4356
  """
4357
+ __path_parts: t.Dict[str, str]
4062
4358
  if index not in SKIP_IN_PATH:
4063
- __path = f"/{_quote(index)}/_search_shards"
4359
+ __path_parts = {"index": _quote(index)}
4360
+ __path = f'/{__path_parts["index"]}/_search_shards'
4064
4361
  else:
4362
+ __path_parts = {}
4065
4363
  __path = "/_search_shards"
4066
4364
  __query: t.Dict[str, t.Any] = {}
4067
4365
  if allow_no_indices is not None:
@@ -4086,7 +4384,12 @@ class AsyncElasticsearch(BaseClient):
4086
4384
  __query["routing"] = routing
4087
4385
  __headers = {"accept": "application/json"}
4088
4386
  return await self.perform_request( # type: ignore[return-value]
4089
- "POST", __path, params=__query, headers=__headers
4387
+ "POST",
4388
+ __path,
4389
+ params=__query,
4390
+ headers=__headers,
4391
+ endpoint_id="search_shards",
4392
+ path_parts=__path_parts,
4090
4393
  )
4091
4394
 
4092
4395
  @_rewrite_parameters(
@@ -4131,7 +4434,7 @@ class AsyncElasticsearch(BaseClient):
4131
4434
  """
4132
4435
  Allows to use the Mustache language to pre-render a search definition.
4133
4436
 
4134
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-template.html>`_
4437
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-template.html>`_
4135
4438
 
4136
4439
  :param index: Comma-separated list of data streams, indices, and aliases to search.
4137
4440
  Supports wildcards (*).
@@ -4171,9 +4474,12 @@ class AsyncElasticsearch(BaseClient):
4171
4474
  :param typed_keys: If `true`, the response prefixes aggregation and suggester
4172
4475
  names with their respective types.
4173
4476
  """
4477
+ __path_parts: t.Dict[str, str]
4174
4478
  if index not in SKIP_IN_PATH:
4175
- __path = f"/{_quote(index)}/_search/template"
4479
+ __path_parts = {"index": _quote(index)}
4480
+ __path = f'/{__path_parts["index"]}/_search/template'
4176
4481
  else:
4482
+ __path_parts = {}
4177
4483
  __path = "/_search/template"
4178
4484
  __query: t.Dict[str, t.Any] = {}
4179
4485
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -4220,7 +4526,13 @@ class AsyncElasticsearch(BaseClient):
4220
4526
  __body["source"] = source
4221
4527
  __headers = {"accept": "application/json", "content-type": "application/json"}
4222
4528
  return await self.perform_request( # type: ignore[return-value]
4223
- "POST", __path, params=__query, headers=__headers, body=__body
4529
+ "POST",
4530
+ __path,
4531
+ params=__query,
4532
+ headers=__headers,
4533
+ body=__body,
4534
+ endpoint_id="search_template",
4535
+ path_parts=__path_parts,
4224
4536
  )
4225
4537
 
4226
4538
  @_rewrite_parameters(
@@ -4256,7 +4568,7 @@ class AsyncElasticsearch(BaseClient):
4256
4568
  the provided string. It is designed for low-latency look-ups used in auto-complete
4257
4569
  scenarios.
4258
4570
 
4259
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-terms-enum.html>`_
4571
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-terms-enum.html>`_
4260
4572
 
4261
4573
  :param index: Comma-separated list of data streams, indices, and index aliases
4262
4574
  to search. Wildcard (*) expressions are supported.
@@ -4279,7 +4591,8 @@ class AsyncElasticsearch(BaseClient):
4279
4591
  raise ValueError("Empty value passed for parameter 'index'")
4280
4592
  if field is None and body is None:
4281
4593
  raise ValueError("Empty value passed for parameter 'field'")
4282
- __path = f"/{_quote(index)}/_terms_enum"
4594
+ __path_parts: t.Dict[str, str] = {"index": _quote(index)}
4595
+ __path = f'/{__path_parts["index"]}/_terms_enum'
4283
4596
  __query: t.Dict[str, t.Any] = {}
4284
4597
  __body: t.Dict[str, t.Any] = body if body is not None else {}
4285
4598
  if error_trace is not None:
@@ -4311,7 +4624,13 @@ class AsyncElasticsearch(BaseClient):
4311
4624
  if __body is not None:
4312
4625
  __headers["content-type"] = "application/json"
4313
4626
  return await self.perform_request( # type: ignore[return-value]
4314
- "POST", __path, params=__query, headers=__headers, body=__body
4627
+ "POST",
4628
+ __path,
4629
+ params=__query,
4630
+ headers=__headers,
4631
+ body=__body,
4632
+ endpoint_id="terms_enum",
4633
+ path_parts=__path_parts,
4315
4634
  )
4316
4635
 
4317
4636
  @_rewrite_parameters(
@@ -4348,7 +4667,7 @@ class AsyncElasticsearch(BaseClient):
4348
4667
  Returns information and statistics about terms in the fields of a particular
4349
4668
  document.
4350
4669
 
4351
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-termvectors.html>`_
4670
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-termvectors.html>`_
4352
4671
 
4353
4672
  :param index: Name of the index that contains the document.
4354
4673
  :param id: Unique identifier of the document.
@@ -4375,10 +4694,13 @@ class AsyncElasticsearch(BaseClient):
4375
4694
  """
4376
4695
  if index in SKIP_IN_PATH:
4377
4696
  raise ValueError("Empty value passed for parameter 'index'")
4697
+ __path_parts: t.Dict[str, str]
4378
4698
  if index not in SKIP_IN_PATH and id not in SKIP_IN_PATH:
4379
- __path = f"/{_quote(index)}/_termvectors/{_quote(id)}"
4699
+ __path_parts = {"index": _quote(index), "id": _quote(id)}
4700
+ __path = f'/{__path_parts["index"]}/_termvectors/{__path_parts["id"]}'
4380
4701
  elif index not in SKIP_IN_PATH:
4381
- __path = f"/{_quote(index)}/_termvectors"
4702
+ __path_parts = {"index": _quote(index)}
4703
+ __path = f'/{__path_parts["index"]}/_termvectors'
4382
4704
  else:
4383
4705
  raise ValueError("Couldn't find a path for the given parameters")
4384
4706
  __query: t.Dict[str, t.Any] = {}
@@ -4426,7 +4748,13 @@ class AsyncElasticsearch(BaseClient):
4426
4748
  if __body is not None:
4427
4749
  __headers["content-type"] = "application/json"
4428
4750
  return await self.perform_request( # type: ignore[return-value]
4429
- "POST", __path, params=__query, headers=__headers, body=__body
4751
+ "POST",
4752
+ __path,
4753
+ params=__query,
4754
+ headers=__headers,
4755
+ body=__body,
4756
+ endpoint_id="termvectors",
4757
+ path_parts=__path_parts,
4430
4758
  )
4431
4759
 
4432
4760
  @_rewrite_parameters(
@@ -4481,7 +4809,7 @@ class AsyncElasticsearch(BaseClient):
4481
4809
  """
4482
4810
  Updates a document with a script or partial document.
4483
4811
 
4484
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-update.html>`_
4812
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-update.html>`_
4485
4813
 
4486
4814
  :param index: The name of the index
4487
4815
  :param id: Document ID
@@ -4523,7 +4851,8 @@ class AsyncElasticsearch(BaseClient):
4523
4851
  raise ValueError("Empty value passed for parameter 'index'")
4524
4852
  if id in SKIP_IN_PATH:
4525
4853
  raise ValueError("Empty value passed for parameter 'id'")
4526
- __path = f"/{_quote(index)}/_update/{_quote(id)}"
4854
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
4855
+ __path = f'/{__path_parts["index"]}/_update/{__path_parts["id"]}'
4527
4856
  __query: t.Dict[str, t.Any] = {}
4528
4857
  __body: t.Dict[str, t.Any] = body if body is not None else {}
4529
4858
  if error_trace is not None:
@@ -4573,7 +4902,13 @@ class AsyncElasticsearch(BaseClient):
4573
4902
  __body["upsert"] = upsert
4574
4903
  __headers = {"accept": "application/json", "content-type": "application/json"}
4575
4904
  return await self.perform_request( # type: ignore[return-value]
4576
- "POST", __path, params=__query, headers=__headers, body=__body
4905
+ "POST",
4906
+ __path,
4907
+ params=__query,
4908
+ headers=__headers,
4909
+ body=__body,
4910
+ endpoint_id="update",
4911
+ path_parts=__path_parts,
4577
4912
  )
4578
4913
 
4579
4914
  @_rewrite_parameters(
@@ -4637,10 +4972,11 @@ class AsyncElasticsearch(BaseClient):
4637
4972
  body: t.Optional[t.Dict[str, t.Any]] = None,
4638
4973
  ) -> ObjectApiResponse[t.Any]:
4639
4974
  """
4640
- Performs an update on every document in the index without changing the source,
4641
- for example to pick up a mapping change.
4975
+ Updates documents that match the specified query. If no query is specified, performs
4976
+ an update on every document in the index without changing the source, for example
4977
+ to pick up a mapping change.
4642
4978
 
4643
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-update-by-query.html>`_
4979
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-update-by-query.html>`_
4644
4980
 
4645
4981
  :param index: Comma-separated list of data streams, indices, and aliases to search.
4646
4982
  Supports wildcards (`*`). To search all data streams or indices, omit this
@@ -4714,7 +5050,8 @@ class AsyncElasticsearch(BaseClient):
4714
5050
  """
4715
5051
  if index in SKIP_IN_PATH:
4716
5052
  raise ValueError("Empty value passed for parameter 'index'")
4717
- __path = f"/{_quote(index)}/_update_by_query"
5053
+ __path_parts: t.Dict[str, str] = {"index": _quote(index)}
5054
+ __path = f'/{__path_parts["index"]}/_update_by_query'
4718
5055
  __query: t.Dict[str, t.Any] = {}
4719
5056
  __body: t.Dict[str, t.Any] = body if body is not None else {}
4720
5057
  # The 'sort' parameter with a colon can't be encoded to the body.
@@ -4809,7 +5146,13 @@ class AsyncElasticsearch(BaseClient):
4809
5146
  if __body is not None:
4810
5147
  __headers["content-type"] = "application/json"
4811
5148
  return await self.perform_request( # type: ignore[return-value]
4812
- "POST", __path, params=__query, headers=__headers, body=__body
5149
+ "POST",
5150
+ __path,
5151
+ params=__query,
5152
+ headers=__headers,
5153
+ body=__body,
5154
+ endpoint_id="update_by_query",
5155
+ path_parts=__path_parts,
4813
5156
  )
4814
5157
 
4815
5158
  @_rewrite_parameters()
@@ -4826,7 +5169,7 @@ class AsyncElasticsearch(BaseClient):
4826
5169
  """
4827
5170
  Changes the number of requests per second for a particular Update By Query operation.
4828
5171
 
4829
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-update-by-query.html>`_
5172
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-update-by-query.html>`_
4830
5173
 
4831
5174
  :param task_id: The ID for the task.
4832
5175
  :param requests_per_second: The throttle for this request in sub-requests per
@@ -4834,7 +5177,8 @@ class AsyncElasticsearch(BaseClient):
4834
5177
  """
4835
5178
  if task_id in SKIP_IN_PATH:
4836
5179
  raise ValueError("Empty value passed for parameter 'task_id'")
4837
- __path = f"/_update_by_query/{_quote(task_id)}/_rethrottle"
5180
+ __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
5181
+ __path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle'
4838
5182
  __query: t.Dict[str, t.Any] = {}
4839
5183
  if error_trace is not None:
4840
5184
  __query["error_trace"] = error_trace
@@ -4848,5 +5192,10 @@ class AsyncElasticsearch(BaseClient):
4848
5192
  __query["requests_per_second"] = requests_per_second
4849
5193
  __headers = {"accept": "application/json"}
4850
5194
  return await self.perform_request( # type: ignore[return-value]
4851
- "POST", __path, params=__query, headers=__headers
5195
+ "POST",
5196
+ __path,
5197
+ params=__query,
5198
+ headers=__headers,
5199
+ endpoint_id="update_by_query_rethrottle",
5200
+ path_parts=__path_parts,
4852
5201
  )