elasticsearch9 9.1.1__py3-none-any.whl → 9.1.3__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 (124) hide show
  1. elasticsearch9/_async/client/__init__.py +69 -65
  2. elasticsearch9/_async/client/async_search.py +3 -3
  3. elasticsearch9/_async/client/autoscaling.py +8 -4
  4. elasticsearch9/_async/client/cat.py +521 -27
  5. elasticsearch9/_async/client/ccr.py +10 -10
  6. elasticsearch9/_async/client/cluster.py +34 -33
  7. elasticsearch9/_async/client/connector.py +45 -44
  8. elasticsearch9/_async/client/dangling_indices.py +8 -12
  9. elasticsearch9/_async/client/enrich.py +10 -10
  10. elasticsearch9/_async/client/eql.py +10 -10
  11. elasticsearch9/_async/client/esql.py +16 -16
  12. elasticsearch9/_async/client/features.py +6 -6
  13. elasticsearch9/_async/client/fleet.py +8 -12
  14. elasticsearch9/_async/client/graph.py +3 -7
  15. elasticsearch9/_async/client/ilm.py +20 -28
  16. elasticsearch9/_async/client/indices.py +163 -169
  17. elasticsearch9/_async/client/inference.py +41 -127
  18. elasticsearch9/_async/client/ingest.py +9 -9
  19. elasticsearch9/_async/client/license.py +5 -7
  20. elasticsearch9/_async/client/logstash.py +7 -5
  21. elasticsearch9/_async/client/migration.py +6 -6
  22. elasticsearch9/_async/client/ml.py +125 -85
  23. elasticsearch9/_async/client/monitoring.py +4 -3
  24. elasticsearch9/_async/client/nodes.py +17 -17
  25. elasticsearch9/_async/client/query_rules.py +16 -16
  26. elasticsearch9/_async/client/rollup.py +21 -21
  27. elasticsearch9/_async/client/search_application.py +19 -19
  28. elasticsearch9/_async/client/searchable_snapshots.py +10 -10
  29. elasticsearch9/_async/client/security.py +8 -7
  30. elasticsearch9/_async/client/shutdown.py +14 -19
  31. elasticsearch9/_async/client/simulate.py +4 -4
  32. elasticsearch9/_async/client/slm.py +18 -22
  33. elasticsearch9/_async/client/snapshot.py +20 -20
  34. elasticsearch9/_async/client/sql.py +10 -10
  35. elasticsearch9/_async/client/streams.py +186 -0
  36. elasticsearch9/_async/client/synonyms.py +10 -10
  37. elasticsearch9/_async/client/tasks.py +8 -8
  38. elasticsearch9/_async/client/text_structure.py +13 -9
  39. elasticsearch9/_async/client/transform.py +51 -12
  40. elasticsearch9/_async/client/utils.py +4 -2
  41. elasticsearch9/_async/client/watcher.py +27 -31
  42. elasticsearch9/_async/client/xpack.py +6 -5
  43. elasticsearch9/_async/helpers.py +58 -9
  44. elasticsearch9/_sync/client/__init__.py +71 -65
  45. elasticsearch9/_sync/client/async_search.py +3 -3
  46. elasticsearch9/_sync/client/autoscaling.py +8 -4
  47. elasticsearch9/_sync/client/cat.py +521 -27
  48. elasticsearch9/_sync/client/ccr.py +10 -10
  49. elasticsearch9/_sync/client/cluster.py +34 -33
  50. elasticsearch9/_sync/client/connector.py +45 -44
  51. elasticsearch9/_sync/client/dangling_indices.py +8 -12
  52. elasticsearch9/_sync/client/enrich.py +10 -10
  53. elasticsearch9/_sync/client/eql.py +10 -10
  54. elasticsearch9/_sync/client/esql.py +16 -16
  55. elasticsearch9/_sync/client/features.py +6 -6
  56. elasticsearch9/_sync/client/fleet.py +8 -12
  57. elasticsearch9/_sync/client/graph.py +3 -7
  58. elasticsearch9/_sync/client/ilm.py +20 -28
  59. elasticsearch9/_sync/client/indices.py +163 -169
  60. elasticsearch9/_sync/client/inference.py +41 -127
  61. elasticsearch9/_sync/client/ingest.py +9 -9
  62. elasticsearch9/_sync/client/license.py +5 -7
  63. elasticsearch9/_sync/client/logstash.py +7 -5
  64. elasticsearch9/_sync/client/migration.py +6 -6
  65. elasticsearch9/_sync/client/ml.py +125 -85
  66. elasticsearch9/_sync/client/monitoring.py +4 -3
  67. elasticsearch9/_sync/client/nodes.py +17 -17
  68. elasticsearch9/_sync/client/query_rules.py +16 -16
  69. elasticsearch9/_sync/client/rollup.py +21 -21
  70. elasticsearch9/_sync/client/search_application.py +19 -19
  71. elasticsearch9/_sync/client/searchable_snapshots.py +10 -10
  72. elasticsearch9/_sync/client/security.py +8 -7
  73. elasticsearch9/_sync/client/shutdown.py +14 -19
  74. elasticsearch9/_sync/client/simulate.py +4 -4
  75. elasticsearch9/_sync/client/slm.py +18 -22
  76. elasticsearch9/_sync/client/snapshot.py +20 -20
  77. elasticsearch9/_sync/client/sql.py +10 -10
  78. elasticsearch9/_sync/client/streams.py +186 -0
  79. elasticsearch9/_sync/client/synonyms.py +10 -10
  80. elasticsearch9/_sync/client/tasks.py +8 -8
  81. elasticsearch9/_sync/client/text_structure.py +13 -9
  82. elasticsearch9/_sync/client/transform.py +51 -12
  83. elasticsearch9/_sync/client/utils.py +16 -2
  84. elasticsearch9/_sync/client/watcher.py +27 -31
  85. elasticsearch9/_sync/client/xpack.py +6 -5
  86. elasticsearch9/_version.py +2 -1
  87. elasticsearch9/client.py +2 -0
  88. elasticsearch9/compat.py +43 -1
  89. elasticsearch9/dsl/__init__.py +28 -0
  90. elasticsearch9/dsl/_async/document.py +4 -5
  91. elasticsearch9/dsl/_async/index.py +1 -1
  92. elasticsearch9/dsl/_async/search.py +2 -3
  93. elasticsearch9/dsl/_sync/document.py +4 -5
  94. elasticsearch9/dsl/_sync/index.py +1 -1
  95. elasticsearch9/dsl/_sync/search.py +2 -3
  96. elasticsearch9/dsl/aggs.py +100 -3
  97. elasticsearch9/dsl/async_connections.py +1 -2
  98. elasticsearch9/dsl/connections.py +1 -2
  99. elasticsearch9/dsl/document_base.py +15 -0
  100. elasticsearch9/dsl/field.py +12 -1
  101. elasticsearch9/dsl/query.py +23 -0
  102. elasticsearch9/dsl/response/__init__.py +3 -0
  103. elasticsearch9/dsl/serializer.py +1 -2
  104. elasticsearch9/dsl/types.py +185 -5
  105. elasticsearch9/dsl/utils.py +1 -2
  106. elasticsearch9/esql/esql.py +1 -1
  107. elasticsearch9/esql/functions.py +2 -2
  108. elasticsearch9/helpers/__init__.py +10 -1
  109. elasticsearch9/helpers/actions.py +106 -33
  110. elasticsearch9/helpers/vectorstore/__init__.py +7 -7
  111. elasticsearch9/helpers/vectorstore/_async/_utils.py +1 -1
  112. elasticsearch9/helpers/vectorstore/_async/embedding_service.py +2 -2
  113. elasticsearch9/helpers/vectorstore/_async/strategies.py +3 -3
  114. elasticsearch9/helpers/vectorstore/_async/vectorstore.py +5 -5
  115. elasticsearch9/helpers/vectorstore/_sync/_utils.py +1 -1
  116. elasticsearch9/helpers/vectorstore/_sync/embedding_service.py +2 -2
  117. elasticsearch9/helpers/vectorstore/_sync/strategies.py +3 -3
  118. elasticsearch9/helpers/vectorstore/_sync/vectorstore.py +5 -5
  119. {elasticsearch9-9.1.1.dist-info → elasticsearch9-9.1.3.dist-info}/METADATA +2 -2
  120. elasticsearch9-9.1.3.dist-info/RECORD +165 -0
  121. {elasticsearch9-9.1.1.dist-info → elasticsearch9-9.1.3.dist-info}/WHEEL +1 -1
  122. elasticsearch9-9.1.1.dist-info/RECORD +0 -163
  123. {elasticsearch9-9.1.1.dist-info → elasticsearch9-9.1.3.dist-info}/licenses/LICENSE +0 -0
  124. {elasticsearch9-9.1.1.dist-info → elasticsearch9-9.1.3.dist-info}/licenses/NOTICE +0 -0
