elasticsearch 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.
- elasticsearch/_async/client/__init__.py +69 -65
- elasticsearch/_async/client/async_search.py +3 -3
- elasticsearch/_async/client/autoscaling.py +8 -4
- elasticsearch/_async/client/cat.py +521 -27
- elasticsearch/_async/client/ccr.py +10 -10
- elasticsearch/_async/client/cluster.py +34 -33
- elasticsearch/_async/client/connector.py +45 -44
- elasticsearch/_async/client/dangling_indices.py +8 -12
- elasticsearch/_async/client/enrich.py +10 -10
- elasticsearch/_async/client/eql.py +10 -10
- elasticsearch/_async/client/esql.py +16 -16
- elasticsearch/_async/client/features.py +6 -6
- elasticsearch/_async/client/fleet.py +8 -12
- elasticsearch/_async/client/graph.py +3 -7
- elasticsearch/_async/client/ilm.py +20 -28
- elasticsearch/_async/client/indices.py +163 -169
- elasticsearch/_async/client/inference.py +41 -127
- elasticsearch/_async/client/ingest.py +9 -9
- elasticsearch/_async/client/license.py +5 -7
- elasticsearch/_async/client/logstash.py +7 -5
- elasticsearch/_async/client/migration.py +6 -6
- elasticsearch/_async/client/ml.py +125 -85
- elasticsearch/_async/client/monitoring.py +4 -3
- elasticsearch/_async/client/nodes.py +17 -17
- elasticsearch/_async/client/query_rules.py +16 -16
- elasticsearch/_async/client/rollup.py +21 -21
- elasticsearch/_async/client/search_application.py +19 -19
- elasticsearch/_async/client/searchable_snapshots.py +10 -10
- elasticsearch/_async/client/security.py +8 -7
- elasticsearch/_async/client/shutdown.py +14 -19
- elasticsearch/_async/client/simulate.py +4 -4
- elasticsearch/_async/client/slm.py +18 -22
- elasticsearch/_async/client/snapshot.py +20 -20
- elasticsearch/_async/client/sql.py +10 -10
- elasticsearch/_async/client/streams.py +186 -0
- elasticsearch/_async/client/synonyms.py +10 -10
- elasticsearch/_async/client/tasks.py +8 -8
- elasticsearch/_async/client/text_structure.py +13 -9
- elasticsearch/_async/client/transform.py +51 -12
- elasticsearch/_async/client/utils.py +4 -2
- elasticsearch/_async/client/watcher.py +27 -31
- elasticsearch/_async/client/xpack.py +6 -5
- elasticsearch/_async/helpers.py +58 -9
- elasticsearch/_sync/client/__init__.py +71 -65
- elasticsearch/_sync/client/async_search.py +3 -3
- elasticsearch/_sync/client/autoscaling.py +8 -4
- elasticsearch/_sync/client/cat.py +521 -27
- elasticsearch/_sync/client/ccr.py +10 -10
- elasticsearch/_sync/client/cluster.py +34 -33
- elasticsearch/_sync/client/connector.py +45 -44
- elasticsearch/_sync/client/dangling_indices.py +8 -12
- elasticsearch/_sync/client/enrich.py +10 -10
- elasticsearch/_sync/client/eql.py +10 -10
- elasticsearch/_sync/client/esql.py +16 -16
- elasticsearch/_sync/client/features.py +6 -6
- elasticsearch/_sync/client/fleet.py +8 -12
- elasticsearch/_sync/client/graph.py +3 -7
- elasticsearch/_sync/client/ilm.py +20 -28
- elasticsearch/_sync/client/indices.py +163 -169
- elasticsearch/_sync/client/inference.py +41 -127
- elasticsearch/_sync/client/ingest.py +9 -9
- elasticsearch/_sync/client/license.py +5 -7
- elasticsearch/_sync/client/logstash.py +7 -5
- elasticsearch/_sync/client/migration.py +6 -6
- elasticsearch/_sync/client/ml.py +125 -85
- elasticsearch/_sync/client/monitoring.py +4 -3
- elasticsearch/_sync/client/nodes.py +17 -17
- elasticsearch/_sync/client/query_rules.py +16 -16
- elasticsearch/_sync/client/rollup.py +21 -21
- elasticsearch/_sync/client/search_application.py +19 -19
- elasticsearch/_sync/client/searchable_snapshots.py +10 -10
- elasticsearch/_sync/client/security.py +8 -7
- elasticsearch/_sync/client/shutdown.py +14 -19
- elasticsearch/_sync/client/simulate.py +4 -4
- elasticsearch/_sync/client/slm.py +18 -22
- elasticsearch/_sync/client/snapshot.py +20 -20
- elasticsearch/_sync/client/sql.py +10 -10
- elasticsearch/_sync/client/streams.py +186 -0
- elasticsearch/_sync/client/synonyms.py +10 -10
- elasticsearch/_sync/client/tasks.py +8 -8
- elasticsearch/_sync/client/text_structure.py +13 -9
- elasticsearch/_sync/client/transform.py +51 -12
- elasticsearch/_sync/client/utils.py +16 -2
- elasticsearch/_sync/client/watcher.py +27 -31
- elasticsearch/_sync/client/xpack.py +6 -5
- elasticsearch/_version.py +2 -1
- elasticsearch/client.py +2 -0
- elasticsearch/compat.py +43 -1
- elasticsearch/dsl/__init__.py +28 -0
- elasticsearch/dsl/_async/document.py +4 -5
- elasticsearch/dsl/_async/index.py +1 -1
- elasticsearch/dsl/_async/search.py +2 -3
- elasticsearch/dsl/_sync/document.py +4 -5
- elasticsearch/dsl/_sync/index.py +1 -1
- elasticsearch/dsl/_sync/search.py +2 -3
- elasticsearch/dsl/aggs.py +100 -3
- elasticsearch/dsl/async_connections.py +1 -2
- elasticsearch/dsl/connections.py +1 -2
- elasticsearch/dsl/document_base.py +15 -0
- elasticsearch/dsl/field.py +12 -1
- elasticsearch/dsl/query.py +23 -0
- elasticsearch/dsl/response/__init__.py +3 -0
- elasticsearch/dsl/serializer.py +1 -2
- elasticsearch/dsl/types.py +185 -5
- elasticsearch/dsl/utils.py +1 -2
- elasticsearch/esql/esql.py +1 -1
- elasticsearch/esql/functions.py +2 -2
- elasticsearch/helpers/__init__.py +10 -1
- elasticsearch/helpers/actions.py +106 -33
- elasticsearch/helpers/vectorstore/__init__.py +7 -7
- elasticsearch/helpers/vectorstore/_async/_utils.py +1 -1
- elasticsearch/helpers/vectorstore/_async/embedding_service.py +2 -2
- elasticsearch/helpers/vectorstore/_async/strategies.py +3 -3
- elasticsearch/helpers/vectorstore/_async/vectorstore.py +5 -5
- elasticsearch/helpers/vectorstore/_sync/_utils.py +1 -1
- elasticsearch/helpers/vectorstore/_sync/embedding_service.py +2 -2
- elasticsearch/helpers/vectorstore/_sync/strategies.py +3 -3
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +5 -5
- {elasticsearch-9.1.1.dist-info → elasticsearch-9.1.3.dist-info}/METADATA +2 -2
- elasticsearch-9.1.3.dist-info/RECORD +165 -0
- {elasticsearch-9.1.1.dist-info → elasticsearch-9.1.3.dist-info}/WHEEL +1 -1
- elasticsearch-9.1.1.dist-info/RECORD +0 -163
- {elasticsearch-9.1.1.dist-info → elasticsearch-9.1.3.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-9.1.1.dist-info → elasticsearch-9.1.3.dist-info}/licenses/NOTICE +0 -0
|
@@ -74,6 +74,7 @@ from .slm import SlmClient
|
|
|
74
74
|
from .snapshot import SnapshotClient
|
|
75
75
|
from .sql import SqlClient
|
|
76
76
|
from .ssl import SslClient
|
|
77
|
+
from .streams import StreamsClient
|
|
77
78
|
from .synonyms import SynonymsClient
|
|
78
79
|
from .tasks import TasksClient
|
|
79
80
|
from .text_structure import TextStructureClient
|
|
@@ -83,9 +84,9 @@ from .utils import (
|
|
|
83
84
|
CLIENT_META_SERVICE,
|
|
84
85
|
SKIP_IN_PATH,
|
|
85
86
|
Stability,
|
|
87
|
+
_availability_warning,
|
|
86
88
|
_quote,
|
|
87
89
|
_rewrite_parameters,
|
|
88
|
-
_stability_warning,
|
|
89
90
|
client_node_configs,
|
|
90
91
|
is_requests_http_auth,
|
|
91
92
|
is_requests_node_class,
|
|
@@ -378,6 +379,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
378
379
|
self.shutdown = ShutdownClient(self)
|
|
379
380
|
self.sql = SqlClient(self)
|
|
380
381
|
self.ssl = SslClient(self)
|
|
382
|
+
self.streams = StreamsClient(self)
|
|
381
383
|
self.synonyms = SynonymsClient(self)
|
|
382
384
|
self.text_structure = TextStructureClient(self)
|
|
383
385
|
self.transform = TransformClient(self)
|
|
@@ -500,6 +502,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
500
502
|
"""
|
|
501
503
|
__path = "/"
|
|
502
504
|
__query: t.Dict[str, t.Any] = {}
|
|
505
|
+
__path_parts: t.Dict[str, str] = {}
|
|
503
506
|
if error_trace is not None:
|
|
504
507
|
__query["error_trace"] = error_trace
|
|
505
508
|
if filter_path is not None:
|
|
@@ -511,7 +514,12 @@ class AsyncElasticsearch(BaseClient):
|
|
|
511
514
|
__headers = {"accept": "application/json"}
|
|
512
515
|
try:
|
|
513
516
|
await self.perform_request(
|
|
514
|
-
"HEAD",
|
|
517
|
+
"HEAD",
|
|
518
|
+
__path,
|
|
519
|
+
params=__query,
|
|
520
|
+
headers=__headers,
|
|
521
|
+
endpoint_id="ping",
|
|
522
|
+
path_parts=__path_parts,
|
|
515
523
|
)
|
|
516
524
|
return True
|
|
517
525
|
except (ApiError, TransportError):
|
|
@@ -557,8 +565,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
557
565
|
"""
|
|
558
566
|
.. raw:: html
|
|
559
567
|
|
|
560
|
-
<p>Bulk index or delete documents
|
|
561
|
-
Perform multiple <code>index</code>, <code>create</code>, <code>delete</code>, and <code>update</code> actions in a single request.
|
|
568
|
+
<p>Bulk index or delete documents.</p>
|
|
569
|
+
<p>Perform multiple <code>index</code>, <code>create</code>, <code>delete</code>, and <code>update</code> actions in a single request.
|
|
562
570
|
This reduces overhead and can greatly increase indexing speed.</p>
|
|
563
571
|
<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>
|
|
564
572
|
<ul>
|
|
@@ -763,8 +771,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
763
771
|
"""
|
|
764
772
|
.. raw:: html
|
|
765
773
|
|
|
766
|
-
<p>Clear a scrolling search
|
|
767
|
-
Clear the search context and results for a scrolling search.</p>
|
|
774
|
+
<p>Clear a scrolling search.</p>
|
|
775
|
+
<p>Clear the search context and results for a scrolling search.</p>
|
|
768
776
|
|
|
769
777
|
|
|
770
778
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-clear-scroll>`_
|
|
@@ -817,8 +825,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
817
825
|
"""
|
|
818
826
|
.. raw:: html
|
|
819
827
|
|
|
820
|
-
<p>Close a point in time
|
|
821
|
-
A point in time must be opened explicitly before being used in search requests.
|
|
828
|
+
<p>Close a point in time.</p>
|
|
829
|
+
<p>A point in time must be opened explicitly before being used in search requests.
|
|
822
830
|
The <code>keep_alive</code> parameter tells Elasticsearch how long it should persist.
|
|
823
831
|
A point in time is automatically closed when the <code>keep_alive</code> period has elapsed.
|
|
824
832
|
However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.</p>
|
|
@@ -845,11 +853,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
845
853
|
if not __body:
|
|
846
854
|
if id is not None:
|
|
847
855
|
__body["id"] = id
|
|
848
|
-
|
|
849
|
-
__body = None # type: ignore[assignment]
|
|
850
|
-
__headers = {"accept": "application/json"}
|
|
851
|
-
if __body is not None:
|
|
852
|
-
__headers["content-type"] = "application/json"
|
|
856
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
853
857
|
return await self.perform_request( # type: ignore[return-value]
|
|
854
858
|
"DELETE",
|
|
855
859
|
__path,
|
|
@@ -898,8 +902,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
898
902
|
"""
|
|
899
903
|
.. raw:: html
|
|
900
904
|
|
|
901
|
-
<p>Count search results
|
|
902
|
-
Get the number of documents matching a query.</p>
|
|
905
|
+
<p>Count search results.</p>
|
|
906
|
+
<p>Get the number of documents matching a query.</p>
|
|
903
907
|
<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.
|
|
904
908
|
The query is optional. When no query is provided, the API uses <code>match_all</code> to count all the documents.</p>
|
|
905
909
|
<p>The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices.</p>
|
|
@@ -1635,11 +1639,11 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1635
1639
|
self,
|
|
1636
1640
|
*,
|
|
1637
1641
|
task_id: str,
|
|
1642
|
+
requests_per_second: float,
|
|
1638
1643
|
error_trace: t.Optional[bool] = None,
|
|
1639
1644
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1640
1645
|
human: t.Optional[bool] = None,
|
|
1641
1646
|
pretty: t.Optional[bool] = None,
|
|
1642
|
-
requests_per_second: t.Optional[float] = None,
|
|
1643
1647
|
) -> ObjectApiResponse[t.Any]:
|
|
1644
1648
|
"""
|
|
1645
1649
|
.. raw:: html
|
|
@@ -1657,9 +1661,13 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1657
1661
|
"""
|
|
1658
1662
|
if task_id in SKIP_IN_PATH:
|
|
1659
1663
|
raise ValueError("Empty value passed for parameter 'task_id'")
|
|
1664
|
+
if requests_per_second is None:
|
|
1665
|
+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
|
|
1660
1666
|
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
|
|
1661
1667
|
__path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle'
|
|
1662
1668
|
__query: t.Dict[str, t.Any] = {}
|
|
1669
|
+
if requests_per_second is not None:
|
|
1670
|
+
__query["requests_per_second"] = requests_per_second
|
|
1663
1671
|
if error_trace is not None:
|
|
1664
1672
|
__query["error_trace"] = error_trace
|
|
1665
1673
|
if filter_path is not None:
|
|
@@ -1668,8 +1676,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1668
1676
|
__query["human"] = human
|
|
1669
1677
|
if pretty is not None:
|
|
1670
1678
|
__query["pretty"] = pretty
|
|
1671
|
-
if requests_per_second is not None:
|
|
1672
|
-
__query["requests_per_second"] = requests_per_second
|
|
1673
1679
|
__headers = {"accept": "application/json"}
|
|
1674
1680
|
return await self.perform_request( # type: ignore[return-value]
|
|
1675
1681
|
"POST",
|
|
@@ -1695,8 +1701,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1695
1701
|
"""
|
|
1696
1702
|
.. raw:: html
|
|
1697
1703
|
|
|
1698
|
-
<p>Delete a script or search template
|
|
1699
|
-
Deletes a stored script or search template.</p>
|
|
1704
|
+
<p>Delete a script or search template.</p>
|
|
1705
|
+
<p>Deletes a stored script or search template.</p>
|
|
1700
1706
|
|
|
1701
1707
|
|
|
1702
1708
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script>`_
|
|
@@ -2007,8 +2013,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2007
2013
|
"""
|
|
2008
2014
|
.. raw:: html
|
|
2009
2015
|
|
|
2010
|
-
<p>Explain a document match result
|
|
2011
|
-
Get information about why a specific document matches, or doesn't match, a query.
|
|
2016
|
+
<p>Explain a document match result.</p>
|
|
2017
|
+
<p>Get information about why a specific document matches, or doesn't match, a query.
|
|
2012
2018
|
It computes a score explanation for a query and a specific document.</p>
|
|
2013
2019
|
|
|
2014
2020
|
|
|
@@ -2411,8 +2417,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2411
2417
|
"""
|
|
2412
2418
|
.. raw:: html
|
|
2413
2419
|
|
|
2414
|
-
<p>Get a script or search template
|
|
2415
|
-
Retrieves a stored script or search template.</p>
|
|
2420
|
+
<p>Get a script or search template.</p>
|
|
2421
|
+
<p>Retrieves a stored script or search template.</p>
|
|
2416
2422
|
|
|
2417
2423
|
|
|
2418
2424
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script>`_
|
|
@@ -2648,8 +2654,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2648
2654
|
"""
|
|
2649
2655
|
.. raw:: html
|
|
2650
2656
|
|
|
2651
|
-
<p>Get the cluster health
|
|
2652
|
-
Get a report with the health status of an Elasticsearch cluster.
|
|
2657
|
+
<p>Get the cluster health.</p>
|
|
2658
|
+
<p>Get a report with the health status of an Elasticsearch cluster.
|
|
2653
2659
|
The report contains a list of indicators that compose Elasticsearch functionality.</p>
|
|
2654
2660
|
<p>Each indicator has a health status of: green, unknown, yellow or red.
|
|
2655
2661
|
The indicator will provide an explanation and metadata describing the reason for its current health status.</p>
|
|
@@ -2820,13 +2826,11 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2820
2826
|
"id": "elkbee"
|
|
2821
2827
|
}
|
|
2822
2828
|
}
|
|
2823
|
-
|
|
2824
|
-
In this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1.
|
|
2825
|
-
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).
|
|
2826
|
-
|
|
2827
|
-
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.
|
|
2828
|
-
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.
|
|
2829
2829
|
</code></pre>
|
|
2830
|
+
<p>In this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1.
|
|
2831
|
+
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>
|
|
2832
|
+
<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.
|
|
2833
|
+
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>
|
|
2830
2834
|
|
|
2831
2835
|
|
|
2832
2836
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create>`_
|
|
@@ -2961,8 +2965,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2961
2965
|
"""
|
|
2962
2966
|
.. raw:: html
|
|
2963
2967
|
|
|
2964
|
-
<p>Get cluster info
|
|
2965
|
-
Get basic build, version, and cluster information.
|
|
2968
|
+
<p>Get cluster info.</p>
|
|
2969
|
+
<p>Get basic build, version, and cluster information.
|
|
2966
2970
|
::: In Serverless, this API is retained for backward compatibility only. Some response fields, such as the version number, should be ignored.</p>
|
|
2967
2971
|
|
|
2968
2972
|
|
|
@@ -3656,8 +3660,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3656
3660
|
"""
|
|
3657
3661
|
.. raw:: html
|
|
3658
3662
|
|
|
3659
|
-
<p>Create or update a script or search template
|
|
3660
|
-
Creates or updates a stored script or search template.</p>
|
|
3663
|
+
<p>Create or update a script or search template.</p>
|
|
3664
|
+
<p>Creates or updates a stored script or search template.</p>
|
|
3661
3665
|
|
|
3662
3666
|
|
|
3663
3667
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-put-script>`_
|
|
@@ -3991,11 +3995,11 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3991
3995
|
self,
|
|
3992
3996
|
*,
|
|
3993
3997
|
task_id: str,
|
|
3998
|
+
requests_per_second: float,
|
|
3994
3999
|
error_trace: t.Optional[bool] = None,
|
|
3995
4000
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
3996
4001
|
human: t.Optional[bool] = None,
|
|
3997
4002
|
pretty: t.Optional[bool] = None,
|
|
3998
|
-
requests_per_second: t.Optional[float] = None,
|
|
3999
4003
|
) -> ObjectApiResponse[t.Any]:
|
|
4000
4004
|
"""
|
|
4001
4005
|
.. raw:: html
|
|
@@ -4019,9 +4023,13 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4019
4023
|
"""
|
|
4020
4024
|
if task_id in SKIP_IN_PATH:
|
|
4021
4025
|
raise ValueError("Empty value passed for parameter 'task_id'")
|
|
4026
|
+
if requests_per_second is None:
|
|
4027
|
+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
|
|
4022
4028
|
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
|
|
4023
4029
|
__path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle'
|
|
4024
4030
|
__query: t.Dict[str, t.Any] = {}
|
|
4031
|
+
if requests_per_second is not None:
|
|
4032
|
+
__query["requests_per_second"] = requests_per_second
|
|
4025
4033
|
if error_trace is not None:
|
|
4026
4034
|
__query["error_trace"] = error_trace
|
|
4027
4035
|
if filter_path is not None:
|
|
@@ -4030,8 +4038,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4030
4038
|
__query["human"] = human
|
|
4031
4039
|
if pretty is not None:
|
|
4032
4040
|
__query["pretty"] = pretty
|
|
4033
|
-
if requests_per_second is not None:
|
|
4034
|
-
__query["requests_per_second"] = requests_per_second
|
|
4035
4041
|
__headers = {"accept": "application/json"}
|
|
4036
4042
|
return await self.perform_request( # type: ignore[return-value]
|
|
4037
4043
|
"POST",
|
|
@@ -4101,11 +4107,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4101
4107
|
__body["params"] = params
|
|
4102
4108
|
if source is not None:
|
|
4103
4109
|
__body["source"] = source
|
|
4104
|
-
|
|
4105
|
-
__body = None # type: ignore[assignment]
|
|
4106
|
-
__headers = {"accept": "application/json"}
|
|
4107
|
-
if __body is not None:
|
|
4108
|
-
__headers["content-type"] = "application/json"
|
|
4110
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4109
4111
|
return await self.perform_request( # type: ignore[return-value]
|
|
4110
4112
|
"POST",
|
|
4111
4113
|
__path,
|
|
@@ -4119,7 +4121,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4119
4121
|
@_rewrite_parameters(
|
|
4120
4122
|
body_fields=("context", "context_setup", "script"),
|
|
4121
4123
|
)
|
|
4122
|
-
@
|
|
4124
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
4123
4125
|
async def scripts_painless_execute(
|
|
4124
4126
|
self,
|
|
4125
4127
|
*,
|
|
@@ -4188,11 +4190,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4188
4190
|
__body["context_setup"] = context_setup
|
|
4189
4191
|
if script is not None:
|
|
4190
4192
|
__body["script"] = script
|
|
4191
|
-
|
|
4192
|
-
__body = None # type: ignore[assignment]
|
|
4193
|
-
__headers = {"accept": "application/json"}
|
|
4194
|
-
if __body is not None:
|
|
4195
|
-
__headers["content-type"] = "application/json"
|
|
4193
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4196
4194
|
return await self.perform_request( # type: ignore[return-value]
|
|
4197
4195
|
"POST",
|
|
4198
4196
|
__path,
|
|
@@ -5144,11 +5142,19 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5144
5142
|
|
|
5145
5143
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-mvt>`_
|
|
5146
5144
|
|
|
5147
|
-
:param index:
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
:param
|
|
5145
|
+
:param index: A list of indices, data streams, or aliases to search. It supports
|
|
5146
|
+
wildcards (`*`). To search all data streams and indices, omit this parameter
|
|
5147
|
+
or use `*` or `_all`. To search a remote cluster, use the `<cluster>:<target>`
|
|
5148
|
+
syntax.
|
|
5149
|
+
:param field: A field that contains the geospatial data to return. It must be
|
|
5150
|
+
a `geo_point` or `geo_shape` field. The field must have doc values enabled.
|
|
5151
|
+
It cannot be a nested field. NOTE: Vector tiles do not natively support geometry
|
|
5152
|
+
collections. For `geometrycollection` values in a `geo_shape` field, the
|
|
5153
|
+
API returns a hits layer feature for each element of the collection. This
|
|
5154
|
+
behavior may change in a future release.
|
|
5155
|
+
:param zoom: The zoom level of the vector tile to search. It accepts `0` to `29`.
|
|
5156
|
+
:param x: The X coordinate for the vector tile to search.
|
|
5157
|
+
:param y: The Y coordinate for the vector tile to search.
|
|
5152
5158
|
:param aggs: Sub-aggregations for the geotile_grid. It supports the following
|
|
5153
5159
|
aggregation types: - `avg` - `boxplot` - `cardinality` - `extended stats`
|
|
5154
5160
|
- `max` - `median absolute deviation` - `min` - `percentile` - `percentile-rank`
|
|
@@ -5623,11 +5629,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5623
5629
|
__body["string"] = string
|
|
5624
5630
|
if timeout is not None:
|
|
5625
5631
|
__body["timeout"] = timeout
|
|
5626
|
-
|
|
5627
|
-
__body = None # type: ignore[assignment]
|
|
5628
|
-
__headers = {"accept": "application/json"}
|
|
5629
|
-
if __body is not None:
|
|
5630
|
-
__headers["content-type"] = "application/json"
|
|
5632
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
5631
5633
|
return await self.perform_request( # type: ignore[return-value]
|
|
5632
5634
|
"POST",
|
|
5633
5635
|
__path,
|
|
@@ -6062,8 +6064,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6062
6064
|
"""
|
|
6063
6065
|
.. raw:: html
|
|
6064
6066
|
|
|
6065
|
-
<p>Update documents
|
|
6066
|
-
Updates documents that match the specified query.
|
|
6067
|
+
<p>Update documents.</p>
|
|
6068
|
+
<p>Updates documents that match the specified query.
|
|
6067
6069
|
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>
|
|
6068
6070
|
<p>If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:</p>
|
|
6069
6071
|
<ul>
|
|
@@ -6342,11 +6344,11 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6342
6344
|
self,
|
|
6343
6345
|
*,
|
|
6344
6346
|
task_id: str,
|
|
6347
|
+
requests_per_second: float,
|
|
6345
6348
|
error_trace: t.Optional[bool] = None,
|
|
6346
6349
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
6347
6350
|
human: t.Optional[bool] = None,
|
|
6348
6351
|
pretty: t.Optional[bool] = None,
|
|
6349
|
-
requests_per_second: t.Optional[float] = None,
|
|
6350
6352
|
) -> ObjectApiResponse[t.Any]:
|
|
6351
6353
|
"""
|
|
6352
6354
|
.. raw:: html
|
|
@@ -6364,9 +6366,13 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6364
6366
|
"""
|
|
6365
6367
|
if task_id in SKIP_IN_PATH:
|
|
6366
6368
|
raise ValueError("Empty value passed for parameter 'task_id'")
|
|
6369
|
+
if requests_per_second is None:
|
|
6370
|
+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
|
|
6367
6371
|
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
|
|
6368
6372
|
__path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle'
|
|
6369
6373
|
__query: t.Dict[str, t.Any] = {}
|
|
6374
|
+
if requests_per_second is not None:
|
|
6375
|
+
__query["requests_per_second"] = requests_per_second
|
|
6370
6376
|
if error_trace is not None:
|
|
6371
6377
|
__query["error_trace"] = error_trace
|
|
6372
6378
|
if filter_path is not None:
|
|
@@ -6375,8 +6381,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6375
6381
|
__query["human"] = human
|
|
6376
6382
|
if pretty is not None:
|
|
6377
6383
|
__query["pretty"] = pretty
|
|
6378
|
-
if requests_per_second is not None:
|
|
6379
|
-
__query["requests_per_second"] = requests_per_second
|
|
6380
6384
|
__headers = {"accept": "application/json"}
|
|
6381
6385
|
return await self.perform_request( # type: ignore[return-value]
|
|
6382
6386
|
"POST",
|
|
@@ -357,7 +357,7 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
357
357
|
:param allow_partial_search_results: Indicate if an error should be returned
|
|
358
358
|
if there is a partial search failure or timeout
|
|
359
359
|
:param analyze_wildcard: Specify whether wildcard and prefix queries should be
|
|
360
|
-
analyzed
|
|
360
|
+
analyzed
|
|
361
361
|
:param analyzer: The analyzer to use for the query string
|
|
362
362
|
:param batched_reduce_size: Affects how often partial results become available,
|
|
363
363
|
which happens whenever shard results are reduced. A partial reduction is
|
|
@@ -373,7 +373,7 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
373
373
|
values for field names matching these patterns in the hits.fields property
|
|
374
374
|
of the response.
|
|
375
375
|
:param expand_wildcards: Whether to expand wildcard expression to concrete indices
|
|
376
|
-
that are open, closed or both
|
|
376
|
+
that are open, closed or both
|
|
377
377
|
:param explain: If true, returns detailed information about score computation
|
|
378
378
|
as part of a hit.
|
|
379
379
|
:param ext: Configuration of search extensions defined by Elasticsearch plugins.
|
|
@@ -406,7 +406,7 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
406
406
|
you cannot specify an <index> in the request path.
|
|
407
407
|
:param post_filter:
|
|
408
408
|
:param preference: Specify the node or shard the operation should be performed
|
|
409
|
-
on
|
|
409
|
+
on
|
|
410
410
|
:param profile:
|
|
411
411
|
:param q: Query in the Lucene query string syntax
|
|
412
412
|
:param query: Defines the search definition using the Query DSL.
|
|
@@ -20,7 +20,11 @@ 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
|
+
_quote,
|
|
26
|
+
_rewrite_parameters,
|
|
27
|
+
)
|
|
24
28
|
|
|
25
29
|
|
|
26
30
|
class AutoscalingClient(NamespacedClient):
|
|
@@ -46,7 +50,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
46
50
|
|
|
47
51
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-delete-autoscaling-policy>`_
|
|
48
52
|
|
|
49
|
-
:param name:
|
|
53
|
+
:param name: Name of the autoscaling policy
|
|
50
54
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
51
55
|
no response is received before the timeout expires, the request fails and
|
|
52
56
|
returns an error.
|
|
@@ -153,7 +157,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
153
157
|
|
|
154
158
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-get-autoscaling-capacity>`_
|
|
155
159
|
|
|
156
|
-
:param name:
|
|
160
|
+
:param name: Name of the autoscaling policy
|
|
157
161
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
158
162
|
no response is received before the timeout expires, the request fails and
|
|
159
163
|
returns an error.
|
|
@@ -208,7 +212,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
208
212
|
|
|
209
213
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-put-autoscaling-policy>`_
|
|
210
214
|
|
|
211
|
-
:param name:
|
|
215
|
+
:param name: Name of the autoscaling policy
|
|
212
216
|
:param policy:
|
|
213
217
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
214
218
|
no response is received before the timeout expires, the request fails and
|