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 Elasticsearch(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__(
@@ -638,7 +638,7 @@ class Elasticsearch(BaseClient):
638
638
  """
639
639
  Allows to perform multiple index/update/delete operations in a single request.
640
640
 
641
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-bulk.html>`_
641
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-bulk.html>`_
642
642
 
643
643
  :param operations:
644
644
  :param index: Name of the data stream, index, or index alias to perform bulk
@@ -672,9 +672,12 @@ class Elasticsearch(BaseClient):
672
672
  )
673
673
  elif operations is not None and body is not None:
674
674
  raise ValueError("Cannot set both 'operations' and 'body'")
675
+ __path_parts: t.Dict[str, str]
675
676
  if index not in SKIP_IN_PATH:
676
- __path = f"/{_quote(index)}/_bulk"
677
+ __path_parts = {"index": _quote(index)}
678
+ __path = f'/{__path_parts["index"]}/_bulk'
677
679
  else:
680
+ __path_parts = {}
678
681
  __path = "/_bulk"
679
682
  __query: t.Dict[str, t.Any] = {}
680
683
  if error_trace is not None:
@@ -709,7 +712,13 @@ class Elasticsearch(BaseClient):
709
712
  "content-type": "application/x-ndjson",
710
713
  }
711
714
  return self.perform_request( # type: ignore[return-value]
712
- "PUT", __path, params=__query, headers=__headers, body=__body
715
+ "PUT",
716
+ __path,
717
+ params=__query,
718
+ headers=__headers,
719
+ body=__body,
720
+ endpoint_id="bulk",
721
+ path_parts=__path_parts,
713
722
  )
714
723
 
715
724
  @_rewrite_parameters(
@@ -728,10 +737,11 @@ class Elasticsearch(BaseClient):
728
737
  """
729
738
  Explicitly clears the search context for a scroll.
730
739
 
731
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/clear-scroll-api.html>`_
740
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/clear-scroll-api.html>`_
732
741
 
733
742
  :param scroll_id: Scroll IDs to clear. To clear all scroll IDs, use `_all`.
734
743
  """
744
+ __path_parts: t.Dict[str, str] = {}
735
745
  __path = "/_search/scroll"
736
746
  __query: t.Dict[str, t.Any] = {}
737
747
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -752,7 +762,13 @@ class Elasticsearch(BaseClient):
752
762
  if __body is not None:
753
763
  __headers["content-type"] = "application/json"
754
764
  return self.perform_request( # type: ignore[return-value]
755
- "DELETE", __path, params=__query, headers=__headers, body=__body
765
+ "DELETE",
766
+ __path,
767
+ params=__query,
768
+ headers=__headers,
769
+ body=__body,
770
+ endpoint_id="clear_scroll",
771
+ path_parts=__path_parts,
756
772
  )
757
773
 
758
774
  @_rewrite_parameters(
@@ -771,12 +787,13 @@ class Elasticsearch(BaseClient):
771
787
  """
772
788
  Close a point in time
773
789
 
774
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/point-in-time-api.html>`_
790
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/point-in-time-api.html>`_
775
791
 
776
792
  :param id: The ID of the point-in-time.
777
793
  """
778
794
  if id is None and body is None:
779
795
  raise ValueError("Empty value passed for parameter 'id'")
796
+ __path_parts: t.Dict[str, str] = {}
780
797
  __path = "/_pit"
781
798
  __query: t.Dict[str, t.Any] = {}
782
799
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -797,7 +814,13 @@ class Elasticsearch(BaseClient):
797
814
  if __body is not None:
798
815
  __headers["content-type"] = "application/json"
799
816
  return self.perform_request( # type: ignore[return-value]
800
- "DELETE", __path, params=__query, headers=__headers, body=__body
817
+ "DELETE",
818
+ __path,
819
+ params=__query,
820
+ headers=__headers,
821
+ body=__body,
822
+ endpoint_id="close_point_in_time",
823
+ path_parts=__path_parts,
801
824
  )
802
825
 
803
826
  @_rewrite_parameters(
@@ -838,7 +861,7 @@ class Elasticsearch(BaseClient):
838
861
  """
839
862
  Returns number of documents matching a query.
840
863
 
841
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-count.html>`_
864
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-count.html>`_
842
865
 
843
866
  :param index: Comma-separated list of data streams, indices, and aliases to search.
844
867
  Supports wildcards (`*`). To search all data streams and indices, omit this
@@ -877,9 +900,12 @@ class Elasticsearch(BaseClient):
877
900
  If a query reaches this limit, Elasticsearch terminates the query early.
878
901
  Elasticsearch collects documents before sorting.
879
902
  """
903
+ __path_parts: t.Dict[str, str]
880
904
  if index not in SKIP_IN_PATH:
881
- __path = f"/{_quote(index)}/_count"
905
+ __path_parts = {"index": _quote(index)}
906
+ __path = f'/{__path_parts["index"]}/_count'
882
907
  else:
908
+ __path_parts = {}
883
909
  __path = "/_count"
884
910
  __query: t.Dict[str, t.Any] = {}
885
911
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -928,7 +954,13 @@ class Elasticsearch(BaseClient):
928
954
  if __body is not None:
929
955
  __headers["content-type"] = "application/json"
930
956
  return self.perform_request( # type: ignore[return-value]
931
- "POST", __path, params=__query, headers=__headers, body=__body
957
+ "POST",
958
+ __path,
959
+ params=__query,
960
+ headers=__headers,
961
+ body=__body,
962
+ endpoint_id="count",
963
+ path_parts=__path_parts,
932
964
  )
933
965
 
934
966
  @_rewrite_parameters(
@@ -963,7 +995,7 @@ class Elasticsearch(BaseClient):
963
995
  Creates a new document in the index. Returns a 409 response when a document with
964
996
  a same ID already exists in the index.
965
997
 
966
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-index_.html>`_
998
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-index_.html>`_
967
999
 
968
1000
  :param index: Name of the data stream or index to target. If the target doesn’t
969
1001
  exist and matches the name or wildcard (`*`) pattern of an index template
@@ -1002,7 +1034,8 @@ class Elasticsearch(BaseClient):
1002
1034
  )
1003
1035
  elif document is not None and body is not None:
1004
1036
  raise ValueError("Cannot set both 'document' and 'body'")
1005
- __path = f"/{_quote(index)}/_create/{_quote(id)}"
1037
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
1038
+ __path = f'/{__path_parts["index"]}/_create/{__path_parts["id"]}'
1006
1039
  __query: t.Dict[str, t.Any] = {}
1007
1040
  if error_trace is not None:
1008
1041
  __query["error_trace"] = error_trace
@@ -1029,7 +1062,13 @@ class Elasticsearch(BaseClient):
1029
1062
  __body = document if document is not None else body
1030
1063
  __headers = {"accept": "application/json", "content-type": "application/json"}
1031
1064
  return self.perform_request( # type: ignore[return-value]
1032
- "PUT", __path, params=__query, headers=__headers, body=__body
1065
+ "PUT",
1066
+ __path,
1067
+ params=__query,
1068
+ headers=__headers,
1069
+ body=__body,
1070
+ endpoint_id="create",
1071
+ path_parts=__path_parts,
1033
1072
  )
1034
1073
 
1035
1074
  @_rewrite_parameters()
@@ -1060,7 +1099,7 @@ class Elasticsearch(BaseClient):
1060
1099
  """
1061
1100
  Removes a document from the index.
1062
1101
 
1063
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-delete.html>`_
1102
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-delete.html>`_
1064
1103
 
1065
1104
  :param index: Name of the target index.
1066
1105
  :param id: Unique identifier for the document.
@@ -1086,7 +1125,8 @@ class Elasticsearch(BaseClient):
1086
1125
  raise ValueError("Empty value passed for parameter 'index'")
1087
1126
  if id in SKIP_IN_PATH:
1088
1127
  raise ValueError("Empty value passed for parameter 'id'")
1089
- __path = f"/{_quote(index)}/_doc/{_quote(id)}"
1128
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
1129
+ __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}'
1090
1130
  __query: t.Dict[str, t.Any] = {}
1091
1131
  if error_trace is not None:
1092
1132
  __query["error_trace"] = error_trace
@@ -1114,7 +1154,12 @@ class Elasticsearch(BaseClient):
1114
1154
  __query["wait_for_active_shards"] = wait_for_active_shards
1115
1155
  __headers = {"accept": "application/json"}
1116
1156
  return self.perform_request( # type: ignore[return-value]
1117
- "DELETE", __path, params=__query, headers=__headers
1157
+ "DELETE",
1158
+ __path,
1159
+ params=__query,
1160
+ headers=__headers,
1161
+ endpoint_id="delete",
1162
+ path_parts=__path_parts,
1118
1163
  )
1119
1164
 
1120
1165
  @_rewrite_parameters(
@@ -1178,7 +1223,7 @@ class Elasticsearch(BaseClient):
1178
1223
  """
1179
1224
  Deletes documents matching the provided query.
1180
1225
 
1181
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-delete-by-query.html>`_
1226
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-delete-by-query.html>`_
1182
1227
 
1183
1228
  :param index: Comma-separated list of data streams, indices, and aliases to search.
1184
1229
  Supports wildcards (`*`). To search all data streams or indices, omit this
@@ -1245,7 +1290,8 @@ class Elasticsearch(BaseClient):
1245
1290
  """
1246
1291
  if index in SKIP_IN_PATH:
1247
1292
  raise ValueError("Empty value passed for parameter 'index'")
1248
- __path = f"/{_quote(index)}/_delete_by_query"
1293
+ __path_parts: t.Dict[str, str] = {"index": _quote(index)}
1294
+ __path = f'/{__path_parts["index"]}/_delete_by_query'
1249
1295
  __query: t.Dict[str, t.Any] = {}
1250
1296
  __body: t.Dict[str, t.Any] = body if body is not None else {}
1251
1297
  # The 'sort' parameter with a colon can't be encoded to the body.
@@ -1332,7 +1378,13 @@ class Elasticsearch(BaseClient):
1332
1378
  __body["slice"] = slice
1333
1379
  __headers = {"accept": "application/json", "content-type": "application/json"}
1334
1380
  return self.perform_request( # type: ignore[return-value]
1335
- "POST", __path, params=__query, headers=__headers, body=__body
1381
+ "POST",
1382
+ __path,
1383
+ params=__query,
1384
+ headers=__headers,
1385
+ body=__body,
1386
+ endpoint_id="delete_by_query",
1387
+ path_parts=__path_parts,
1336
1388
  )
1337
1389
 
1338
1390
  @_rewrite_parameters()
@@ -1349,7 +1401,7 @@ class Elasticsearch(BaseClient):
1349
1401
  """
1350
1402
  Changes the number of requests per second for a particular Delete By Query operation.
1351
1403
 
1352
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-delete-by-query.html>`_
1404
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-delete-by-query.html>`_
1353
1405
 
1354
1406
  :param task_id: The ID for the task.
1355
1407
  :param requests_per_second: The throttle for this request in sub-requests per
@@ -1357,7 +1409,8 @@ class Elasticsearch(BaseClient):
1357
1409
  """
1358
1410
  if task_id in SKIP_IN_PATH:
1359
1411
  raise ValueError("Empty value passed for parameter 'task_id'")
1360
- __path = f"/_delete_by_query/{_quote(task_id)}/_rethrottle"
1412
+ __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
1413
+ __path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle'
1361
1414
  __query: t.Dict[str, t.Any] = {}
1362
1415
  if error_trace is not None:
1363
1416
  __query["error_trace"] = error_trace
@@ -1371,7 +1424,12 @@ class Elasticsearch(BaseClient):
1371
1424
  __query["requests_per_second"] = requests_per_second
1372
1425
  __headers = {"accept": "application/json"}
1373
1426
  return self.perform_request( # type: ignore[return-value]
1374
- "POST", __path, params=__query, headers=__headers
1427
+ "POST",
1428
+ __path,
1429
+ params=__query,
1430
+ headers=__headers,
1431
+ endpoint_id="delete_by_query_rethrottle",
1432
+ path_parts=__path_parts,
1375
1433
  )
1376
1434
 
1377
1435
  @_rewrite_parameters()
@@ -1391,7 +1449,7 @@ class Elasticsearch(BaseClient):
1391
1449
  """
1392
1450
  Deletes a script.
1393
1451
 
1394
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-scripting.html>`_
1452
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-scripting.html>`_
1395
1453
 
1396
1454
  :param id: Identifier for the stored script or search template.
1397
1455
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -1402,7 +1460,8 @@ class Elasticsearch(BaseClient):
1402
1460
  """
1403
1461
  if id in SKIP_IN_PATH:
1404
1462
  raise ValueError("Empty value passed for parameter 'id'")
1405
- __path = f"/_scripts/{_quote(id)}"
1463
+ __path_parts: t.Dict[str, str] = {"id": _quote(id)}
1464
+ __path = f'/_scripts/{__path_parts["id"]}'
1406
1465
  __query: t.Dict[str, t.Any] = {}
1407
1466
  if error_trace is not None:
1408
1467
  __query["error_trace"] = error_trace
@@ -1418,7 +1477,12 @@ class Elasticsearch(BaseClient):
1418
1477
  __query["timeout"] = timeout
1419
1478
  __headers = {"accept": "application/json"}
1420
1479
  return self.perform_request( # type: ignore[return-value]
1421
- "DELETE", __path, params=__query, headers=__headers
1480
+ "DELETE",
1481
+ __path,
1482
+ params=__query,
1483
+ headers=__headers,
1484
+ endpoint_id="delete_script",
1485
+ path_parts=__path_parts,
1422
1486
  )
1423
1487
 
1424
1488
  @_rewrite_parameters(
@@ -1453,7 +1517,7 @@ class Elasticsearch(BaseClient):
1453
1517
  """
1454
1518
  Returns information about whether a document exists in an index.
1455
1519
 
1456
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-get.html>`_
1520
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-get.html>`_
1457
1521
 
1458
1522
  :param index: Comma-separated list of data streams, indices, and aliases. Supports
1459
1523
  wildcards (`*`).
@@ -1482,7 +1546,8 @@ class Elasticsearch(BaseClient):
1482
1546
  raise ValueError("Empty value passed for parameter 'index'")
1483
1547
  if id in SKIP_IN_PATH:
1484
1548
  raise ValueError("Empty value passed for parameter 'id'")
1485
- __path = f"/{_quote(index)}/_doc/{_quote(id)}"
1549
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
1550
+ __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}'
1486
1551
  __query: t.Dict[str, t.Any] = {}
1487
1552
  if error_trace is not None:
1488
1553
  __query["error_trace"] = error_trace
@@ -1514,7 +1579,12 @@ class Elasticsearch(BaseClient):
1514
1579
  __query["version_type"] = version_type
1515
1580
  __headers = {"accept": "application/json"}
1516
1581
  return self.perform_request( # type: ignore[return-value]
1517
- "HEAD", __path, params=__query, headers=__headers
1582
+ "HEAD",
1583
+ __path,
1584
+ params=__query,
1585
+ headers=__headers,
1586
+ endpoint_id="exists",
1587
+ path_parts=__path_parts,
1518
1588
  )
1519
1589
 
1520
1590
  @_rewrite_parameters(
@@ -1548,7 +1618,7 @@ class Elasticsearch(BaseClient):
1548
1618
  """
1549
1619
  Returns information about whether a document source exists in an index.
1550
1620
 
1551
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-get.html>`_
1621
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-get.html>`_
1552
1622
 
1553
1623
  :param index: Comma-separated list of data streams, indices, and aliases. Supports
1554
1624
  wildcards (`*`).
@@ -1574,7 +1644,8 @@ class Elasticsearch(BaseClient):
1574
1644
  raise ValueError("Empty value passed for parameter 'index'")
1575
1645
  if id in SKIP_IN_PATH:
1576
1646
  raise ValueError("Empty value passed for parameter 'id'")
1577
- __path = f"/{_quote(index)}/_source/{_quote(id)}"
1647
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
1648
+ __path = f'/{__path_parts["index"]}/_source/{__path_parts["id"]}'
1578
1649
  __query: t.Dict[str, t.Any] = {}
1579
1650
  if error_trace is not None:
1580
1651
  __query["error_trace"] = error_trace
@@ -1604,7 +1675,12 @@ class Elasticsearch(BaseClient):
1604
1675
  __query["version_type"] = version_type
1605
1676
  __headers = {"accept": "application/json"}
1606
1677
  return self.perform_request( # type: ignore[return-value]
1607
- "HEAD", __path, params=__query, headers=__headers
1678
+ "HEAD",
1679
+ __path,
1680
+ params=__query,
1681
+ headers=__headers,
1682
+ endpoint_id="exists_source",
1683
+ path_parts=__path_parts,
1608
1684
  )
1609
1685
 
1610
1686
  @_rewrite_parameters(
@@ -1642,7 +1718,7 @@ class Elasticsearch(BaseClient):
1642
1718
  """
1643
1719
  Returns information about why a specific matches (or doesn't match) a query.
1644
1720
 
1645
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-explain.html>`_
1721
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-explain.html>`_
1646
1722
 
1647
1723
  :param index: Index names used to limit the request. Only a single index name
1648
1724
  can be provided to this parameter.
@@ -1674,7 +1750,8 @@ class Elasticsearch(BaseClient):
1674
1750
  raise ValueError("Empty value passed for parameter 'index'")
1675
1751
  if id in SKIP_IN_PATH:
1676
1752
  raise ValueError("Empty value passed for parameter 'id'")
1677
- __path = f"/{_quote(index)}/_explain/{_quote(id)}"
1753
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
1754
+ __path = f'/{__path_parts["index"]}/_explain/{__path_parts["id"]}'
1678
1755
  __query: t.Dict[str, t.Any] = {}
1679
1756
  __body: t.Dict[str, t.Any] = body if body is not None else {}
1680
1757
  if analyze_wildcard is not None:
@@ -1718,7 +1795,13 @@ class Elasticsearch(BaseClient):
1718
1795
  if __body is not None:
1719
1796
  __headers["content-type"] = "application/json"
1720
1797
  return self.perform_request( # type: ignore[return-value]
1721
- "POST", __path, params=__query, headers=__headers, body=__body
1798
+ "POST",
1799
+ __path,
1800
+ params=__query,
1801
+ headers=__headers,
1802
+ body=__body,
1803
+ endpoint_id="explain",
1804
+ path_parts=__path_parts,
1722
1805
  )
1723
1806
 
1724
1807
  @_rewrite_parameters(
@@ -1743,6 +1826,7 @@ class Elasticsearch(BaseClient):
1743
1826
  filters: t.Optional[str] = None,
1744
1827
  human: t.Optional[bool] = None,
1745
1828
  ignore_unavailable: t.Optional[bool] = None,
1829
+ include_empty_fields: t.Optional[bool] = None,
1746
1830
  include_unmapped: t.Optional[bool] = None,
1747
1831
  index_filter: t.Optional[t.Mapping[str, t.Any]] = None,
1748
1832
  pretty: t.Optional[bool] = None,
@@ -1753,7 +1837,7 @@ class Elasticsearch(BaseClient):
1753
1837
  """
1754
1838
  Returns the information about the capabilities of fields among multiple indices.
1755
1839
 
1756
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-field-caps.html>`_
1840
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-field-caps.html>`_
1757
1841
 
1758
1842
  :param index: Comma-separated list of data streams, indices, and aliases used
1759
1843
  to limit the request. Supports wildcards (*). To target all data streams
@@ -1772,6 +1856,7 @@ class Elasticsearch(BaseClient):
1772
1856
  :param filters: An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent
1773
1857
  :param ignore_unavailable: If `true`, missing or closed indices are not included
1774
1858
  in the response.
1859
+ :param include_empty_fields: If false, empty fields are not included in the response.
1775
1860
  :param include_unmapped: If true, unmapped fields are included in the response.
1776
1861
  :param index_filter: Allows to filter indices if the provided query rewrites
1777
1862
  to match_none on every shard.
@@ -1782,9 +1867,12 @@ class Elasticsearch(BaseClient):
1782
1867
  :param types: Only return results for fields that have one of the types in the
1783
1868
  list
1784
1869
  """
1870
+ __path_parts: t.Dict[str, str]
1785
1871
  if index not in SKIP_IN_PATH:
1786
- __path = f"/{_quote(index)}/_field_caps"
1872
+ __path_parts = {"index": _quote(index)}
1873
+ __path = f'/{__path_parts["index"]}/_field_caps'
1787
1874
  else:
1875
+ __path_parts = {}
1788
1876
  __path = "/_field_caps"
1789
1877
  __query: t.Dict[str, t.Any] = {}
1790
1878
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -1802,6 +1890,8 @@ class Elasticsearch(BaseClient):
1802
1890
  __query["human"] = human
1803
1891
  if ignore_unavailable is not None:
1804
1892
  __query["ignore_unavailable"] = ignore_unavailable
1893
+ if include_empty_fields is not None:
1894
+ __query["include_empty_fields"] = include_empty_fields
1805
1895
  if include_unmapped is not None:
1806
1896
  __query["include_unmapped"] = include_unmapped
1807
1897
  if pretty is not None:
@@ -1821,7 +1911,13 @@ class Elasticsearch(BaseClient):
1821
1911
  if __body is not None:
1822
1912
  __headers["content-type"] = "application/json"
1823
1913
  return self.perform_request( # type: ignore[return-value]
1824
- "POST", __path, params=__query, headers=__headers, body=__body
1914
+ "POST",
1915
+ __path,
1916
+ params=__query,
1917
+ headers=__headers,
1918
+ body=__body,
1919
+ endpoint_id="field_caps",
1920
+ path_parts=__path_parts,
1825
1921
  )
1826
1922
 
1827
1923
  @_rewrite_parameters(
@@ -1838,6 +1934,7 @@ class Elasticsearch(BaseClient):
1838
1934
  id: str,
1839
1935
  error_trace: t.Optional[bool] = None,
1840
1936
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1937
+ force_synthetic_source: t.Optional[bool] = None,
1841
1938
  human: t.Optional[bool] = None,
1842
1939
  preference: t.Optional[str] = None,
1843
1940
  pretty: t.Optional[bool] = None,
@@ -1856,10 +1953,14 @@ class Elasticsearch(BaseClient):
1856
1953
  """
1857
1954
  Returns a document.
1858
1955
 
1859
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-get.html>`_
1956
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-get.html>`_
1860
1957
 
1861
1958
  :param index: Name of the index that contains the document.
1862
1959
  :param id: Unique identifier of the document.
1960
+ :param force_synthetic_source: Should this request force synthetic _source? Use
1961
+ this to test if the mapping supports synthetic _source and to get a sense
1962
+ of the worst case performance. Fetches with this enabled will be slower the
1963
+ enabling synthetic source natively in the index.
1863
1964
  :param preference: Specifies the node or shard the operation should be performed
1864
1965
  on. Random by default.
1865
1966
  :param realtime: If `true`, the request is real-time as opposed to near-real-time.
@@ -1884,12 +1985,15 @@ class Elasticsearch(BaseClient):
1884
1985
  raise ValueError("Empty value passed for parameter 'index'")
1885
1986
  if id in SKIP_IN_PATH:
1886
1987
  raise ValueError("Empty value passed for parameter 'id'")
1887
- __path = f"/{_quote(index)}/_doc/{_quote(id)}"
1988
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
1989
+ __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}'
1888
1990
  __query: t.Dict[str, t.Any] = {}
1889
1991
  if error_trace is not None:
1890
1992
  __query["error_trace"] = error_trace
1891
1993
  if filter_path is not None:
1892
1994
  __query["filter_path"] = filter_path
1995
+ if force_synthetic_source is not None:
1996
+ __query["force_synthetic_source"] = force_synthetic_source
1893
1997
  if human is not None:
1894
1998
  __query["human"] = human
1895
1999
  if preference is not None:
@@ -1916,7 +2020,12 @@ class Elasticsearch(BaseClient):
1916
2020
  __query["version_type"] = version_type
1917
2021
  __headers = {"accept": "application/json"}
1918
2022
  return self.perform_request( # type: ignore[return-value]
1919
- "GET", __path, params=__query, headers=__headers
2023
+ "GET",
2024
+ __path,
2025
+ params=__query,
2026
+ headers=__headers,
2027
+ endpoint_id="get",
2028
+ path_parts=__path_parts,
1920
2029
  )
1921
2030
 
1922
2031
  @_rewrite_parameters()
@@ -1935,14 +2044,15 @@ class Elasticsearch(BaseClient):
1935
2044
  """
1936
2045
  Returns a script.
1937
2046
 
1938
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-scripting.html>`_
2047
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-scripting.html>`_
1939
2048
 
1940
2049
  :param id: Identifier for the stored script or search template.
1941
2050
  :param master_timeout: Specify timeout for connection to master
1942
2051
  """
1943
2052
  if id in SKIP_IN_PATH:
1944
2053
  raise ValueError("Empty value passed for parameter 'id'")
1945
- __path = f"/_scripts/{_quote(id)}"
2054
+ __path_parts: t.Dict[str, str] = {"id": _quote(id)}
2055
+ __path = f'/_scripts/{__path_parts["id"]}'
1946
2056
  __query: t.Dict[str, t.Any] = {}
1947
2057
  if error_trace is not None:
1948
2058
  __query["error_trace"] = error_trace
@@ -1956,7 +2066,12 @@ class Elasticsearch(BaseClient):
1956
2066
  __query["pretty"] = pretty
1957
2067
  __headers = {"accept": "application/json"}
1958
2068
  return self.perform_request( # type: ignore[return-value]
1959
- "GET", __path, params=__query, headers=__headers
2069
+ "GET",
2070
+ __path,
2071
+ params=__query,
2072
+ headers=__headers,
2073
+ endpoint_id="get_script",
2074
+ path_parts=__path_parts,
1960
2075
  )
1961
2076
 
1962
2077
  @_rewrite_parameters()
@@ -1971,8 +2086,9 @@ class Elasticsearch(BaseClient):
1971
2086
  """
1972
2087
  Returns all script contexts.
1973
2088
 
1974
- `<https://www.elastic.co/guide/en/elasticsearch/painless/8.12/painless-contexts.html>`_
2089
+ `<https://www.elastic.co/guide/en/elasticsearch/painless/8.13/painless-contexts.html>`_
1975
2090
  """
2091
+ __path_parts: t.Dict[str, str] = {}
1976
2092
  __path = "/_script_context"
1977
2093
  __query: t.Dict[str, t.Any] = {}
1978
2094
  if error_trace is not None:
@@ -1985,7 +2101,12 @@ class Elasticsearch(BaseClient):
1985
2101
  __query["pretty"] = pretty
1986
2102
  __headers = {"accept": "application/json"}
1987
2103
  return self.perform_request( # type: ignore[return-value]
1988
- "GET", __path, params=__query, headers=__headers
2104
+ "GET",
2105
+ __path,
2106
+ params=__query,
2107
+ headers=__headers,
2108
+ endpoint_id="get_script_context",
2109
+ path_parts=__path_parts,
1989
2110
  )
1990
2111
 
1991
2112
  @_rewrite_parameters()
@@ -2000,8 +2121,9 @@ class Elasticsearch(BaseClient):
2000
2121
  """
2001
2122
  Returns available script types, languages and contexts
2002
2123
 
2003
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-scripting.html>`_
2124
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-scripting.html>`_
2004
2125
  """
2126
+ __path_parts: t.Dict[str, str] = {}
2005
2127
  __path = "/_script_language"
2006
2128
  __query: t.Dict[str, t.Any] = {}
2007
2129
  if error_trace is not None:
@@ -2014,7 +2136,12 @@ class Elasticsearch(BaseClient):
2014
2136
  __query["pretty"] = pretty
2015
2137
  __headers = {"accept": "application/json"}
2016
2138
  return self.perform_request( # type: ignore[return-value]
2017
- "GET", __path, params=__query, headers=__headers
2139
+ "GET",
2140
+ __path,
2141
+ params=__query,
2142
+ headers=__headers,
2143
+ endpoint_id="get_script_languages",
2144
+ path_parts=__path_parts,
2018
2145
  )
2019
2146
 
2020
2147
  @_rewrite_parameters(
@@ -2049,7 +2176,7 @@ class Elasticsearch(BaseClient):
2049
2176
  """
2050
2177
  Returns the source of a document.
2051
2178
 
2052
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-get.html>`_
2179
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-get.html>`_
2053
2180
 
2054
2181
  :param index: Name of the index that contains the document.
2055
2182
  :param id: Unique identifier of the document.
@@ -2075,7 +2202,8 @@ class Elasticsearch(BaseClient):
2075
2202
  raise ValueError("Empty value passed for parameter 'index'")
2076
2203
  if id in SKIP_IN_PATH:
2077
2204
  raise ValueError("Empty value passed for parameter 'id'")
2078
- __path = f"/{_quote(index)}/_source/{_quote(id)}"
2205
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
2206
+ __path = f'/{__path_parts["index"]}/_source/{__path_parts["id"]}'
2079
2207
  __query: t.Dict[str, t.Any] = {}
2080
2208
  if error_trace is not None:
2081
2209
  __query["error_trace"] = error_trace
@@ -2107,7 +2235,12 @@ class Elasticsearch(BaseClient):
2107
2235
  __query["version_type"] = version_type
2108
2236
  __headers = {"accept": "application/json"}
2109
2237
  return self.perform_request( # type: ignore[return-value]
2110
- "GET", __path, params=__query, headers=__headers
2238
+ "GET",
2239
+ __path,
2240
+ params=__query,
2241
+ headers=__headers,
2242
+ endpoint_id="get_source",
2243
+ path_parts=__path_parts,
2111
2244
  )
2112
2245
 
2113
2246
  @_rewrite_parameters()
@@ -2126,7 +2259,7 @@ class Elasticsearch(BaseClient):
2126
2259
  """
2127
2260
  Returns the health of the cluster.
2128
2261
 
2129
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/health-api.html>`_
2262
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/health-api.html>`_
2130
2263
 
2131
2264
  :param feature: A feature of the cluster, as returned by the top-level health
2132
2265
  report API.
@@ -2134,9 +2267,12 @@ class Elasticsearch(BaseClient):
2134
2267
  :param timeout: Explicit operation timeout.
2135
2268
  :param verbose: Opt-in for more information about the health of the system.
2136
2269
  """
2270
+ __path_parts: t.Dict[str, str]
2137
2271
  if feature not in SKIP_IN_PATH:
2138
- __path = f"/_health_report/{_quote(feature)}"
2272
+ __path_parts = {"feature": _quote(feature)}
2273
+ __path = f'/_health_report/{__path_parts["feature"]}'
2139
2274
  else:
2275
+ __path_parts = {}
2140
2276
  __path = "/_health_report"
2141
2277
  __query: t.Dict[str, t.Any] = {}
2142
2278
  if error_trace is not None:
@@ -2155,7 +2291,12 @@ class Elasticsearch(BaseClient):
2155
2291
  __query["verbose"] = verbose
2156
2292
  __headers = {"accept": "application/json"}
2157
2293
  return self.perform_request( # type: ignore[return-value]
2158
- "GET", __path, params=__query, headers=__headers
2294
+ "GET",
2295
+ __path,
2296
+ params=__query,
2297
+ headers=__headers,
2298
+ endpoint_id="health_report",
2299
+ path_parts=__path_parts,
2159
2300
  )
2160
2301
 
2161
2302
  @_rewrite_parameters(
@@ -2193,7 +2334,7 @@ class Elasticsearch(BaseClient):
2193
2334
  """
2194
2335
  Creates or updates a document in an index.
2195
2336
 
2196
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-index_.html>`_
2337
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-index_.html>`_
2197
2338
 
2198
2339
  :param index: Name of the data stream or index to target.
2199
2340
  :param document:
@@ -2236,11 +2377,14 @@ class Elasticsearch(BaseClient):
2236
2377
  )
2237
2378
  elif document is not None and body is not None:
2238
2379
  raise ValueError("Cannot set both 'document' and 'body'")
2380
+ __path_parts: t.Dict[str, str]
2239
2381
  if index not in SKIP_IN_PATH and id not in SKIP_IN_PATH:
2240
- __path = f"/{_quote(index)}/_doc/{_quote(id)}"
2382
+ __path_parts = {"index": _quote(index), "id": _quote(id)}
2383
+ __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}'
2241
2384
  __method = "PUT"
2242
2385
  elif index not in SKIP_IN_PATH:
2243
- __path = f"/{_quote(index)}/_doc"
2386
+ __path_parts = {"index": _quote(index)}
2387
+ __path = f'/{__path_parts["index"]}/_doc'
2244
2388
  __method = "POST"
2245
2389
  else:
2246
2390
  raise ValueError("Couldn't find a path for the given parameters")
@@ -2278,7 +2422,13 @@ class Elasticsearch(BaseClient):
2278
2422
  __body = document if document is not None else body
2279
2423
  __headers = {"accept": "application/json", "content-type": "application/json"}
2280
2424
  return self.perform_request( # type: ignore[return-value]
2281
- __method, __path, params=__query, headers=__headers, body=__body
2425
+ __method,
2426
+ __path,
2427
+ params=__query,
2428
+ headers=__headers,
2429
+ body=__body,
2430
+ endpoint_id="index",
2431
+ path_parts=__path_parts,
2282
2432
  )
2283
2433
 
2284
2434
  @_rewrite_parameters()
@@ -2293,8 +2443,9 @@ class Elasticsearch(BaseClient):
2293
2443
  """
2294
2444
  Returns basic information about the cluster.
2295
2445
 
2296
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/index.html>`_
2446
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/index.html>`_
2297
2447
  """
2448
+ __path_parts: t.Dict[str, str] = {}
2298
2449
  __path = "/"
2299
2450
  __query: t.Dict[str, t.Any] = {}
2300
2451
  if error_trace is not None:
@@ -2307,7 +2458,12 @@ class Elasticsearch(BaseClient):
2307
2458
  __query["pretty"] = pretty
2308
2459
  __headers = {"accept": "application/json"}
2309
2460
  return self.perform_request( # type: ignore[return-value]
2310
- "GET", __path, params=__query, headers=__headers
2461
+ "GET",
2462
+ __path,
2463
+ params=__query,
2464
+ headers=__headers,
2465
+ endpoint_id="info",
2466
+ path_parts=__path_parts,
2311
2467
  )
2312
2468
 
2313
2469
  @_rewrite_parameters(
@@ -2343,7 +2499,7 @@ class Elasticsearch(BaseClient):
2343
2499
  """
2344
2500
  Performs a kNN search.
2345
2501
 
2346
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-search.html>`_
2502
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-search.html>`_
2347
2503
 
2348
2504
  :param index: A comma-separated list of index names to search; use `_all` or
2349
2505
  to perform the operation on all indices
@@ -2370,7 +2526,8 @@ class Elasticsearch(BaseClient):
2370
2526
  raise ValueError("Empty value passed for parameter 'index'")
2371
2527
  if knn is None and body is None:
2372
2528
  raise ValueError("Empty value passed for parameter 'knn'")
2373
- __path = f"/{_quote(index)}/_knn_search"
2529
+ __path_parts: t.Dict[str, str] = {"index": _quote(index)}
2530
+ __path = f'/{__path_parts["index"]}/_knn_search'
2374
2531
  __query: t.Dict[str, t.Any] = {}
2375
2532
  __body: t.Dict[str, t.Any] = body if body is not None else {}
2376
2533
  if error_trace is not None:
@@ -2402,7 +2559,13 @@ class Elasticsearch(BaseClient):
2402
2559
  if __body is not None:
2403
2560
  __headers["content-type"] = "application/json"
2404
2561
  return self.perform_request( # type: ignore[return-value]
2405
- "POST", __path, params=__query, headers=__headers, body=__body
2562
+ "POST",
2563
+ __path,
2564
+ params=__query,
2565
+ headers=__headers,
2566
+ body=__body,
2567
+ endpoint_id="knn_search",
2568
+ path_parts=__path_parts,
2406
2569
  )
2407
2570
 
2408
2571
  @_rewrite_parameters(
@@ -2420,6 +2583,7 @@ class Elasticsearch(BaseClient):
2420
2583
  docs: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
2421
2584
  error_trace: t.Optional[bool] = None,
2422
2585
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2586
+ force_synthetic_source: t.Optional[bool] = None,
2423
2587
  human: t.Optional[bool] = None,
2424
2588
  ids: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2425
2589
  preference: t.Optional[str] = None,
@@ -2436,12 +2600,16 @@ class Elasticsearch(BaseClient):
2436
2600
  """
2437
2601
  Allows to get multiple documents in one request.
2438
2602
 
2439
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-multi-get.html>`_
2603
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-multi-get.html>`_
2440
2604
 
2441
2605
  :param index: Name of the index to retrieve documents from when `ids` are specified,
2442
2606
  or when a document in the `docs` array does not specify an index.
2443
2607
  :param docs: The documents you want to retrieve. Required if no index is specified
2444
2608
  in the request URI.
2609
+ :param force_synthetic_source: Should this request force synthetic _source? Use
2610
+ this to test if the mapping supports synthetic _source and to get a sense
2611
+ of the worst case performance. Fetches with this enabled will be slower the
2612
+ enabling synthetic source natively in the index.
2445
2613
  :param ids: The IDs of the documents you want to retrieve. Allowed when the index
2446
2614
  is specified in the request URI.
2447
2615
  :param preference: Specifies the node or shard the operation should be performed
@@ -2463,9 +2631,12 @@ class Elasticsearch(BaseClient):
2463
2631
  :param stored_fields: If `true`, retrieves the document fields stored in the
2464
2632
  index rather than the document `_source`.
2465
2633
  """
2634
+ __path_parts: t.Dict[str, str]
2466
2635
  if index not in SKIP_IN_PATH:
2467
- __path = f"/{_quote(index)}/_mget"
2636
+ __path_parts = {"index": _quote(index)}
2637
+ __path = f'/{__path_parts["index"]}/_mget'
2468
2638
  else:
2639
+ __path_parts = {}
2469
2640
  __path = "/_mget"
2470
2641
  __query: t.Dict[str, t.Any] = {}
2471
2642
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -2473,6 +2644,8 @@ class Elasticsearch(BaseClient):
2473
2644
  __query["error_trace"] = error_trace
2474
2645
  if filter_path is not None:
2475
2646
  __query["filter_path"] = filter_path
2647
+ if force_synthetic_source is not None:
2648
+ __query["force_synthetic_source"] = force_synthetic_source
2476
2649
  if human is not None:
2477
2650
  __query["human"] = human
2478
2651
  if preference is not None:
@@ -2500,7 +2673,13 @@ class Elasticsearch(BaseClient):
2500
2673
  __body["ids"] = ids
2501
2674
  __headers = {"accept": "application/json", "content-type": "application/json"}
2502
2675
  return self.perform_request( # type: ignore[return-value]
2503
- "POST", __path, params=__query, headers=__headers, body=__body
2676
+ "POST",
2677
+ __path,
2678
+ params=__query,
2679
+ headers=__headers,
2680
+ body=__body,
2681
+ endpoint_id="mget",
2682
+ path_parts=__path_parts,
2504
2683
  )
2505
2684
 
2506
2685
  @_rewrite_parameters(
@@ -2541,7 +2720,7 @@ class Elasticsearch(BaseClient):
2541
2720
  """
2542
2721
  Allows to execute several search operations in one request.
2543
2722
 
2544
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-multi-search.html>`_
2723
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-multi-search.html>`_
2545
2724
 
2546
2725
  :param searches:
2547
2726
  :param index: Comma-separated list of data streams, indices, and index aliases
@@ -2585,9 +2764,12 @@ class Elasticsearch(BaseClient):
2585
2764
  )
2586
2765
  elif searches is not None and body is not None:
2587
2766
  raise ValueError("Cannot set both 'searches' and 'body'")
2767
+ __path_parts: t.Dict[str, str]
2588
2768
  if index not in SKIP_IN_PATH:
2589
- __path = f"/{_quote(index)}/_msearch"
2769
+ __path_parts = {"index": _quote(index)}
2770
+ __path = f'/{__path_parts["index"]}/_msearch'
2590
2771
  else:
2772
+ __path_parts = {}
2591
2773
  __path = "/_msearch"
2592
2774
  __query: t.Dict[str, t.Any] = {}
2593
2775
  if allow_no_indices is not None:
@@ -2628,7 +2810,13 @@ class Elasticsearch(BaseClient):
2628
2810
  "content-type": "application/x-ndjson",
2629
2811
  }
2630
2812
  return self.perform_request( # type: ignore[return-value]
2631
- "POST", __path, params=__query, headers=__headers, body=__body
2813
+ "POST",
2814
+ __path,
2815
+ params=__query,
2816
+ headers=__headers,
2817
+ body=__body,
2818
+ endpoint_id="msearch",
2819
+ path_parts=__path_parts,
2632
2820
  )
2633
2821
 
2634
2822
  @_rewrite_parameters(
@@ -2655,7 +2843,7 @@ class Elasticsearch(BaseClient):
2655
2843
  """
2656
2844
  Allows to execute several search template operations in one request.
2657
2845
 
2658
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-multi-search.html>`_
2846
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-multi-search.html>`_
2659
2847
 
2660
2848
  :param search_templates:
2661
2849
  :param index: Comma-separated list of data streams, indices, and aliases to search.
@@ -2678,9 +2866,12 @@ class Elasticsearch(BaseClient):
2678
2866
  )
2679
2867
  elif search_templates is not None and body is not None:
2680
2868
  raise ValueError("Cannot set both 'search_templates' and 'body'")
2869
+ __path_parts: t.Dict[str, str]
2681
2870
  if index not in SKIP_IN_PATH:
2682
- __path = f"/{_quote(index)}/_msearch/template"
2871
+ __path_parts = {"index": _quote(index)}
2872
+ __path = f'/{__path_parts["index"]}/_msearch/template'
2683
2873
  else:
2874
+ __path_parts = {}
2684
2875
  __path = "/_msearch/template"
2685
2876
  __query: t.Dict[str, t.Any] = {}
2686
2877
  if ccs_minimize_roundtrips is not None:
@@ -2707,7 +2898,13 @@ class Elasticsearch(BaseClient):
2707
2898
  "content-type": "application/x-ndjson",
2708
2899
  }
2709
2900
  return self.perform_request( # type: ignore[return-value]
2710
- "POST", __path, params=__query, headers=__headers, body=__body
2901
+ "POST",
2902
+ __path,
2903
+ params=__query,
2904
+ headers=__headers,
2905
+ body=__body,
2906
+ endpoint_id="msearch_template",
2907
+ path_parts=__path_parts,
2711
2908
  )
2712
2909
 
2713
2910
  @_rewrite_parameters(
@@ -2741,7 +2938,7 @@ class Elasticsearch(BaseClient):
2741
2938
  """
2742
2939
  Returns multiple termvectors in one request.
2743
2940
 
2744
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-multi-termvectors.html>`_
2941
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-multi-termvectors.html>`_
2745
2942
 
2746
2943
  :param index: Name of the index that contains the documents.
2747
2944
  :param docs: Array of existing or artificial documents.
@@ -2764,9 +2961,12 @@ class Elasticsearch(BaseClient):
2764
2961
  :param version: If `true`, returns the document version as part of a hit.
2765
2962
  :param version_type: Specific version type.
2766
2963
  """
2964
+ __path_parts: t.Dict[str, str]
2767
2965
  if index not in SKIP_IN_PATH:
2768
- __path = f"/{_quote(index)}/_mtermvectors"
2966
+ __path_parts = {"index": _quote(index)}
2967
+ __path = f'/{__path_parts["index"]}/_mtermvectors'
2769
2968
  else:
2969
+ __path_parts = {}
2770
2970
  __path = "/_mtermvectors"
2771
2971
  __query: t.Dict[str, t.Any] = {}
2772
2972
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -2811,7 +3011,13 @@ class Elasticsearch(BaseClient):
2811
3011
  if __body is not None:
2812
3012
  __headers["content-type"] = "application/json"
2813
3013
  return self.perform_request( # type: ignore[return-value]
2814
- "POST", __path, params=__query, headers=__headers, body=__body
3014
+ "POST",
3015
+ __path,
3016
+ params=__query,
3017
+ headers=__headers,
3018
+ body=__body,
3019
+ endpoint_id="mtermvectors",
3020
+ path_parts=__path_parts,
2815
3021
  )
2816
3022
 
2817
3023
  @_rewrite_parameters()
@@ -2839,7 +3045,7 @@ class Elasticsearch(BaseClient):
2839
3045
  """
2840
3046
  Open a point in time that can be used in subsequent searches
2841
3047
 
2842
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/point-in-time-api.html>`_
3048
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/point-in-time-api.html>`_
2843
3049
 
2844
3050
  :param index: A comma-separated list of index names to open point in time; use
2845
3051
  `_all` or empty string to perform the operation on all indices
@@ -2858,7 +3064,8 @@ class Elasticsearch(BaseClient):
2858
3064
  raise ValueError("Empty value passed for parameter 'index'")
2859
3065
  if keep_alive is None:
2860
3066
  raise ValueError("Empty value passed for parameter 'keep_alive'")
2861
- __path = f"/{_quote(index)}/_pit"
3067
+ __path_parts: t.Dict[str, str] = {"index": _quote(index)}
3068
+ __path = f'/{__path_parts["index"]}/_pit'
2862
3069
  __query: t.Dict[str, t.Any] = {}
2863
3070
  if keep_alive is not None:
2864
3071
  __query["keep_alive"] = keep_alive
@@ -2880,7 +3087,12 @@ class Elasticsearch(BaseClient):
2880
3087
  __query["routing"] = routing
2881
3088
  __headers = {"accept": "application/json"}
2882
3089
  return self.perform_request( # type: ignore[return-value]
2883
- "POST", __path, params=__query, headers=__headers
3090
+ "POST",
3091
+ __path,
3092
+ params=__query,
3093
+ headers=__headers,
3094
+ endpoint_id="open_point_in_time",
3095
+ path_parts=__path_parts,
2884
3096
  )
2885
3097
 
2886
3098
  @_rewrite_parameters(
@@ -2905,7 +3117,7 @@ class Elasticsearch(BaseClient):
2905
3117
  """
2906
3118
  Creates or updates a script.
2907
3119
 
2908
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-scripting.html>`_
3120
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-scripting.html>`_
2909
3121
 
2910
3122
  :param id: Identifier for the stored script or search template. Must be unique
2911
3123
  within the cluster.
@@ -2924,10 +3136,13 @@ class Elasticsearch(BaseClient):
2924
3136
  raise ValueError("Empty value passed for parameter 'id'")
2925
3137
  if script is None and body is None:
2926
3138
  raise ValueError("Empty value passed for parameter 'script'")
3139
+ __path_parts: t.Dict[str, str]
2927
3140
  if id not in SKIP_IN_PATH and context not in SKIP_IN_PATH:
2928
- __path = f"/_scripts/{_quote(id)}/{_quote(context)}"
3141
+ __path_parts = {"id": _quote(id), "context": _quote(context)}
3142
+ __path = f'/_scripts/{__path_parts["id"]}/{__path_parts["context"]}'
2929
3143
  elif id not in SKIP_IN_PATH:
2930
- __path = f"/_scripts/{_quote(id)}"
3144
+ __path_parts = {"id": _quote(id)}
3145
+ __path = f'/_scripts/{__path_parts["id"]}'
2931
3146
  else:
2932
3147
  raise ValueError("Couldn't find a path for the given parameters")
2933
3148
  __query: t.Dict[str, t.Any] = {}
@@ -2949,7 +3164,13 @@ class Elasticsearch(BaseClient):
2949
3164
  __body["script"] = script
2950
3165
  __headers = {"accept": "application/json", "content-type": "application/json"}
2951
3166
  return self.perform_request( # type: ignore[return-value]
2952
- "PUT", __path, params=__query, headers=__headers, body=__body
3167
+ "PUT",
3168
+ __path,
3169
+ params=__query,
3170
+ headers=__headers,
3171
+ body=__body,
3172
+ endpoint_id="put_script",
3173
+ path_parts=__path_parts,
2953
3174
  )
2954
3175
 
2955
3176
  @_rewrite_parameters(
@@ -2982,7 +3203,7 @@ class Elasticsearch(BaseClient):
2982
3203
  Allows to evaluate the quality of ranked search results over a set of typical
2983
3204
  search queries
2984
3205
 
2985
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-rank-eval.html>`_
3206
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-rank-eval.html>`_
2986
3207
 
2987
3208
  :param requests: A set of typical search requests, together with their provided
2988
3209
  ratings.
@@ -3004,9 +3225,12 @@ class Elasticsearch(BaseClient):
3004
3225
  """
3005
3226
  if requests is None and body is None:
3006
3227
  raise ValueError("Empty value passed for parameter 'requests'")
3228
+ __path_parts: t.Dict[str, str]
3007
3229
  if index not in SKIP_IN_PATH:
3008
- __path = f"/{_quote(index)}/_rank_eval"
3230
+ __path_parts = {"index": _quote(index)}
3231
+ __path = f'/{__path_parts["index"]}/_rank_eval'
3009
3232
  else:
3233
+ __path_parts = {}
3010
3234
  __path = "/_rank_eval"
3011
3235
  __query: t.Dict[str, t.Any] = {}
3012
3236
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3033,7 +3257,13 @@ class Elasticsearch(BaseClient):
3033
3257
  __body["metric"] = metric
3034
3258
  __headers = {"accept": "application/json", "content-type": "application/json"}
3035
3259
  return self.perform_request( # type: ignore[return-value]
3036
- "POST", __path, params=__query, headers=__headers, body=__body
3260
+ "POST",
3261
+ __path,
3262
+ params=__query,
3263
+ headers=__headers,
3264
+ body=__body,
3265
+ endpoint_id="rank_eval",
3266
+ path_parts=__path_parts,
3037
3267
  )
3038
3268
 
3039
3269
  @_rewrite_parameters(
@@ -3069,7 +3299,7 @@ class Elasticsearch(BaseClient):
3069
3299
  source documents by a query, changing the destination index settings, or fetching
3070
3300
  the documents from a remote cluster.
3071
3301
 
3072
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-reindex.html>`_
3302
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-reindex.html>`_
3073
3303
 
3074
3304
  :param dest: The destination you are copying to.
3075
3305
  :param source: The source you are copying from.
@@ -3099,6 +3329,7 @@ class Elasticsearch(BaseClient):
3099
3329
  raise ValueError("Empty value passed for parameter 'dest'")
3100
3330
  if source is None and body is None:
3101
3331
  raise ValueError("Empty value passed for parameter 'source'")
3332
+ __path_parts: t.Dict[str, str] = {}
3102
3333
  __path = "/_reindex"
3103
3334
  __query: t.Dict[str, t.Any] = {}
3104
3335
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3141,7 +3372,13 @@ class Elasticsearch(BaseClient):
3141
3372
  __body["size"] = size
3142
3373
  __headers = {"accept": "application/json", "content-type": "application/json"}
3143
3374
  return self.perform_request( # type: ignore[return-value]
3144
- "POST", __path, params=__query, headers=__headers, body=__body
3375
+ "POST",
3376
+ __path,
3377
+ params=__query,
3378
+ headers=__headers,
3379
+ body=__body,
3380
+ endpoint_id="reindex",
3381
+ path_parts=__path_parts,
3145
3382
  )
3146
3383
 
3147
3384
  @_rewrite_parameters()
@@ -3158,7 +3395,7 @@ class Elasticsearch(BaseClient):
3158
3395
  """
3159
3396
  Changes the number of requests per second for a particular Reindex operation.
3160
3397
 
3161
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-reindex.html>`_
3398
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-reindex.html>`_
3162
3399
 
3163
3400
  :param task_id: Identifier for the task.
3164
3401
  :param requests_per_second: The throttle for this request in sub-requests per
@@ -3166,7 +3403,8 @@ class Elasticsearch(BaseClient):
3166
3403
  """
3167
3404
  if task_id in SKIP_IN_PATH:
3168
3405
  raise ValueError("Empty value passed for parameter 'task_id'")
3169
- __path = f"/_reindex/{_quote(task_id)}/_rethrottle"
3406
+ __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
3407
+ __path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle'
3170
3408
  __query: t.Dict[str, t.Any] = {}
3171
3409
  if error_trace is not None:
3172
3410
  __query["error_trace"] = error_trace
@@ -3180,7 +3418,12 @@ class Elasticsearch(BaseClient):
3180
3418
  __query["requests_per_second"] = requests_per_second
3181
3419
  __headers = {"accept": "application/json"}
3182
3420
  return self.perform_request( # type: ignore[return-value]
3183
- "POST", __path, params=__query, headers=__headers
3421
+ "POST",
3422
+ __path,
3423
+ params=__query,
3424
+ headers=__headers,
3425
+ endpoint_id="reindex_rethrottle",
3426
+ path_parts=__path_parts,
3184
3427
  )
3185
3428
 
3186
3429
  @_rewrite_parameters(
@@ -3203,7 +3446,7 @@ class Elasticsearch(BaseClient):
3203
3446
  """
3204
3447
  Allows to use the Mustache language to pre-render a search definition.
3205
3448
 
3206
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/render-search-template-api.html>`_
3449
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/render-search-template-api.html>`_
3207
3450
 
3208
3451
  :param id: ID of the search template to render. If no `source` is specified,
3209
3452
  this or the `id` request body parameter is required.
@@ -3214,9 +3457,12 @@ class Elasticsearch(BaseClient):
3214
3457
  search API's request body. These parameters also support Mustache variables.
3215
3458
  If no `id` or `<templated-id>` is specified, this parameter is required.
3216
3459
  """
3460
+ __path_parts: t.Dict[str, str]
3217
3461
  if id not in SKIP_IN_PATH:
3218
- __path = f"/_render/template/{_quote(id)}"
3462
+ __path_parts = {"id": _quote(id)}
3463
+ __path = f'/_render/template/{__path_parts["id"]}'
3219
3464
  else:
3465
+ __path_parts = {}
3220
3466
  __path = "/_render/template"
3221
3467
  __query: t.Dict[str, t.Any] = {}
3222
3468
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3241,7 +3487,13 @@ class Elasticsearch(BaseClient):
3241
3487
  if __body is not None:
3242
3488
  __headers["content-type"] = "application/json"
3243
3489
  return self.perform_request( # type: ignore[return-value]
3244
- "POST", __path, params=__query, headers=__headers, body=__body
3490
+ "POST",
3491
+ __path,
3492
+ params=__query,
3493
+ headers=__headers,
3494
+ body=__body,
3495
+ endpoint_id="render_search_template",
3496
+ path_parts=__path_parts,
3245
3497
  )
3246
3498
 
3247
3499
  @_rewrite_parameters(
@@ -3262,12 +3514,13 @@ class Elasticsearch(BaseClient):
3262
3514
  """
3263
3515
  Allows an arbitrary script to be executed and a result to be returned
3264
3516
 
3265
- `<https://www.elastic.co/guide/en/elasticsearch/painless/8.12/painless-execute-api.html>`_
3517
+ `<https://www.elastic.co/guide/en/elasticsearch/painless/8.13/painless-execute-api.html>`_
3266
3518
 
3267
3519
  :param context: The context that the script should run in.
3268
3520
  :param context_setup: Additional parameters for the `context`.
3269
3521
  :param script: The Painless script to execute.
3270
3522
  """
3523
+ __path_parts: t.Dict[str, str] = {}
3271
3524
  __path = "/_scripts/painless/_execute"
3272
3525
  __query: t.Dict[str, t.Any] = {}
3273
3526
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3292,7 +3545,13 @@ class Elasticsearch(BaseClient):
3292
3545
  if __body is not None:
3293
3546
  __headers["content-type"] = "application/json"
3294
3547
  return self.perform_request( # type: ignore[return-value]
3295
- "POST", __path, params=__query, headers=__headers, body=__body
3548
+ "POST",
3549
+ __path,
3550
+ params=__query,
3551
+ headers=__headers,
3552
+ body=__body,
3553
+ endpoint_id="scripts_painless_execute",
3554
+ path_parts=__path_parts,
3296
3555
  )
3297
3556
 
3298
3557
  @_rewrite_parameters(
@@ -3313,7 +3572,7 @@ class Elasticsearch(BaseClient):
3313
3572
  """
3314
3573
  Allows to retrieve a large numbers of results from a single search request.
3315
3574
 
3316
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-request-body.html#request-body-search-scroll>`_
3575
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-request-body.html#request-body-search-scroll>`_
3317
3576
 
3318
3577
  :param scroll_id: Scroll ID of the search.
3319
3578
  :param rest_total_hits_as_int: If true, the API response’s hit.total property
@@ -3323,6 +3582,7 @@ class Elasticsearch(BaseClient):
3323
3582
  """
3324
3583
  if scroll_id is None and body is None:
3325
3584
  raise ValueError("Empty value passed for parameter 'scroll_id'")
3585
+ __path_parts: t.Dict[str, str] = {}
3326
3586
  __path = "/_search/scroll"
3327
3587
  __query: t.Dict[str, t.Any] = {}
3328
3588
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3347,7 +3607,13 @@ class Elasticsearch(BaseClient):
3347
3607
  if __body is not None:
3348
3608
  __headers["content-type"] = "application/json"
3349
3609
  return self.perform_request( # type: ignore[return-value]
3350
- "POST", __path, params=__query, headers=__headers, body=__body
3610
+ "POST",
3611
+ __path,
3612
+ params=__query,
3613
+ headers=__headers,
3614
+ body=__body,
3615
+ endpoint_id="scroll",
3616
+ path_parts=__path_parts,
3351
3617
  )
3352
3618
 
3353
3619
  @_rewrite_parameters(
@@ -3423,6 +3689,7 @@ class Elasticsearch(BaseClient):
3423
3689
  ext: t.Optional[t.Mapping[str, t.Any]] = None,
3424
3690
  fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
3425
3691
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3692
+ force_synthetic_source: t.Optional[bool] = None,
3426
3693
  from_: t.Optional[int] = None,
3427
3694
  highlight: t.Optional[t.Mapping[str, t.Any]] = None,
3428
3695
  human: t.Optional[bool] = None,
@@ -3492,7 +3759,7 @@ class Elasticsearch(BaseClient):
3492
3759
  """
3493
3760
  Returns results matching a query.
3494
3761
 
3495
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-search.html>`_
3762
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-search.html>`_
3496
3763
 
3497
3764
  :param index: Comma-separated list of data streams, indices, and aliases to search.
3498
3765
  Supports wildcards (`*`). To search all data streams and indices, omit this
@@ -3539,6 +3806,10 @@ class Elasticsearch(BaseClient):
3539
3806
  :param fields: Array of wildcard (`*`) patterns. The request returns values for
3540
3807
  field names matching these patterns in the `hits.fields` property of the
3541
3808
  response.
3809
+ :param force_synthetic_source: Should this request force synthetic _source? Use
3810
+ this to test if the mapping supports synthetic _source and to get a sense
3811
+ of the worst case performance. Fetches with this enabled will be slower the
3812
+ enabling synthetic source natively in the index.
3542
3813
  :param from_: Starting document offset. Needs to be non-negative. By default,
3543
3814
  you cannot page through more than 10,000 hits using the `from` and `size`
3544
3815
  parameters. To page through more hits, use the `search_after` parameter.
@@ -3676,9 +3947,12 @@ class Elasticsearch(BaseClient):
3676
3947
  by their respective types in the response.
3677
3948
  :param version: If true, returns document version as part of a hit.
3678
3949
  """
3950
+ __path_parts: t.Dict[str, str]
3679
3951
  if index not in SKIP_IN_PATH:
3680
- __path = f"/{_quote(index)}/_search"
3952
+ __path_parts = {"index": _quote(index)}
3953
+ __path = f'/{__path_parts["index"]}/_search'
3681
3954
  else:
3955
+ __path_parts = {}
3682
3956
  __path = "/_search"
3683
3957
  __query: t.Dict[str, t.Any] = {}
3684
3958
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3715,6 +3989,8 @@ class Elasticsearch(BaseClient):
3715
3989
  __query["expand_wildcards"] = expand_wildcards
3716
3990
  if filter_path is not None:
3717
3991
  __query["filter_path"] = filter_path
3992
+ if force_synthetic_source is not None:
3993
+ __query["force_synthetic_source"] = force_synthetic_source
3718
3994
  if human is not None:
3719
3995
  __query["human"] = human
3720
3996
  if ignore_throttled is not None:
@@ -3834,7 +4110,13 @@ class Elasticsearch(BaseClient):
3834
4110
  if __body is not None:
3835
4111
  __headers["content-type"] = "application/json"
3836
4112
  return self.perform_request( # type: ignore[return-value]
3837
- "POST", __path, params=__query, headers=__headers, body=__body
4113
+ "POST",
4114
+ __path,
4115
+ params=__query,
4116
+ headers=__headers,
4117
+ body=__body,
4118
+ endpoint_id="search",
4119
+ path_parts=__path_parts,
3838
4120
  )
3839
4121
 
3840
4122
  @_rewrite_parameters(
@@ -3894,7 +4176,7 @@ class Elasticsearch(BaseClient):
3894
4176
  Searches a vector tile for geospatial values. Returns results as a binary Mapbox
3895
4177
  vector tile.
3896
4178
 
3897
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-vector-tile-api.html>`_
4179
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-vector-tile-api.html>`_
3898
4180
 
3899
4181
  :param index: Comma-separated list of data streams, indices, or aliases to search
3900
4182
  :param field: Field containing geospatial data to return
@@ -3949,7 +4231,14 @@ class Elasticsearch(BaseClient):
3949
4231
  raise ValueError("Empty value passed for parameter 'x'")
3950
4232
  if y in SKIP_IN_PATH:
3951
4233
  raise ValueError("Empty value passed for parameter 'y'")
3952
- __path = f"/{_quote(index)}/_mvt/{_quote(field)}/{_quote(zoom)}/{_quote(x)}/{_quote(y)}"
4234
+ __path_parts: t.Dict[str, str] = {
4235
+ "index": _quote(index),
4236
+ "field": _quote(field),
4237
+ "zoom": _quote(zoom),
4238
+ "x": _quote(x),
4239
+ "y": _quote(y),
4240
+ }
4241
+ __path = f'/{__path_parts["index"]}/_mvt/{__path_parts["field"]}/{__path_parts["zoom"]}/{__path_parts["x"]}/{__path_parts["y"]}'
3953
4242
  __query: t.Dict[str, t.Any] = {}
3954
4243
  __body: t.Dict[str, t.Any] = body if body is not None else {}
3955
4244
  # The 'sort' parameter with a colon can't be encoded to the body.
@@ -4006,7 +4295,13 @@ class Elasticsearch(BaseClient):
4006
4295
  if __body is not None:
4007
4296
  __headers["content-type"] = "application/json"
4008
4297
  return self.perform_request( # type: ignore[return-value]
4009
- "POST", __path, params=__query, headers=__headers, body=__body
4298
+ "POST",
4299
+ __path,
4300
+ params=__query,
4301
+ headers=__headers,
4302
+ body=__body,
4303
+ endpoint_id="search_mvt",
4304
+ path_parts=__path_parts,
4010
4305
  )
4011
4306
 
4012
4307
  @_rewrite_parameters()
@@ -4036,7 +4331,7 @@ class Elasticsearch(BaseClient):
4036
4331
  Returns information about the indices and shards that a search request would
4037
4332
  be executed against.
4038
4333
 
4039
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-shards.html>`_
4334
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-shards.html>`_
4040
4335
 
4041
4336
  :param index: Returns the indices and shards that a search request would be executed
4042
4337
  against.
@@ -4057,9 +4352,12 @@ class Elasticsearch(BaseClient):
4057
4352
  on. Random by default.
4058
4353
  :param routing: Custom value used to route operations to a specific shard.
4059
4354
  """
4355
+ __path_parts: t.Dict[str, str]
4060
4356
  if index not in SKIP_IN_PATH:
4061
- __path = f"/{_quote(index)}/_search_shards"
4357
+ __path_parts = {"index": _quote(index)}
4358
+ __path = f'/{__path_parts["index"]}/_search_shards'
4062
4359
  else:
4360
+ __path_parts = {}
4063
4361
  __path = "/_search_shards"
4064
4362
  __query: t.Dict[str, t.Any] = {}
4065
4363
  if allow_no_indices is not None:
@@ -4084,7 +4382,12 @@ class Elasticsearch(BaseClient):
4084
4382
  __query["routing"] = routing
4085
4383
  __headers = {"accept": "application/json"}
4086
4384
  return self.perform_request( # type: ignore[return-value]
4087
- "POST", __path, params=__query, headers=__headers
4385
+ "POST",
4386
+ __path,
4387
+ params=__query,
4388
+ headers=__headers,
4389
+ endpoint_id="search_shards",
4390
+ path_parts=__path_parts,
4088
4391
  )
4089
4392
 
4090
4393
  @_rewrite_parameters(
@@ -4129,7 +4432,7 @@ class Elasticsearch(BaseClient):
4129
4432
  """
4130
4433
  Allows to use the Mustache language to pre-render a search definition.
4131
4434
 
4132
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-template.html>`_
4435
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-template.html>`_
4133
4436
 
4134
4437
  :param index: Comma-separated list of data streams, indices, and aliases to search.
4135
4438
  Supports wildcards (*).
@@ -4169,9 +4472,12 @@ class Elasticsearch(BaseClient):
4169
4472
  :param typed_keys: If `true`, the response prefixes aggregation and suggester
4170
4473
  names with their respective types.
4171
4474
  """
4475
+ __path_parts: t.Dict[str, str]
4172
4476
  if index not in SKIP_IN_PATH:
4173
- __path = f"/{_quote(index)}/_search/template"
4477
+ __path_parts = {"index": _quote(index)}
4478
+ __path = f'/{__path_parts["index"]}/_search/template'
4174
4479
  else:
4480
+ __path_parts = {}
4175
4481
  __path = "/_search/template"
4176
4482
  __query: t.Dict[str, t.Any] = {}
4177
4483
  __body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -4218,7 +4524,13 @@ class Elasticsearch(BaseClient):
4218
4524
  __body["source"] = source
4219
4525
  __headers = {"accept": "application/json", "content-type": "application/json"}
4220
4526
  return self.perform_request( # type: ignore[return-value]
4221
- "POST", __path, params=__query, headers=__headers, body=__body
4527
+ "POST",
4528
+ __path,
4529
+ params=__query,
4530
+ headers=__headers,
4531
+ body=__body,
4532
+ endpoint_id="search_template",
4533
+ path_parts=__path_parts,
4222
4534
  )
4223
4535
 
4224
4536
  @_rewrite_parameters(
@@ -4254,7 +4566,7 @@ class Elasticsearch(BaseClient):
4254
4566
  the provided string. It is designed for low-latency look-ups used in auto-complete
4255
4567
  scenarios.
4256
4568
 
4257
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-terms-enum.html>`_
4569
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-terms-enum.html>`_
4258
4570
 
4259
4571
  :param index: Comma-separated list of data streams, indices, and index aliases
4260
4572
  to search. Wildcard (*) expressions are supported.
@@ -4277,7 +4589,8 @@ class Elasticsearch(BaseClient):
4277
4589
  raise ValueError("Empty value passed for parameter 'index'")
4278
4590
  if field is None and body is None:
4279
4591
  raise ValueError("Empty value passed for parameter 'field'")
4280
- __path = f"/{_quote(index)}/_terms_enum"
4592
+ __path_parts: t.Dict[str, str] = {"index": _quote(index)}
4593
+ __path = f'/{__path_parts["index"]}/_terms_enum'
4281
4594
  __query: t.Dict[str, t.Any] = {}
4282
4595
  __body: t.Dict[str, t.Any] = body if body is not None else {}
4283
4596
  if error_trace is not None:
@@ -4309,7 +4622,13 @@ class Elasticsearch(BaseClient):
4309
4622
  if __body is not None:
4310
4623
  __headers["content-type"] = "application/json"
4311
4624
  return self.perform_request( # type: ignore[return-value]
4312
- "POST", __path, params=__query, headers=__headers, body=__body
4625
+ "POST",
4626
+ __path,
4627
+ params=__query,
4628
+ headers=__headers,
4629
+ body=__body,
4630
+ endpoint_id="terms_enum",
4631
+ path_parts=__path_parts,
4313
4632
  )
4314
4633
 
4315
4634
  @_rewrite_parameters(
@@ -4346,7 +4665,7 @@ class Elasticsearch(BaseClient):
4346
4665
  Returns information and statistics about terms in the fields of a particular
4347
4666
  document.
4348
4667
 
4349
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-termvectors.html>`_
4668
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-termvectors.html>`_
4350
4669
 
4351
4670
  :param index: Name of the index that contains the document.
4352
4671
  :param id: Unique identifier of the document.
@@ -4373,10 +4692,13 @@ class Elasticsearch(BaseClient):
4373
4692
  """
4374
4693
  if index in SKIP_IN_PATH:
4375
4694
  raise ValueError("Empty value passed for parameter 'index'")
4695
+ __path_parts: t.Dict[str, str]
4376
4696
  if index not in SKIP_IN_PATH and id not in SKIP_IN_PATH:
4377
- __path = f"/{_quote(index)}/_termvectors/{_quote(id)}"
4697
+ __path_parts = {"index": _quote(index), "id": _quote(id)}
4698
+ __path = f'/{__path_parts["index"]}/_termvectors/{__path_parts["id"]}'
4378
4699
  elif index not in SKIP_IN_PATH:
4379
- __path = f"/{_quote(index)}/_termvectors"
4700
+ __path_parts = {"index": _quote(index)}
4701
+ __path = f'/{__path_parts["index"]}/_termvectors'
4380
4702
  else:
4381
4703
  raise ValueError("Couldn't find a path for the given parameters")
4382
4704
  __query: t.Dict[str, t.Any] = {}
@@ -4424,7 +4746,13 @@ class Elasticsearch(BaseClient):
4424
4746
  if __body is not None:
4425
4747
  __headers["content-type"] = "application/json"
4426
4748
  return self.perform_request( # type: ignore[return-value]
4427
- "POST", __path, params=__query, headers=__headers, body=__body
4749
+ "POST",
4750
+ __path,
4751
+ params=__query,
4752
+ headers=__headers,
4753
+ body=__body,
4754
+ endpoint_id="termvectors",
4755
+ path_parts=__path_parts,
4428
4756
  )
4429
4757
 
4430
4758
  @_rewrite_parameters(
@@ -4479,7 +4807,7 @@ class Elasticsearch(BaseClient):
4479
4807
  """
4480
4808
  Updates a document with a script or partial document.
4481
4809
 
4482
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-update.html>`_
4810
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-update.html>`_
4483
4811
 
4484
4812
  :param index: The name of the index
4485
4813
  :param id: Document ID
@@ -4521,7 +4849,8 @@ class Elasticsearch(BaseClient):
4521
4849
  raise ValueError("Empty value passed for parameter 'index'")
4522
4850
  if id in SKIP_IN_PATH:
4523
4851
  raise ValueError("Empty value passed for parameter 'id'")
4524
- __path = f"/{_quote(index)}/_update/{_quote(id)}"
4852
+ __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
4853
+ __path = f'/{__path_parts["index"]}/_update/{__path_parts["id"]}'
4525
4854
  __query: t.Dict[str, t.Any] = {}
4526
4855
  __body: t.Dict[str, t.Any] = body if body is not None else {}
4527
4856
  if error_trace is not None:
@@ -4571,7 +4900,13 @@ class Elasticsearch(BaseClient):
4571
4900
  __body["upsert"] = upsert
4572
4901
  __headers = {"accept": "application/json", "content-type": "application/json"}
4573
4902
  return self.perform_request( # type: ignore[return-value]
4574
- "POST", __path, params=__query, headers=__headers, body=__body
4903
+ "POST",
4904
+ __path,
4905
+ params=__query,
4906
+ headers=__headers,
4907
+ body=__body,
4908
+ endpoint_id="update",
4909
+ path_parts=__path_parts,
4575
4910
  )
4576
4911
 
4577
4912
  @_rewrite_parameters(
@@ -4635,10 +4970,11 @@ class Elasticsearch(BaseClient):
4635
4970
  body: t.Optional[t.Dict[str, t.Any]] = None,
4636
4971
  ) -> ObjectApiResponse[t.Any]:
4637
4972
  """
4638
- Performs an update on every document in the index without changing the source,
4639
- for example to pick up a mapping change.
4973
+ 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.
4640
4976
 
4641
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-update-by-query.html>`_
4977
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-update-by-query.html>`_
4642
4978
 
4643
4979
  :param index: Comma-separated list of data streams, indices, and aliases to search.
4644
4980
  Supports wildcards (`*`). To search all data streams or indices, omit this
@@ -4712,7 +5048,8 @@ class Elasticsearch(BaseClient):
4712
5048
  """
4713
5049
  if index in SKIP_IN_PATH:
4714
5050
  raise ValueError("Empty value passed for parameter 'index'")
4715
- __path = f"/{_quote(index)}/_update_by_query"
5051
+ __path_parts: t.Dict[str, str] = {"index": _quote(index)}
5052
+ __path = f'/{__path_parts["index"]}/_update_by_query'
4716
5053
  __query: t.Dict[str, t.Any] = {}
4717
5054
  __body: t.Dict[str, t.Any] = body if body is not None else {}
4718
5055
  # The 'sort' parameter with a colon can't be encoded to the body.
@@ -4807,7 +5144,13 @@ class Elasticsearch(BaseClient):
4807
5144
  if __body is not None:
4808
5145
  __headers["content-type"] = "application/json"
4809
5146
  return self.perform_request( # type: ignore[return-value]
4810
- "POST", __path, params=__query, headers=__headers, body=__body
5147
+ "POST",
5148
+ __path,
5149
+ params=__query,
5150
+ headers=__headers,
5151
+ body=__body,
5152
+ endpoint_id="update_by_query",
5153
+ path_parts=__path_parts,
4811
5154
  )
4812
5155
 
4813
5156
  @_rewrite_parameters()
@@ -4824,7 +5167,7 @@ class Elasticsearch(BaseClient):
4824
5167
  """
4825
5168
  Changes the number of requests per second for a particular Update By Query operation.
4826
5169
 
4827
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-update-by-query.html>`_
5170
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-update-by-query.html>`_
4828
5171
 
4829
5172
  :param task_id: The ID for the task.
4830
5173
  :param requests_per_second: The throttle for this request in sub-requests per
@@ -4832,7 +5175,8 @@ class Elasticsearch(BaseClient):
4832
5175
  """
4833
5176
  if task_id in SKIP_IN_PATH:
4834
5177
  raise ValueError("Empty value passed for parameter 'task_id'")
4835
- __path = f"/_update_by_query/{_quote(task_id)}/_rethrottle"
5178
+ __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
5179
+ __path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle'
4836
5180
  __query: t.Dict[str, t.Any] = {}
4837
5181
  if error_trace is not None:
4838
5182
  __query["error_trace"] = error_trace
@@ -4846,5 +5190,10 @@ class Elasticsearch(BaseClient):
4846
5190
  __query["requests_per_second"] = requests_per_second
4847
5191
  __headers = {"accept": "application/json"}
4848
5192
  return self.perform_request( # type: ignore[return-value]
4849
- "POST", __path, params=__query, headers=__headers
5193
+ "POST",
5194
+ __path,
5195
+ params=__query,
5196
+ headers=__headers,
5197
+ endpoint_id="update_by_query_rethrottle",
5198
+ path_parts=__path_parts,
4850
5199
  )