@@ -85,6 +85,45 @@ class TransformClient(NamespacedClient):
85
85
  path_parts=__path_parts,
86
86
  )
87
87
 
88
+ @_rewrite_parameters()
89
+ def get_node_stats(
90
+ self,
91
+ *,
92
+ error_trace: t.Optional[bool] = None,
93
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
94
+ human: t.Optional[bool] = None,
95
+ pretty: t.Optional[bool] = None,
96
+ ) -> ObjectApiResponse[t.Any]:
97
+ """
98
+ .. raw:: html
99
+
100
+ <p>Get node stats.</p>
101
+ <p>Get per-node information about transform usage.</p>
102
+
103
+
104
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-node-stats>`_
105
+ """
106
+ __path_parts: t.Dict[str, str] = {}
107
+ __path = "/_transform/_node_stats"
108
+ __query: t.Dict[str, t.Any] = {}
109
+ if error_trace is not None:
110
+ __query["error_trace"] = error_trace
111
+ if filter_path is not None:
112
+ __query["filter_path"] = filter_path
113
+ if human is not None:
114
+ __query["human"] = human
115
+ if pretty is not None:
116
+ __query["pretty"] = pretty
117
+ __headers = {"accept": "application/json"}
118
+ return self.perform_request( # type: ignore[return-value]
119
+ "GET",
120
+ __path,
121
+ params=__query,
122
+ headers=__headers,
123
+ endpoint_id="transform.get_node_stats",
124
+ path_parts=__path_parts,
125
+ )
126
+
88
127
  @_rewrite_parameters(
89
128
  parameter_aliases={"from": "from_"},
90
129
  )
