elasticsearch9 9.2.0__py3-none-any.whl → 9.2.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.
- elasticsearch9/_async/client/__init__.py +64 -45
- elasticsearch9/_async/client/async_search.py +3 -3
- elasticsearch9/_async/client/autoscaling.py +15 -4
- elasticsearch9/_async/client/cat.py +40 -2
- elasticsearch9/_async/client/ccr.py +10 -10
- elasticsearch9/_async/client/cluster.py +32 -32
- elasticsearch9/_async/client/connector.py +42 -41
- elasticsearch9/_async/client/dangling_indices.py +8 -12
- elasticsearch9/_async/client/enrich.py +10 -10
- elasticsearch9/_async/client/eql.py +10 -10
- elasticsearch9/_async/client/esql.py +16 -16
- elasticsearch9/_async/client/features.py +6 -6
- elasticsearch9/_async/client/fleet.py +7 -7
- elasticsearch9/_async/client/graph.py +2 -2
- elasticsearch9/_async/client/ilm.py +18 -18
- elasticsearch9/_async/client/indices.py +131 -135
- elasticsearch9/_async/client/inference.py +76 -56
- elasticsearch9/_async/client/ingest.py +9 -9
- elasticsearch9/_async/client/license.py +5 -7
- elasticsearch9/_async/client/logstash.py +4 -4
- elasticsearch9/_async/client/migration.py +6 -6
- elasticsearch9/_async/client/ml.py +125 -85
- elasticsearch9/_async/client/monitoring.py +4 -3
- elasticsearch9/_async/client/nodes.py +15 -15
- elasticsearch9/_async/client/project.py +4 -3
- elasticsearch9/_async/client/query_rules.py +16 -16
- elasticsearch9/_async/client/rollup.py +21 -21
- elasticsearch9/_async/client/search_application.py +19 -19
- elasticsearch9/_async/client/searchable_snapshots.py +10 -10
- elasticsearch9/_async/client/security.py +8 -7
- elasticsearch9/_async/client/shutdown.py +15 -4
- elasticsearch9/_async/client/simulate.py +4 -4
- elasticsearch9/_async/client/slm.py +17 -17
- elasticsearch9/_async/client/snapshot.py +20 -20
- elasticsearch9/_async/client/sql.py +10 -10
- elasticsearch9/_async/client/streams.py +6 -6
- elasticsearch9/_async/client/synonyms.py +10 -10
- elasticsearch9/_async/client/tasks.py +8 -8
- elasticsearch9/_async/client/text_structure.py +13 -9
- elasticsearch9/_async/client/transform.py +51 -12
- elasticsearch9/_async/client/utils.py +4 -2
- elasticsearch9/_async/client/watcher.py +26 -26
- elasticsearch9/_async/client/xpack.py +6 -5
- elasticsearch9/_sync/client/__init__.py +66 -45
- elasticsearch9/_sync/client/async_search.py +3 -3
- elasticsearch9/_sync/client/autoscaling.py +15 -4
- elasticsearch9/_sync/client/cat.py +40 -2
- elasticsearch9/_sync/client/ccr.py +10 -10
- elasticsearch9/_sync/client/cluster.py +32 -32
- elasticsearch9/_sync/client/connector.py +42 -41
- elasticsearch9/_sync/client/dangling_indices.py +8 -12
- elasticsearch9/_sync/client/enrich.py +10 -10
- elasticsearch9/_sync/client/eql.py +10 -10
- elasticsearch9/_sync/client/esql.py +16 -16
- elasticsearch9/_sync/client/features.py +6 -6
- elasticsearch9/_sync/client/fleet.py +7 -7
- elasticsearch9/_sync/client/graph.py +2 -2
- elasticsearch9/_sync/client/ilm.py +18 -18
- elasticsearch9/_sync/client/indices.py +131 -135
- elasticsearch9/_sync/client/inference.py +76 -56
- elasticsearch9/_sync/client/ingest.py +9 -9
- elasticsearch9/_sync/client/license.py +5 -7
- elasticsearch9/_sync/client/logstash.py +4 -4
- elasticsearch9/_sync/client/migration.py +6 -6
- elasticsearch9/_sync/client/ml.py +125 -85
- elasticsearch9/_sync/client/monitoring.py +4 -3
- elasticsearch9/_sync/client/nodes.py +15 -15
- elasticsearch9/_sync/client/project.py +4 -3
- elasticsearch9/_sync/client/query_rules.py +16 -16
- elasticsearch9/_sync/client/rollup.py +21 -21
- elasticsearch9/_sync/client/search_application.py +19 -19
- elasticsearch9/_sync/client/searchable_snapshots.py +10 -10
- elasticsearch9/_sync/client/security.py +8 -7
- elasticsearch9/_sync/client/shutdown.py +15 -4
- elasticsearch9/_sync/client/simulate.py +4 -4
- elasticsearch9/_sync/client/slm.py +17 -17
- elasticsearch9/_sync/client/snapshot.py +20 -20
- elasticsearch9/_sync/client/sql.py +10 -10
- elasticsearch9/_sync/client/streams.py +6 -6
- elasticsearch9/_sync/client/synonyms.py +10 -10
- elasticsearch9/_sync/client/tasks.py +8 -8
- elasticsearch9/_sync/client/text_structure.py +13 -9
- elasticsearch9/_sync/client/transform.py +51 -12
- elasticsearch9/_sync/client/utils.py +16 -2
- elasticsearch9/_sync/client/watcher.py +26 -26
- elasticsearch9/_sync/client/xpack.py +6 -5
- elasticsearch9/_version.py +2 -2
- elasticsearch9/dsl/_async/document.py +4 -5
- elasticsearch9/dsl/_async/index.py +1 -1
- elasticsearch9/dsl/_async/search.py +2 -3
- elasticsearch9/dsl/_sync/document.py +4 -5
- elasticsearch9/dsl/_sync/index.py +1 -1
- elasticsearch9/dsl/_sync/search.py +2 -3
- elasticsearch9/dsl/aggs.py +3 -3
- elasticsearch9/dsl/async_connections.py +1 -2
- elasticsearch9/dsl/connections.py +1 -2
- elasticsearch9/dsl/document_base.py +1 -1
- elasticsearch9/dsl/field.py +1 -1
- elasticsearch9/dsl/pydantic.py +1 -1
- elasticsearch9/dsl/query.py +23 -0
- elasticsearch9/dsl/serializer.py +1 -2
- elasticsearch9/dsl/types.py +2 -6
- elasticsearch9/dsl/utils.py +1 -2
- elasticsearch9/esql/esql.py +1 -1
- elasticsearch9/esql/functions.py +2 -2
- elasticsearch9/helpers/vectorstore/__init__.py +7 -7
- elasticsearch9/helpers/vectorstore/_async/_utils.py +1 -1
- elasticsearch9/helpers/vectorstore/_async/embedding_service.py +2 -2
- elasticsearch9/helpers/vectorstore/_async/strategies.py +3 -3
- elasticsearch9/helpers/vectorstore/_async/vectorstore.py +5 -5
- elasticsearch9/helpers/vectorstore/_sync/_utils.py +1 -1
- elasticsearch9/helpers/vectorstore/_sync/embedding_service.py +2 -2
- elasticsearch9/helpers/vectorstore/_sync/strategies.py +3 -3
- elasticsearch9/helpers/vectorstore/_sync/vectorstore.py +5 -5
- {elasticsearch9-9.2.0.dist-info → elasticsearch9-9.2.1.dist-info}/METADATA +1 -1
- elasticsearch9-9.2.1.dist-info/RECORD +168 -0
- {elasticsearch9-9.2.0.dist-info → elasticsearch9-9.2.1.dist-info}/WHEEL +1 -1
- elasticsearch9-9.2.0.dist-info/RECORD +0 -168
- {elasticsearch9-9.2.0.dist-info → elasticsearch9-9.2.1.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch9-9.2.0.dist-info → elasticsearch9-9.2.1.dist-info}/licenses/NOTICE +0 -0
|
@@ -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.<id>.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:
|
|
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:
|
|
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.
|
|
@@ -591,8 +591,8 @@ class WatcherClient(NamespacedClient):
|
|
|
591
591
|
"""
|
|
592
592
|
.. raw:: html
|
|
593
593
|
|
|
594
|
-
<p>Query watches
|
|
595
|
-
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>
|
|
596
596
|
<p>Note that only the <code>_id</code> and <code>metadata.*</code> fields are queryable or sortable.</p>
|
|
597
597
|
|
|
598
598
|
|
|
@@ -667,8 +667,8 @@ class WatcherClient(NamespacedClient):
|
|
|
667
667
|
"""
|
|
668
668
|
.. raw:: html
|
|
669
669
|
|
|
670
|
-
<p>Start the watch service
|
|
671
|
-
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>
|
|
672
672
|
|
|
673
673
|
|
|
674
674
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-start>`_
|
|
@@ -732,8 +732,8 @@ class WatcherClient(NamespacedClient):
|
|
|
732
732
|
"""
|
|
733
733
|
.. raw:: html
|
|
734
734
|
|
|
735
|
-
<p>Get Watcher statistics
|
|
736
|
-
This API always returns basic metrics.
|
|
735
|
+
<p>Get Watcher statistics.</p>
|
|
736
|
+
<p>This API always returns basic metrics.
|
|
737
737
|
You retrieve more metrics by using the metric parameter.</p>
|
|
738
738
|
|
|
739
739
|
|
|
@@ -784,8 +784,8 @@ class WatcherClient(NamespacedClient):
|
|
|
784
784
|
"""
|
|
785
785
|
.. raw:: html
|
|
786
786
|
|
|
787
|
-
<p>Stop the watch service
|
|
788
|
-
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>
|
|
789
789
|
|
|
790
790
|
|
|
791
791
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-stop>`_
|
|
@@ -840,8 +840,8 @@ class WatcherClient(NamespacedClient):
|
|
|
840
840
|
"""
|
|
841
841
|
.. raw:: html
|
|
842
842
|
|
|
843
|
-
<p>Update Watcher index settings
|
|
844
|
-
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>).
|
|
845
845
|
Only a subset of settings can be modified.
|
|
846
846
|
This includes <code>index.auto_expand_replicas</code>, <code>index.number_of_replicas</code>, <code>index.routing.allocation.exclude.*</code>,
|
|
847
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
|
|
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
|
|
|
@@ -85,9 +85,9 @@ from .utils import (
|
|
|
85
85
|
CLIENT_META_SERVICE,
|
|
86
86
|
SKIP_IN_PATH,
|
|
87
87
|
Stability,
|
|
88
|
+
_availability_warning,
|
|
88
89
|
_quote,
|
|
89
90
|
_rewrite_parameters,
|
|
90
|
-
_stability_warning,
|
|
91
91
|
client_node_configs,
|
|
92
92
|
is_requests_http_auth,
|
|
93
93
|
is_requests_node_class,
|
|
@@ -504,6 +504,7 @@ class Elasticsearch(BaseClient):
|
|
|
504
504
|
"""
|
|
505
505
|
__path = "/"
|
|
506
506
|
__query: t.Dict[str, t.Any] = {}
|
|
507
|
+
__path_parts: t.Dict[str, str] = {}
|
|
507
508
|
if error_trace is not None:
|
|
508
509
|
__query["error_trace"] = error_trace
|
|
509
510
|
if filter_path is not None:
|
|
@@ -514,7 +515,14 @@ class Elasticsearch(BaseClient):
|
|
|
514
515
|
__query["pretty"] = pretty
|
|
515
516
|
__headers = {"accept": "application/json"}
|
|
516
517
|
try:
|
|
517
|
-
self.perform_request(
|
|
518
|
+
self.perform_request(
|
|
519
|
+
"HEAD",
|
|
520
|
+
__path,
|
|
521
|
+
params=__query,
|
|
522
|
+
headers=__headers,
|
|
523
|
+
endpoint_id="ping",
|
|
524
|
+
path_parts=__path_parts,
|
|
525
|
+
)
|
|
518
526
|
return True
|
|
519
527
|
except (ApiError, TransportError):
|
|
520
528
|
return False
|
|
@@ -559,8 +567,8 @@ class Elasticsearch(BaseClient):
|
|
|
559
567
|
"""
|
|
560
568
|
.. raw:: html
|
|
561
569
|
|
|
562
|
-
<p>Bulk index or delete documents
|
|
563
|
-
Perform multiple <code>index</code>, <code>create</code>, <code>delete</code>, and <code>update</code> actions in a single request.
|
|
570
|
+
<p>Bulk index or delete documents.</p>
|
|
571
|
+
<p>Perform multiple <code>index</code>, <code>create</code>, <code>delete</code>, and <code>update</code> actions in a single request.
|
|
564
572
|
This reduces overhead and can greatly increase indexing speed.</p>
|
|
565
573
|
<p>If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias:</p>
|
|
566
574
|
<ul>
|
|
@@ -608,6 +616,7 @@ class Elasticsearch(BaseClient):
|
|
|
608
616
|
<li>Perl: Check out <code>Search::Elasticsearch::Client::5_0::Bulk</code> and <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
|
|
609
617
|
<li>Python: Check out <code>elasticsearch.helpers.*</code></li>
|
|
610
618
|
<li>JavaScript: Check out <code>client.helpers.*</code></li>
|
|
619
|
+
<li>Java: Check out <code>co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester</code></li>
|
|
611
620
|
<li>.NET: Check out <code>BulkAllObservable</code></li>
|
|
612
621
|
<li>PHP: Check out bulk indexing.</li>
|
|
613
622
|
<li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
|
|
@@ -765,8 +774,8 @@ class Elasticsearch(BaseClient):
|
|
|
765
774
|
"""
|
|
766
775
|
.. raw:: html
|
|
767
776
|
|
|
768
|
-
<p>Clear a scrolling search
|
|
769
|
-
Clear the search context and results for a scrolling search.</p>
|
|
777
|
+
<p>Clear a scrolling search.</p>
|
|
778
|
+
<p>Clear the search context and results for a scrolling search.</p>
|
|
770
779
|
|
|
771
780
|
|
|
772
781
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-clear-scroll>`_
|
|
@@ -819,8 +828,8 @@ class Elasticsearch(BaseClient):
|
|
|
819
828
|
"""
|
|
820
829
|
.. raw:: html
|
|
821
830
|
|
|
822
|
-
<p>Close a point in time
|
|
823
|
-
A point in time must be opened explicitly before being used in search requests.
|
|
831
|
+
<p>Close a point in time.</p>
|
|
832
|
+
<p>A point in time must be opened explicitly before being used in search requests.
|
|
824
833
|
The <code>keep_alive</code> parameter tells Elasticsearch how long it should persist.
|
|
825
834
|
A point in time is automatically closed when the <code>keep_alive</code> period has elapsed.
|
|
826
835
|
However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.</p>
|
|
@@ -897,8 +906,8 @@ class Elasticsearch(BaseClient):
|
|
|
897
906
|
"""
|
|
898
907
|
.. raw:: html
|
|
899
908
|
|
|
900
|
-
<p>Count search results
|
|
901
|
-
Get the number of documents matching a query.</p>
|
|
909
|
+
<p>Count search results.</p>
|
|
910
|
+
<p>Get the number of documents matching a query.</p>
|
|
902
911
|
<p>The query can be provided either by using a simple query string as a parameter, or by defining Query DSL within the request body.
|
|
903
912
|
The query is optional. When no query is provided, the API uses <code>match_all</code> to count all the documents.</p>
|
|
904
913
|
<p>The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices.</p>
|
|
@@ -1640,11 +1649,11 @@ class Elasticsearch(BaseClient):
|
|
|
1640
1649
|
self,
|
|
1641
1650
|
*,
|
|
1642
1651
|
task_id: str,
|
|
1652
|
+
requests_per_second: float,
|
|
1643
1653
|
error_trace: t.Optional[bool] = None,
|
|
1644
1654
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1645
1655
|
human: t.Optional[bool] = None,
|
|
1646
1656
|
pretty: t.Optional[bool] = None,
|
|
1647
|
-
requests_per_second: t.Optional[float] = None,
|
|
1648
1657
|
) -> ObjectApiResponse[t.Any]:
|
|
1649
1658
|
"""
|
|
1650
1659
|
.. raw:: html
|
|
@@ -1662,9 +1671,13 @@ class Elasticsearch(BaseClient):
|
|
|
1662
1671
|
"""
|
|
1663
1672
|
if task_id in SKIP_IN_PATH:
|
|
1664
1673
|
raise ValueError("Empty value passed for parameter 'task_id'")
|
|
1674
|
+
if requests_per_second is None:
|
|
1675
|
+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
|
|
1665
1676
|
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
|
|
1666
1677
|
__path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle'
|
|
1667
1678
|
__query: t.Dict[str, t.Any] = {}
|
|
1679
|
+
if requests_per_second is not None:
|
|
1680
|
+
__query["requests_per_second"] = requests_per_second
|
|
1668
1681
|
if error_trace is not None:
|
|
1669
1682
|
__query["error_trace"] = error_trace
|
|
1670
1683
|
if filter_path is not None:
|
|
@@ -1673,8 +1686,6 @@ class Elasticsearch(BaseClient):
|
|
|
1673
1686
|
__query["human"] = human
|
|
1674
1687
|
if pretty is not None:
|
|
1675
1688
|
__query["pretty"] = pretty
|
|
1676
|
-
if requests_per_second is not None:
|
|
1677
|
-
__query["requests_per_second"] = requests_per_second
|
|
1678
1689
|
__headers = {"accept": "application/json"}
|
|
1679
1690
|
return self.perform_request( # type: ignore[return-value]
|
|
1680
1691
|
"POST",
|
|
@@ -1700,8 +1711,8 @@ class Elasticsearch(BaseClient):
|
|
|
1700
1711
|
"""
|
|
1701
1712
|
.. raw:: html
|
|
1702
1713
|
|
|
1703
|
-
<p>Delete a script or search template
|
|
1704
|
-
Deletes a stored script or search template.</p>
|
|
1714
|
+
<p>Delete a script or search template.</p>
|
|
1715
|
+
<p>Deletes a stored script or search template.</p>
|
|
1705
1716
|
|
|
1706
1717
|
|
|
1707
1718
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script>`_
|
|
@@ -2012,8 +2023,8 @@ class Elasticsearch(BaseClient):
|
|
|
2012
2023
|
"""
|
|
2013
2024
|
.. raw:: html
|
|
2014
2025
|
|
|
2015
|
-
<p>Explain a document match result
|
|
2016
|
-
Get information about why a specific document matches, or doesn't match, a query.
|
|
2026
|
+
<p>Explain a document match result.</p>
|
|
2027
|
+
<p>Get information about why a specific document matches, or doesn't match, a query.
|
|
2017
2028
|
It computes a score explanation for a query and a specific document.</p>
|
|
2018
2029
|
|
|
2019
2030
|
|
|
@@ -2429,8 +2440,8 @@ class Elasticsearch(BaseClient):
|
|
|
2429
2440
|
"""
|
|
2430
2441
|
.. raw:: html
|
|
2431
2442
|
|
|
2432
|
-
<p>Get a script or search template
|
|
2433
|
-
Retrieves a stored script or search template.</p>
|
|
2443
|
+
<p>Get a script or search template.</p>
|
|
2444
|
+
<p>Retrieves a stored script or search template.</p>
|
|
2434
2445
|
|
|
2435
2446
|
|
|
2436
2447
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script>`_
|
|
@@ -2666,8 +2677,8 @@ class Elasticsearch(BaseClient):
|
|
|
2666
2677
|
"""
|
|
2667
2678
|
.. raw:: html
|
|
2668
2679
|
|
|
2669
|
-
<p>Get the cluster health
|
|
2670
|
-
Get a report with the health status of an Elasticsearch cluster.
|
|
2680
|
+
<p>Get the cluster health.</p>
|
|
2681
|
+
<p>Get a report with the health status of an Elasticsearch cluster.
|
|
2671
2682
|
The report contains a list of indicators that compose Elasticsearch functionality.</p>
|
|
2672
2683
|
<p>Each indicator has a health status of: green, unknown, yellow or red.
|
|
2673
2684
|
The indicator will provide an explanation and metadata describing the reason for its current health status.</p>
|
|
@@ -2838,13 +2849,11 @@ class Elasticsearch(BaseClient):
|
|
|
2838
2849
|
"id": "elkbee"
|
|
2839
2850
|
}
|
|
2840
2851
|
}
|
|
2841
|
-
|
|
2842
|
-
In this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1.
|
|
2843
|
-
If the document was already updated and its version was set to 2 or higher, the indexing command will fail and result in a conflict (409 HTTP status code).
|
|
2844
|
-
|
|
2845
|
-
A nice side effect is that there is no need to maintain strict ordering of async indexing operations run as a result of changes to a source database, as long as version numbers from the source database are used.
|
|
2846
|
-
Even the simple case of updating the Elasticsearch index using data from a database is simplified if external versioning is used, as only the latest version will be used if the index operations arrive out of order.
|
|
2847
2852
|
</code></pre>
|
|
2853
|
+
<p>In this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1.
|
|
2854
|
+
If the document was already updated and its version was set to 2 or higher, the indexing command will fail and result in a conflict (409 HTTP status code).</p>
|
|
2855
|
+
<p>A nice side effect is that there is no need to maintain strict ordering of async indexing operations run as a result of changes to a source database, as long as version numbers from the source database are used.
|
|
2856
|
+
Even the simple case of updating the Elasticsearch index using data from a database is simplified if external versioning is used, as only the latest version will be used if the index operations arrive out of order.</p>
|
|
2848
2857
|
|
|
2849
2858
|
|
|
2850
2859
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create>`_
|
|
@@ -2979,8 +2988,8 @@ class Elasticsearch(BaseClient):
|
|
|
2979
2988
|
"""
|
|
2980
2989
|
.. raw:: html
|
|
2981
2990
|
|
|
2982
|
-
<p>Get cluster info
|
|
2983
|
-
Get basic build, version, and cluster information.
|
|
2991
|
+
<p>Get cluster info.</p>
|
|
2992
|
+
<p>Get basic build, version, and cluster information.
|
|
2984
2993
|
::: In Serverless, this API is retained for backward compatibility only. Some response fields, such as the version number, should be ignored.</p>
|
|
2985
2994
|
|
|
2986
2995
|
|
|
@@ -3696,8 +3705,8 @@ class Elasticsearch(BaseClient):
|
|
|
3696
3705
|
"""
|
|
3697
3706
|
.. raw:: html
|
|
3698
3707
|
|
|
3699
|
-
<p>Create or update a script or search template
|
|
3700
|
-
Creates or updates a stored script or search template.</p>
|
|
3708
|
+
<p>Create or update a script or search template.</p>
|
|
3709
|
+
<p>Creates or updates a stored script or search template.</p>
|
|
3701
3710
|
|
|
3702
3711
|
|
|
3703
3712
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-put-script>`_
|
|
@@ -4027,11 +4036,11 @@ class Elasticsearch(BaseClient):
|
|
|
4027
4036
|
self,
|
|
4028
4037
|
*,
|
|
4029
4038
|
task_id: str,
|
|
4039
|
+
requests_per_second: float,
|
|
4030
4040
|
error_trace: t.Optional[bool] = None,
|
|
4031
4041
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
4032
4042
|
human: t.Optional[bool] = None,
|
|
4033
4043
|
pretty: t.Optional[bool] = None,
|
|
4034
|
-
requests_per_second: t.Optional[float] = None,
|
|
4035
4044
|
) -> ObjectApiResponse[t.Any]:
|
|
4036
4045
|
"""
|
|
4037
4046
|
.. raw:: html
|
|
@@ -4055,9 +4064,13 @@ class Elasticsearch(BaseClient):
|
|
|
4055
4064
|
"""
|
|
4056
4065
|
if task_id in SKIP_IN_PATH:
|
|
4057
4066
|
raise ValueError("Empty value passed for parameter 'task_id'")
|
|
4067
|
+
if requests_per_second is None:
|
|
4068
|
+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
|
|
4058
4069
|
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
|
|
4059
4070
|
__path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle'
|
|
4060
4071
|
__query: t.Dict[str, t.Any] = {}
|
|
4072
|
+
if requests_per_second is not None:
|
|
4073
|
+
__query["requests_per_second"] = requests_per_second
|
|
4061
4074
|
if error_trace is not None:
|
|
4062
4075
|
__query["error_trace"] = error_trace
|
|
4063
4076
|
if filter_path is not None:
|
|
@@ -4066,8 +4079,6 @@ class Elasticsearch(BaseClient):
|
|
|
4066
4079
|
__query["human"] = human
|
|
4067
4080
|
if pretty is not None:
|
|
4068
4081
|
__query["pretty"] = pretty
|
|
4069
|
-
if requests_per_second is not None:
|
|
4070
|
-
__query["requests_per_second"] = requests_per_second
|
|
4071
4082
|
__headers = {"accept": "application/json"}
|
|
4072
4083
|
return self.perform_request( # type: ignore[return-value]
|
|
4073
4084
|
"POST",
|
|
@@ -4151,7 +4162,7 @@ class Elasticsearch(BaseClient):
|
|
|
4151
4162
|
@_rewrite_parameters(
|
|
4152
4163
|
body_fields=("context", "context_setup", "script"),
|
|
4153
4164
|
)
|
|
4154
|
-
@
|
|
4165
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
4155
4166
|
def scripts_painless_execute(
|
|
4156
4167
|
self,
|
|
4157
4168
|
*,
|
|
@@ -5185,11 +5196,19 @@ class Elasticsearch(BaseClient):
|
|
|
5185
5196
|
|
|
5186
5197
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-mvt>`_
|
|
5187
5198
|
|
|
5188
|
-
:param index:
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
:param
|
|
5199
|
+
:param index: A list of indices, data streams, or aliases to search. It supports
|
|
5200
|
+
wildcards (`*`). To search all data streams and indices, omit this parameter
|
|
5201
|
+
or use `*` or `_all`. To search a remote cluster, use the `<cluster>:<target>`
|
|
5202
|
+
syntax.
|
|
5203
|
+
:param field: A field that contains the geospatial data to return. It must be
|
|
5204
|
+
a `geo_point` or `geo_shape` field. The field must have doc values enabled.
|
|
5205
|
+
It cannot be a nested field. NOTE: Vector tiles do not natively support geometry
|
|
5206
|
+
collections. For `geometrycollection` values in a `geo_shape` field, the
|
|
5207
|
+
API returns a hits layer feature for each element of the collection. This
|
|
5208
|
+
behavior may change in a future release.
|
|
5209
|
+
:param zoom: The zoom level of the vector tile to search. It accepts `0` to `29`.
|
|
5210
|
+
:param x: The X coordinate for the vector tile to search.
|
|
5211
|
+
:param y: The Y coordinate for the vector tile to search.
|
|
5193
5212
|
:param aggs: Sub-aggregations for the geotile_grid. It supports the following
|
|
5194
5213
|
aggregation types: - `avg` - `boxplot` - `cardinality` - `extended stats`
|
|
5195
5214
|
- `max` - `median absolute deviation` - `min` - `percentile` - `percentile-rank`
|
|
@@ -6112,8 +6131,8 @@ class Elasticsearch(BaseClient):
|
|
|
6112
6131
|
"""
|
|
6113
6132
|
.. raw:: html
|
|
6114
6133
|
|
|
6115
|
-
<p>Update documents
|
|
6116
|
-
Updates documents that match the specified query.
|
|
6134
|
+
<p>Update documents.</p>
|
|
6135
|
+
<p>Updates documents that match the specified query.
|
|
6117
6136
|
If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes.</p>
|
|
6118
6137
|
<p>If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:</p>
|
|
6119
6138
|
<ul>
|
|
@@ -6392,11 +6411,11 @@ class Elasticsearch(BaseClient):
|
|
|
6392
6411
|
self,
|
|
6393
6412
|
*,
|
|
6394
6413
|
task_id: str,
|
|
6414
|
+
requests_per_second: float,
|
|
6395
6415
|
error_trace: t.Optional[bool] = None,
|
|
6396
6416
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
6397
6417
|
human: t.Optional[bool] = None,
|
|
6398
6418
|
pretty: t.Optional[bool] = None,
|
|
6399
|
-
requests_per_second: t.Optional[float] = None,
|
|
6400
6419
|
) -> ObjectApiResponse[t.Any]:
|
|
6401
6420
|
"""
|
|
6402
6421
|
.. raw:: html
|
|
@@ -6414,9 +6433,13 @@ class Elasticsearch(BaseClient):
|
|
|
6414
6433
|
"""
|
|
6415
6434
|
if task_id in SKIP_IN_PATH:
|
|
6416
6435
|
raise ValueError("Empty value passed for parameter 'task_id'")
|
|
6436
|
+
if requests_per_second is None:
|
|
6437
|
+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
|
|
6417
6438
|
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
|
|
6418
6439
|
__path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle'
|
|
6419
6440
|
__query: t.Dict[str, t.Any] = {}
|
|
6441
|
+
if requests_per_second is not None:
|
|
6442
|
+
__query["requests_per_second"] = requests_per_second
|
|
6420
6443
|
if error_trace is not None:
|
|
6421
6444
|
__query["error_trace"] = error_trace
|
|
6422
6445
|
if filter_path is not None:
|
|
@@ -6425,8 +6448,6 @@ class Elasticsearch(BaseClient):
|
|
|
6425
6448
|
__query["human"] = human
|
|
6426
6449
|
if pretty is not None:
|
|
6427
6450
|
__query["pretty"] = pretty
|
|
6428
|
-
if requests_per_second is not None:
|
|
6429
|
-
__query["requests_per_second"] = requests_per_second
|
|
6430
6451
|
__headers = {"accept": "application/json"}
|
|
6431
6452
|
return self.perform_request( # type: ignore[return-value]
|
|
6432
6453
|
"POST",
|
|
@@ -358,7 +358,7 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
358
358
|
:param allow_partial_search_results: Indicate if an error should be returned
|
|
359
359
|
if there is a partial search failure or timeout
|
|
360
360
|
:param analyze_wildcard: Specify whether wildcard and prefix queries should be
|
|
361
|
-
analyzed
|
|
361
|
+
analyzed
|
|
362
362
|
:param analyzer: The analyzer to use for the query string
|
|
363
363
|
:param batched_reduce_size: Affects how often partial results become available,
|
|
364
364
|
which happens whenever shard results are reduced. A partial reduction is
|
|
@@ -374,7 +374,7 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
374
374
|
values for field names matching these patterns in the hits.fields property
|
|
375
375
|
of the response.
|
|
376
376
|
:param expand_wildcards: Whether to expand wildcard expression to concrete indices
|
|
377
|
-
that are open, closed or both
|
|
377
|
+
that are open, closed or both
|
|
378
378
|
:param explain: If true, returns detailed information about score computation
|
|
379
379
|
as part of a hit.
|
|
380
380
|
:param ext: Configuration of search extensions defined by Elasticsearch plugins.
|
|
@@ -407,7 +407,7 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
407
407
|
you cannot specify an <index> in the request path.
|
|
408
408
|
:param post_filter:
|
|
409
409
|
:param preference: Specify the node or shard the operation should be performed
|
|
410
|
-
on
|
|
410
|
+
on
|
|
411
411
|
:param profile:
|
|
412
412
|
:param project_routing: Specifies a subset of projects to target for the search
|
|
413
413
|
using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
|
|
@@ -20,12 +20,20 @@ import typing as t
|
|
|
20
20
|
from elastic_transport import ObjectApiResponse
|
|
21
21
|
|
|
22
22
|
from ._base import NamespacedClient
|
|
23
|
-
from .utils import
|
|
23
|
+
from .utils import (
|
|
24
|
+
SKIP_IN_PATH,
|
|
25
|
+
Stability,
|
|
26
|
+
Visibility,
|
|
27
|
+
_availability_warning,
|
|
28
|
+
_quote,
|
|
29
|
+
_rewrite_parameters,
|
|
30
|
+
)
|
|
24
31
|
|
|
25
32
|
|
|
26
33
|
class AutoscalingClient(NamespacedClient):
|
|
27
34
|
|
|
28
35
|
@_rewrite_parameters()
|
|
36
|
+
@_availability_warning(Stability.STABLE, Visibility.PRIVATE)
|
|
29
37
|
def delete_autoscaling_policy(
|
|
30
38
|
self,
|
|
31
39
|
*,
|
|
@@ -46,7 +54,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
46
54
|
|
|
47
55
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-delete-autoscaling-policy>`_
|
|
48
56
|
|
|
49
|
-
:param name:
|
|
57
|
+
:param name: Name of the autoscaling policy
|
|
50
58
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
51
59
|
no response is received before the timeout expires, the request fails and
|
|
52
60
|
returns an error.
|
|
@@ -81,6 +89,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
81
89
|
)
|
|
82
90
|
|
|
83
91
|
@_rewrite_parameters()
|
|
92
|
+
@_availability_warning(Stability.STABLE, Visibility.PRIVATE)
|
|
84
93
|
def get_autoscaling_capacity(
|
|
85
94
|
self,
|
|
86
95
|
*,
|
|
@@ -134,6 +143,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
134
143
|
)
|
|
135
144
|
|
|
136
145
|
@_rewrite_parameters()
|
|
146
|
+
@_availability_warning(Stability.STABLE, Visibility.PRIVATE)
|
|
137
147
|
def get_autoscaling_policy(
|
|
138
148
|
self,
|
|
139
149
|
*,
|
|
@@ -153,7 +163,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
153
163
|
|
|
154
164
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-get-autoscaling-capacity>`_
|
|
155
165
|
|
|
156
|
-
:param name:
|
|
166
|
+
:param name: Name of the autoscaling policy
|
|
157
167
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
158
168
|
no response is received before the timeout expires, the request fails and
|
|
159
169
|
returns an error.
|
|
@@ -186,6 +196,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
186
196
|
@_rewrite_parameters(
|
|
187
197
|
body_name="policy",
|
|
188
198
|
)
|
|
199
|
+
@_availability_warning(Stability.STABLE, Visibility.PRIVATE)
|
|
189
200
|
def put_autoscaling_policy(
|
|
190
201
|
self,
|
|
191
202
|
*,
|
|
@@ -208,7 +219,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
208
219
|
|
|
209
220
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-put-autoscaling-policy>`_
|
|
210
221
|
|
|
211
|
-
:param name:
|
|
222
|
+
:param name: Name of the autoscaling policy
|
|
212
223
|
:param policy:
|
|
213
224
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
214
225
|
no response is received before the timeout expires, the request fails and
|