@@ -104,8 +143,8 @@ class TransformClient(NamespacedClient):
104
143
  """
105
144
  .. raw:: html
106
145
 
107
- <p>Get transforms.
108
- Get configuration information for transforms.</p>
146
+ <p>Get transforms.</p>
147
+ <p>Get configuration information for transforms.</p>
109
148
 
110
149
 
111
150
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform>`_
@@ -262,8 +301,8 @@ class TransformClient(NamespacedClient):
262
301
  """
263
302
  .. raw:: html
264
303
 
265
- <p>Preview a transform.
266
- Generates a preview of the results that you will get when you create a transform with the same configuration.</p>
304
+ <p>Preview a transform.</p>
305
+ <p>Generates a preview of the results that you will get when you create a transform with the same configuration.</p>
267
306
  <p>It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
268
307
  generates a list of mappings and settings for the destination index. These values are determined based on the field
269
308
  types of the source index and the transform aggregations.</p>
@@ -386,8 +425,8 @@ class TransformClient(NamespacedClient):
386
425
  """
387
426
  .. raw:: html
388
427
 
389
- <p>Create a transform.
390
- Creates a transform.</p>
428
+ <p>Create a transform.</p>
429
+ <p>Creates a transform.</p>
391
430
  <p>A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
392
431
  a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
393
432
  unique row per entity.</p>
@@ -616,8 +655,8 @@ class TransformClient(NamespacedClient):
616
655
  """
617
656
  .. raw:: html
618
657
 
619
- <p>Set upgrade_mode for transform indices.
620
- Sets a cluster wide upgrade_mode setting that prepares transform
658
+ <p>Set upgrade_mode for transform indices.</p>
659
+ <p>Sets a cluster wide upgrade_mode setting that prepares transform
621
660
  indices for an upgrade.
622
661
  When upgrading your cluster, in some circumstances you must restart your
623
662
  nodes and reindex your transform indices. In those circumstances,
@@ -749,8 +788,8 @@ class TransformClient(NamespacedClient):
749
788
  """
750
789
  .. raw:: html
751
790
 
752
- <p>Stop transforms.
753
- Stops one or more transforms.</p>
791
+ <p>Stop transforms.</p>
792
+ <p>Stops one or more transforms.</p>
754
793
 
755
794
 
756
795
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-stop-transform>`_
@@ -846,8 +885,8 @@ class TransformClient(NamespacedClient):
846
885
  """
847
886
  .. raw:: html
848
887
 
849
- <p>Update a transform.
850
- Updates certain properties of a transform.</p>
888
+ <p>Update a transform.</p>
889
+ <p>Updates certain properties of a transform.</p>
851
890
  <p>All updated properties except <code>description</code> do not take effect until after the transform starts the next checkpoint,
852
891
  thus there is data consistency in each checkpoint. To use this API, you must have <code>read</code> and <code>view_index_metadata</code>
853
892
  privileges for the source indices. You must also have <code>index</code> and <code>read</code> privileges for the destination index. When
@@ -79,6 +79,12 @@ class Stability(Enum):
79
79
  EXPERIMENTAL = auto()
80
80
 
81
81
 
82
+ class Visibility(Enum):
83
+ PUBLIC = auto()
84
+ FEATURE_FLAG = auto()
85
+ PRIVATE = auto()
86
+
87
+
82
88
  _TYPE_HOSTS = Union[
83
89
  str, Sequence[Union[str, Mapping[str, Union[str, int]], NodeConfig]]
84
90
  ]
@@ -419,15 +425,23 @@ def _rewrite_parameters(
419
425
  return wrapper
420
426
 
421
427
 
422
- def _stability_warning(
428
+ def _availability_warning(
423
429
  stability: Stability,
430
+ visibility: Visibility = Visibility.PUBLIC,
424
431
  version: Optional[str] = None,
425
432
  message: Optional[str] = None,
426
433
  ) -> Callable[[F], F]:
427
434
  def wrapper(api: F) -> F:
428
435
  @wraps(api)
429
436
  def wrapped(*args: Any, **kwargs: Any) -> Any:
430
- if stability == Stability.BETA:
437
+ if visibility == Visibility.PRIVATE:
438
+ warnings.warn(
439
+ "This API is private. "
440
+ "Private APIs are not subject to the support SLA of official GA features.",
441
+ category=GeneralAvailabilityWarning,
442
+ stacklevel=warn_stacklevel(),
443
+ )
444
+ elif stability == Stability.BETA:
431
445
  warnings.warn(
432
446
  "This API is in beta and is subject to change. "
433
447
  "The design and code is less mature than official GA features and is being provided as-is with no warranties. "
@@ -39,8 +39,8 @@ class WatcherClient(NamespacedClient):
39
39
  """
40
40
  .. raw:: html
41
41
 
42
- <p>Acknowledge a watch.
43
- Acknowledging a watch enables you to manually throttle the execution of the watch's actions.</p>
42
+ <p>Acknowledge a watch.</p>
43
+ <p>Acknowledging a watch enables you to manually throttle the execution of the watch's actions.</p>
44
44
  <p>The acknowledgement state of an action is stored in the <code>status.actions.&lt;id&gt;.ack.state</code> structure.</p>
45
45
  <p>IMPORTANT: If the specified watch is currently being executed, this API will return an error
46
46
  The reason for this behavior is to prevent overwriting the watch status from a watch execution.</p>
@@ -101,8 +101,8 @@ class WatcherClient(NamespacedClient):
101
101
  """
102
102
  .. raw:: html
103
103
 
104
- <p>Activate a watch.
105
- A watch can be either active or inactive.</p>
104
+ <p>Activate a watch.</p>
105
+ <p>A watch can be either active or inactive.</p>
106
106
 
107
107
 
108
108
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-activate-watch>`_
@@ -145,8 +145,8 @@ class WatcherClient(NamespacedClient):
145
145
  """
146
146
  .. raw:: html
147
147
 
148
- <p>Deactivate a watch.
149
- A watch can be either active or inactive.</p>
148
+ <p>Deactivate a watch.</p>
149
+ <p>A watch can be either active or inactive.</p>
150
150
 
151
151
 
152
152
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-deactivate-watch>`_
@@ -189,8 +189,8 @@ class WatcherClient(NamespacedClient):
189
189
  """
190
190
  .. raw:: html
191
191
 
192
- <p>Delete a watch.
193
- When the watch is removed, the document representing the watch in the <code>.watches</code> index is gone and it will never be run again.</p>
192
+ <p>Delete a watch.</p>
193
+ <p>When the watch is removed, the document representing the watch in the <code>.watches</code> index is gone and it will never be run again.</p>
194
194
  <p>Deleting a watch does not delete any watch execution records related to this watch from the watch history.</p>
195
195
  <p>IMPORTANT: Deleting a watch must be done by using only this API.
196
196
  Do not delete the watch directly from the <code>.watches</code> index using the Elasticsearch delete document API
@@ -266,8 +266,8 @@ class WatcherClient(NamespacedClient):
266
266
  """
267
267
  .. raw:: html
268
268
 
269
- <p>Run a watch.
270
- This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes.</p>
269
+ <p>Run a watch.</p>
270
+ <p>This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes.</p>
271
271
  <p>For testing and debugging purposes, you also have fine-grained control on how the watch runs.
272
272
  You can run the watch without running all of its actions or alternatively by simulating them.
273
273
  You can also force execution by ignoring the watch condition and control whether a watch record would be written to the watch history after it runs.</p>
@@ -362,8 +362,8 @@ class WatcherClient(NamespacedClient):
362
362
  """
363
363
  .. raw:: html
364
364
 
365
- <p>Get Watcher index settings.
366
- Get settings for the Watcher internal index (<code>.watches</code>).
365
+ <p>Get Watcher index settings.</p>
366
+ <p>Get settings for the Watcher internal index (<code>.watches</code>).
367
367
  Only a subset of settings are shown, for example <code>index.auto_expand_replicas</code> and <code>index.number_of_replicas</code>.</p>
368
368
 
369
369
 
@@ -476,8 +476,8 @@ class WatcherClient(NamespacedClient):
476
476
  """
477
477
  .. raw:: html
478
478
 
479
- <p>Create or update a watch.
480
- When a watch is registered, a new document that represents the watch is added to the <code>.watches</code> index and its trigger is immediately registered with the relevant trigger engine.
479
+ <p>Create or update a watch.</p>
480
+ <p>When a watch is registered, a new document that represents the watch is added to the <code>.watches</code> index and its trigger is immediately registered with the relevant trigger engine.
481
481
  Typically for the <code>schedule</code> trigger, the scheduler is the trigger engine.</p>
482
482
  <p>IMPORTANT: You must use Kibana or this API to create a watch.
483
483
  Do not add a watch directly to the <code>.watches</code> index by using the Elasticsearch index API.
@@ -494,9 +494,9 @@ class WatcherClient(NamespacedClient):
494
494
  :param active: The initial state of the watch. The default value is `true`, which
495
495
  means the watch is active by default.
496
496
  :param condition: The condition that defines if the actions should be run.
497
- :param if_primary_term: only update the watch if the last operation that has
497
+ :param if_primary_term: Only update the watch if the last operation that has
498
498
  changed the watch has the specified primary term
499
- :param if_seq_no: only update the watch if the last operation that has changed
499
+ :param if_seq_no: Only update the watch if the last operation that has changed
500
500
  the watch has the specified sequence number
501
501
  :param input: The input that defines the input that loads the data for the watch.
502
502
  :param metadata: Metadata JSON that will be copied into the history entries.
@@ -552,11 +552,7 @@ class WatcherClient(NamespacedClient):
552
552
  __body["transform"] = transform
553
553
  if trigger is not None:
554
554
  __body["trigger"] = trigger
555
- if not __body:
556
- __body = None # type: ignore[assignment]
557
- __headers = {"accept": "application/json"}
558
- if __body is not None:
559
- __headers["content-type"] = "application/json"
555
+ __headers = {"accept": "application/json", "content-type": "application/json"}
560
556
  return self.perform_request( # type: ignore[return-value]
561
557
  "PUT",
562
558
  __path,
@@ -595,8 +591,8 @@ class WatcherClient(NamespacedClient):
595
591
  """
596
592
  .. raw:: html
597
593
 
598
- <p>Query watches.
599
- Get all registered watches in a paginated manner and optionally filter watches by a query.</p>
594
+ <p>Query watches.</p>
595
+ <p>Get all registered watches in a paginated manner and optionally filter watches by a query.</p>
600
596
  <p>Note that only the <code>_id</code> and <code>metadata.*</code> fields are queryable or sortable.</p>
601
597
 
602
598
 
@@ -671,8 +667,8 @@ class WatcherClient(NamespacedClient):
671
667
  """
672
668
  .. raw:: html
673
669
 
674
- <p>Start the watch service.
675
- Start the Watcher service if it is not already running.</p>
670
+ <p>Start the watch service.</p>
671
+ <p>Start the Watcher service if it is not already running.</p>
676
672
 
677
673
 
678
674
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-start>`_
@@ -736,8 +732,8 @@ class WatcherClient(NamespacedClient):
736
732
  """
737
733
  .. raw:: html
738
734
 
739
- <p>Get Watcher statistics.
740
- This API always returns basic metrics.
735
+ <p>Get Watcher statistics.</p>
736
+ <p>This API always returns basic metrics.
741
737
  You retrieve more metrics by using the metric parameter.</p>
742
738
 
743
739
 
@@ -788,8 +784,8 @@ class WatcherClient(NamespacedClient):
788
784
  """
789
785
  .. raw:: html
790
786
 
791
- <p>Stop the watch service.
792
- Stop the Watcher service if it is running.</p>
787
+ <p>Stop the watch service.</p>
788
+ <p>Stop the Watcher service if it is running.</p>
793
789
 
794
790
 
795
791
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-stop>`_
@@ -844,8 +840,8 @@ class WatcherClient(NamespacedClient):
844
840
  """
845
841
  .. raw:: html
846
842
 
847
- <p>Update Watcher index settings.
848
- Update settings for the Watcher internal index (<code>.watches</code>).
843
+ <p>Update Watcher index settings.</p>
844
+ <p>Update settings for the Watcher internal index (<code>.watches</code>).
849
845
  Only a subset of settings can be modified.
850
846
  This includes <code>index.auto_expand_replicas</code>, <code>index.number_of_replicas</code>, <code>index.routing.allocation.exclude.*</code>,
851
847
  <code>index.routing.allocation.include.*</code> and <code>index.routing.allocation.require.*</code>.
@@ -45,8 +45,8 @@ class XPackClient(NamespacedClient):
45
45
  """
46
46
  .. raw:: html
47
47
 
48
- <p>Get information.
49
- The information provided by the API includes:</p>
48
+ <p>Get information.</p>
49
+ <p>The information provided by the API includes:</p>
50
50
  <ul>
51
51
  <li>Build information including the build number and timestamp.</li>
52
52
  <li>License information about the currently installed license.</li>
@@ -56,7 +56,8 @@ class XPackClient(NamespacedClient):
56
56
 
57
57
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-info>`_
58
58
 
59
- :param accept_enterprise: If this param is used it must be set to true
59
+ :param accept_enterprise: If used, this otherwise ignored parameter must be set
60
+ to true
60
61
  :param categories: A comma-separated list of the information categories to include
61
62
  in the response. For example, `build,license,features`.
62
63
  """
@@ -98,8 +99,8 @@ class XPackClient(NamespacedClient):
98
99
  """
99
100
  .. raw:: html
100
101
 
101
- <p>Get usage information.
102
- Get information about the features that are currently enabled and available under the current license.
102
+ <p>Get usage information.</p>
103
+ <p>Get information about the features that are currently enabled and available under the current license.
103
104
  The API also provides some usage statistics.</p>
104
105
 
105
106
 
@@ -15,4 +15,5 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
- __versionstr__ = "9.1.1"
18
+ __versionstr__ = "9.1.3"
19
+ __es_specification_commit__ = "69144c05ec6727c4ee39aec454f7ad6a57d240fc"
elasticsearch9/client.py CHANGED
@@ -62,6 +62,7 @@ from ._sync.client.slm import SlmClient as SlmClient # noqa: F401
62
62
  from ._sync.client.snapshot import SnapshotClient as SnapshotClient # noqa: F401
63
63
  from ._sync.client.sql import SqlClient as SqlClient # noqa: F401
64
64
  from ._sync.client.ssl import SslClient as SslClient # noqa: F401
65
+ from ._sync.client.streams import StreamsClient as StreamsClient # noqa: F401
65
66
  from ._sync.client.synonyms import SynonymsClient as SynonymsClient # noqa: F401
66
67
  from ._sync.client.tasks import TasksClient as TasksClient # noqa: F401
67
68
  from ._sync.client.text_structure import ( # noqa: F401
@@ -115,6 +116,7 @@ __all__ = [
115
116
  "SnapshotClient",
116
117
  "SqlClient",
117
118
  "SslClient",
119
+ "StreamsClient",
118
120
  "TasksClient",
119
121
  "TextStructureClient",
120
122
  "TransformClient",
elasticsearch9/compat.py CHANGED
@@ -15,11 +15,14 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
+ import asyncio
18
19
  import inspect
19
20
  import os
20
21
  import sys
22
+ from contextlib import asynccontextmanager, contextmanager
21
23
  from pathlib import Path
22
- from typing import Tuple, Type, Union
24
+ from threading import Thread
25
+ from typing import Any, AsyncIterator, Callable, Coroutine, Iterator, Tuple, Type, Union
23
26
 
24
27
  string_types: Tuple[Type[str], Type[bytes]] = (str, bytes)
25
28
 
@@ -76,9 +79,48 @@ def warn_stacklevel() -> int:
76
79
  return 0
77
80
 
78
81
 
82
+ @contextmanager
83
+ def safe_thread(
84
+ target: Callable[..., Any], *args: Any, **kwargs: Any
85
+ ) -> Iterator[Thread]:
86
+ """Run a thread within a context manager block.
87
+
88
+ The thread is automatically joined when the block ends. If the thread raised
89
+ an exception, it is raised in the caller's context.
90
+ """
91
+ captured_exception = None
92
+
93
+ def run() -> None:
94
+ try:
95
+ target(*args, **kwargs)
96
+ except BaseException as exc:
97
+ nonlocal captured_exception
98
+ captured_exception = exc
99
+
100
+ thread = Thread(target=run)
101
+ thread.start()
102
+ yield thread
103
+ thread.join()
104
+ if captured_exception:
105
+ raise captured_exception
106
+
107
+
108
+ @asynccontextmanager
109
+ async def safe_task(coro: Coroutine[Any, Any, Any]) -> AsyncIterator[asyncio.Task[Any]]:
110
+ """Run a background task within a context manager block.
111
+
112
+ The task is awaited when the block ends.
113
+ """
114
+ task = asyncio.create_task(coro)
115
+ yield task
116
+ await task
117
+
118
+
79
119
  __all__ = [
80
120
  "string_types",
81
121
  "to_str",
82
122
  "to_bytes",
83
123
  "warn_stacklevel",
124
+ "safe_thread",
125
+ "safe_task",
84
126
  ]
@@ -38,23 +38,30 @@ from .faceted_search import (
38
38
  TermsFacet,
39
39
  )
40
40
  from .field import (
41
+ AggregateMetricDouble,
42
+ Alias,
41
43
  Binary,
42
44
  Boolean,
43
45
  Byte,
44
46
  Completion,
45
47
  ConstantKeyword,
48
+ CountedKeyword,
46
49
  CustomField,
47
50
  Date,
51
+ DateNanos,
48
52
  DateRange,
49
53
  DenseVector,
50
54
  Double,
51
55
  DoubleRange,
52
56
  Field,
57
+ Flattened,
53
58
  Float,
54
59
  FloatRange,
55
60
  GeoPoint,
56
61
  GeoShape,
57
62
  HalfFloat,
63
+ Histogram,
64
+ IcuCollationKeyword,
58
65
  Integer,
59
66
  IntegerRange,
60
67
  Ip,
@@ -63,21 +70,28 @@ from .field import (
63
70
  Keyword,
64
71
  Long,
65
72
  LongRange,
73
+ MatchOnlyText,
66
74
  Murmur3,
67
75
  Nested,
68
76
  Object,
77
+ Passthrough,
69
78
  Percolator,
70
79
  Point,
71
80
  RangeField,
72
81
  RankFeature,
73
82
  RankFeatures,
83
+ RankVectors,
74
84
  ScaledFloat,
75
85
  SearchAsYouType,
86
+ SemanticText,
76
87
  Shape,
77
88
  Short,
78
89
  SparseVector,
79
90
  Text,
80
91
  TokenCount,
92
+ UnsignedLong,
93
+ Version,
94
+ Wildcard,
81
95
  construct_field,
82
96
  )
83
97
  from .function import SF
@@ -108,6 +122,8 @@ __all__ = [
108
122
  "A",
109
123
  "Agg",
110
124
  "AggResponse",
125
+ "AggregateMetricDouble",
126
+ "Alias",
111
127
  "AsyncComposableIndexTemplate",
112
128
  "AsyncDocument",
113
129
  "AsyncEmptySearch",
@@ -126,9 +142,11 @@ __all__ = [
126
142
  "Completion",
127
143
  "ComposableIndexTemplate",
128
144
  "ConstantKeyword",
145
+ "CountedKeyword",
129
146
  "CustomField",
130
147
  "Date",
131
148
  "DateHistogramFacet",
149
+ "DateNanos",
132
150
  "DateRange",
133
151
  "DenseVector",
134
152
  "Document",
@@ -142,12 +160,15 @@ __all__ = [
142
160
  "FacetedResponse",
143
161
  "FacetedSearch",
144
162
  "Field",
163
+ "Flattened",
145
164
  "Float",
146
165
  "FloatRange",
147
166
  "GeoPoint",
148
167
  "GeoShape",
149
168
  "HalfFloat",
169
+ "Histogram",
150
170
  "HistogramFacet",
171
+ "IcuCollationKeyword",
151
172
  "IllegalOperation",
152
173
  "Index",
153
174
  "IndexTemplate",
@@ -162,12 +183,14 @@ __all__ = [
162
183
  "LongRange",
163
184
  "M",
164
185
  "Mapping",
186
+ "MatchOnlyText",
165
187
  "MetaField",
166
188
  "MultiSearch",
167
189
  "Murmur3",
168
190
  "Nested",
169
191
  "NestedFacet",
170
192
  "Object",
193
+ "Passthrough",
171
194
  "Percolator",
172
195
  "Point",
173
196
  "Q",
@@ -177,11 +200,13 @@ __all__ = [
177
200
  "RangeField",
178
201
  "RankFeature",
179
202
  "RankFeatures",
203
+ "RankVectors",
180
204
  "Response",
181
205
  "SF",
182
206
  "ScaledFloat",
183
207
  "Search",
184
208
  "SearchAsYouType",
209
+ "SemanticText",
185
210
  "Shape",
186
211
  "Short",
187
212
  "SparseVector",
@@ -189,9 +214,12 @@ __all__ = [
189
214
  "Text",
190
215
  "TokenCount",
191
216
  "UnknownDslObject",
217
+ "UnsignedLong",
192
218
  "UpdateByQuery",
193
219
  "UpdateByQueryResponse",
194
220
  "ValidationException",
221
+ "Version",
222
+ "Wildcard",
195
223
  "analyzer",
196
224
  "async_connections",
197
225
  "char_filter",
@@ -31,9 +31,8 @@ from typing import (
31
31
 
32
32
  from typing_extensions import Self, dataclass_transform
33
33
 
34
- from elasticsearch.exceptions import NotFoundError, RequestError
35
- from elasticsearch.helpers import async_bulk
36
-
34
+ from ...exceptions import NotFoundError, RequestError
35
+ from ...helpers import async_bulk
37
36
  from .._async.index import AsyncIndex
38
37
  from ..async_connections import get_connection
39
38
  from ..document_base import DocumentBase, DocumentMeta, mapped_field
@@ -42,8 +41,8 @@ from ..utils import DOC_META_FIELDS, META_FIELDS, AsyncUsingType, merge
42
41
  from .search import AsyncSearch
43
42
 
44
43
  if TYPE_CHECKING:
45
- from elasticsearch import AsyncElasticsearch
46
- from elasticsearch.esql.esql import ESQLBase
44
+ from ... import AsyncElasticsearch
45
+ from ...esql.esql import ESQLBase
47
46
 
48
47
 
49
48
  class AsyncIndexMeta(DocumentMeta):
@@ -30,7 +30,7 @@ from .update_by_query import AsyncUpdateByQuery
30
30
  if TYPE_CHECKING:
31
31
  from elastic_transport import ObjectApiResponse
32
32
 
33
- from elasticsearch import AsyncElasticsearch
33
+ from ... import AsyncElasticsearch
34
34
 
35
35
 
36
36
  class AsyncIndexTemplate:
@@ -29,9 +29,8 @@ from typing import (
29
29
 
30
30
  from typing_extensions import Self
31
31
 
32
- from elasticsearch.exceptions import ApiError
33
- from elasticsearch.helpers import async_scan
34
-
32
+ from ...exceptions import ApiError
33
+ from ...helpers import async_scan
35
34
  from ..async_connections import get_connection
36
35
  from ..response import Response
37
36
  from ..search_base import MultiSearchBase, SearchBase
@@ -31,9 +31,8 @@ from typing import (
31
31
 
32
32
  from typing_extensions import Self, dataclass_transform
33
33
 
34
- from elasticsearch.exceptions import NotFoundError, RequestError
35
- from elasticsearch.helpers import bulk
36
-
34
+ from ...exceptions import NotFoundError, RequestError
35
+ from ...helpers import bulk
37
36
  from .._sync.index import Index
38
37
  from ..connections import get_connection
39
38
  from ..document_base import DocumentBase, DocumentMeta, mapped_field
@@ -42,8 +41,8 @@ from ..utils import DOC_META_FIELDS, META_FIELDS, UsingType, merge
42
41
  from .search import Search
43
42
 
44
43
  if TYPE_CHECKING:
45
- from elasticsearch import Elasticsearch
46
- from elasticsearch.esql.esql import ESQLBase
44
+ from ... import Elasticsearch
45
+ from ...esql.esql import ESQLBase
47
46
 
48
47
 
49
48
  class IndexMeta(DocumentMeta):
@@ -30,7 +30,7 @@ from .update_by_query import UpdateByQuery
30
30
  if TYPE_CHECKING:
31
31
  from elastic_transport import ObjectApiResponse
32
32
 
33
- from elasticsearch import Elasticsearch
33
+ from ... import Elasticsearch
34
34
 
35
35
 
36
36
  class IndexTemplate:
@@ -28,9 +28,8 @@ from typing import (
28
28
 
29
29
  from typing_extensions import Self
30
30
 
31
- from elasticsearch.exceptions import ApiError
32
- from elasticsearch.helpers import scan
33
-
31
+ from ...exceptions import ApiError
32
+ from ...helpers import scan
34
33
  from ..connections import get_connection
35
34
  from ..response import Response
36
35
  from ..search_base import MultiSearchBase, SearchBase