elasticsearch 8.19.1__py3-none-any.whl → 8.19.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 +66 -67
- 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 +2 -2
- elasticsearch/_async/client/cluster.py +10 -9
- elasticsearch/_async/client/connector.py +37 -36
- elasticsearch/_async/client/dangling_indices.py +6 -10
- elasticsearch/_async/client/eql.py +2 -2
- elasticsearch/_async/client/esql.py +1 -1
- elasticsearch/_async/client/features.py +2 -2
- elasticsearch/_async/client/fleet.py +4 -8
- elasticsearch/_async/client/graph.py +1 -5
- elasticsearch/_async/client/ilm.py +2 -10
- elasticsearch/_async/client/indices.py +393 -56
- elasticsearch/_async/client/inference.py +35 -121
- elasticsearch/_async/client/ingest.py +1 -1
- elasticsearch/_async/client/license.py +3 -5
- elasticsearch/_async/client/ml.py +61 -21
- elasticsearch/_async/client/monitoring.py +2 -1
- elasticsearch/_async/client/nodes.py +9 -9
- elasticsearch/_async/client/rollup.py +9 -9
- elasticsearch/_async/client/search_application.py +11 -11
- elasticsearch/_async/client/searchable_snapshots.py +4 -4
- elasticsearch/_async/client/security.py +4 -4
- elasticsearch/_async/client/shutdown.py +12 -17
- elasticsearch/_async/client/simulate.py +2 -2
- elasticsearch/_async/client/slm.py +2 -6
- elasticsearch/_async/client/snapshot.py +3 -2
- elasticsearch/_async/client/streams.py +185 -0
- elasticsearch/_async/client/tasks.py +4 -4
- elasticsearch/_async/client/text_structure.py +5 -1
- elasticsearch/_async/client/transform.py +37 -0
- elasticsearch/_async/client/utils.py +4 -2
- elasticsearch/_async/client/watcher.py +3 -7
- elasticsearch/_async/client/xpack.py +2 -1
- elasticsearch/_async/helpers.py +58 -9
- elasticsearch/_sync/client/__init__.py +68 -67
- 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 +2 -2
- elasticsearch/_sync/client/cluster.py +10 -9
- elasticsearch/_sync/client/connector.py +37 -36
- elasticsearch/_sync/client/dangling_indices.py +6 -10
- elasticsearch/_sync/client/eql.py +2 -2
- elasticsearch/_sync/client/esql.py +1 -1
- elasticsearch/_sync/client/features.py +2 -2
- elasticsearch/_sync/client/fleet.py +4 -8
- elasticsearch/_sync/client/graph.py +1 -5
- elasticsearch/_sync/client/ilm.py +2 -10
- elasticsearch/_sync/client/indices.py +393 -56
- elasticsearch/_sync/client/inference.py +35 -121
- elasticsearch/_sync/client/ingest.py +1 -1
- elasticsearch/_sync/client/license.py +3 -5
- elasticsearch/_sync/client/ml.py +61 -21
- elasticsearch/_sync/client/monitoring.py +2 -1
- elasticsearch/_sync/client/nodes.py +9 -9
- elasticsearch/_sync/client/rollup.py +9 -9
- elasticsearch/_sync/client/search_application.py +11 -11
- elasticsearch/_sync/client/searchable_snapshots.py +4 -4
- elasticsearch/_sync/client/security.py +4 -4
- elasticsearch/_sync/client/shutdown.py +12 -17
- elasticsearch/_sync/client/simulate.py +2 -2
- elasticsearch/_sync/client/slm.py +2 -6
- elasticsearch/_sync/client/snapshot.py +3 -2
- elasticsearch/_sync/client/streams.py +185 -0
- elasticsearch/_sync/client/tasks.py +4 -4
- elasticsearch/_sync/client/text_structure.py +5 -1
- elasticsearch/_sync/client/transform.py +37 -0
- elasticsearch/_sync/client/utils.py +16 -2
- elasticsearch/_sync/client/watcher.py +3 -7
- elasticsearch/_sync/client/xpack.py +2 -1
- elasticsearch/_version.py +2 -1
- elasticsearch/client.py +2 -0
- elasticsearch/compat.py +45 -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 +104 -7
- elasticsearch/dsl/async_connections.py +1 -2
- elasticsearch/dsl/connections.py +1 -2
- elasticsearch/dsl/document_base.py +16 -1
- elasticsearch/dsl/field.py +12 -1
- elasticsearch/dsl/query.py +24 -1
- elasticsearch/dsl/response/__init__.py +3 -0
- elasticsearch/dsl/serializer.py +1 -2
- elasticsearch/dsl/types.py +187 -9
- 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-8.19.1.dist-info → elasticsearch-8.19.3.dist-info}/METADATA +2 -2
- elasticsearch-8.19.3.dist-info/RECORD +166 -0
- {elasticsearch-8.19.1.dist-info → elasticsearch-8.19.3.dist-info}/WHEEL +1 -1
- elasticsearch-8.19.1.dist-info/RECORD +0 -164
- {elasticsearch-8.19.1.dist-info → elasticsearch-8.19.3.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.19.1.dist-info → elasticsearch-8.19.3.dist-info}/licenses/NOTICE +0 -0
|
@@ -75,6 +75,7 @@ from .slm import SlmClient
|
|
|
75
75
|
from .snapshot import SnapshotClient
|
|
76
76
|
from .sql import SqlClient
|
|
77
77
|
from .ssl import SslClient
|
|
78
|
+
from .streams import StreamsClient
|
|
78
79
|
from .synonyms import SynonymsClient
|
|
79
80
|
from .tasks import TasksClient
|
|
80
81
|
from .text_structure import TextStructureClient
|
|
@@ -84,9 +85,9 @@ from .utils import (
|
|
|
84
85
|
CLIENT_META_SERVICE,
|
|
85
86
|
SKIP_IN_PATH,
|
|
86
87
|
Stability,
|
|
88
|
+
_availability_warning,
|
|
87
89
|
_quote,
|
|
88
90
|
_rewrite_parameters,
|
|
89
|
-
_stability_warning,
|
|
90
91
|
client_node_configs,
|
|
91
92
|
is_requests_http_auth,
|
|
92
93
|
is_requests_node_class,
|
|
@@ -470,6 +471,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
470
471
|
self.shutdown = ShutdownClient(self)
|
|
471
472
|
self.sql = SqlClient(self)
|
|
472
473
|
self.ssl = SslClient(self)
|
|
474
|
+
self.streams = StreamsClient(self)
|
|
473
475
|
self.synonyms = SynonymsClient(self)
|
|
474
476
|
self.text_structure = TextStructureClient(self)
|
|
475
477
|
self.transform = TransformClient(self)
|
|
@@ -592,6 +594,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
592
594
|
"""
|
|
593
595
|
__path = "/"
|
|
594
596
|
__query: t.Dict[str, t.Any] = {}
|
|
597
|
+
__path_parts: t.Dict[str, str] = {}
|
|
595
598
|
if error_trace is not None:
|
|
596
599
|
__query["error_trace"] = error_trace
|
|
597
600
|
if filter_path is not None:
|
|
@@ -603,7 +606,12 @@ class AsyncElasticsearch(BaseClient):
|
|
|
603
606
|
__headers = {"accept": "application/json"}
|
|
604
607
|
try:
|
|
605
608
|
await self.perform_request(
|
|
606
|
-
"HEAD",
|
|
609
|
+
"HEAD",
|
|
610
|
+
__path,
|
|
611
|
+
params=__query,
|
|
612
|
+
headers=__headers,
|
|
613
|
+
endpoint_id="ping",
|
|
614
|
+
path_parts=__path_parts,
|
|
607
615
|
)
|
|
608
616
|
return True
|
|
609
617
|
except (ApiError, TransportError):
|
|
@@ -698,6 +706,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
698
706
|
<li>Perl: Check out <code>Search::Elasticsearch::Client::5_0::Bulk</code> and <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
|
|
699
707
|
<li>Python: Check out <code>elasticsearch.helpers.*</code></li>
|
|
700
708
|
<li>JavaScript: Check out <code>client.helpers.*</code></li>
|
|
709
|
+
<li>Java: Check out <code>co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester</code></li>
|
|
701
710
|
<li>.NET: Check out <code>BulkAllObservable</code></li>
|
|
702
711
|
<li>PHP: Check out bulk indexing.</li>
|
|
703
712
|
<li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
|
|
@@ -935,11 +944,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
935
944
|
if not __body:
|
|
936
945
|
if id is not None:
|
|
937
946
|
__body["id"] = id
|
|
938
|
-
|
|
939
|
-
__body = None # type: ignore[assignment]
|
|
940
|
-
__headers = {"accept": "application/json"}
|
|
941
|
-
if __body is not None:
|
|
942
|
-
__headers["content-type"] = "application/json"
|
|
947
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
943
948
|
return await self.perform_request( # type: ignore[return-value]
|
|
944
949
|
"DELETE",
|
|
945
950
|
__path,
|
|
@@ -1012,8 +1017,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1012
1017
|
This parameter can be used only when the `q` query string parameter is specified.
|
|
1013
1018
|
:param analyzer: The analyzer to use for the query string. This parameter can
|
|
1014
1019
|
be used only when the `q` query string parameter is specified.
|
|
1015
|
-
:param default_operator: The default operator for query string query: `
|
|
1016
|
-
`
|
|
1020
|
+
:param default_operator: The default operator for query string query: `and` or
|
|
1021
|
+
`or`. This parameter can be used only when the `q` query string parameter
|
|
1017
1022
|
is specified.
|
|
1018
1023
|
:param df: The field to use as a default when no field prefix is given in the
|
|
1019
1024
|
query string. This parameter can be used only when the `q` query string parameter
|
|
@@ -1134,7 +1139,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1134
1139
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1135
1140
|
version: t.Optional[int] = None,
|
|
1136
1141
|
version_type: t.Optional[
|
|
1137
|
-
t.Union[str, t.Literal["external", "external_gte", "
|
|
1142
|
+
t.Union[str, t.Literal["external", "external_gte", "internal"]]
|
|
1138
1143
|
] = None,
|
|
1139
1144
|
wait_for_active_shards: t.Optional[
|
|
1140
1145
|
t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
|
|
@@ -1313,7 +1318,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1313
1318
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1314
1319
|
version: t.Optional[int] = None,
|
|
1315
1320
|
version_type: t.Optional[
|
|
1316
|
-
t.Union[str, t.Literal["external", "external_gte", "
|
|
1321
|
+
t.Union[str, t.Literal["external", "external_gte", "internal"]]
|
|
1317
1322
|
] = None,
|
|
1318
1323
|
wait_for_active_shards: t.Optional[
|
|
1319
1324
|
t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
|
|
@@ -1558,8 +1563,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1558
1563
|
used only when the `q` query string parameter is specified.
|
|
1559
1564
|
:param conflicts: What to do if delete by query hits version conflicts: `abort`
|
|
1560
1565
|
or `proceed`.
|
|
1561
|
-
:param default_operator: The default operator for query string query: `
|
|
1562
|
-
`
|
|
1566
|
+
:param default_operator: The default operator for query string query: `and` or
|
|
1567
|
+
`or`. This parameter can be used only when the `q` query string parameter
|
|
1563
1568
|
is specified.
|
|
1564
1569
|
:param df: The field to use as default where no field prefix is given in the
|
|
1565
1570
|
query string. This parameter can be used only when the `q` query string parameter
|
|
@@ -1725,11 +1730,11 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1725
1730
|
self,
|
|
1726
1731
|
*,
|
|
1727
1732
|
task_id: t.Union[int, str],
|
|
1733
|
+
requests_per_second: float,
|
|
1728
1734
|
error_trace: t.Optional[bool] = None,
|
|
1729
1735
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1730
1736
|
human: t.Optional[bool] = None,
|
|
1731
1737
|
pretty: t.Optional[bool] = None,
|
|
1732
|
-
requests_per_second: t.Optional[float] = None,
|
|
1733
1738
|
) -> ObjectApiResponse[t.Any]:
|
|
1734
1739
|
"""
|
|
1735
1740
|
.. raw:: html
|
|
@@ -1747,9 +1752,13 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1747
1752
|
"""
|
|
1748
1753
|
if task_id in SKIP_IN_PATH:
|
|
1749
1754
|
raise ValueError("Empty value passed for parameter 'task_id'")
|
|
1755
|
+
if requests_per_second is None:
|
|
1756
|
+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
|
|
1750
1757
|
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
|
|
1751
1758
|
__path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle'
|
|
1752
1759
|
__query: t.Dict[str, t.Any] = {}
|
|
1760
|
+
if requests_per_second is not None:
|
|
1761
|
+
__query["requests_per_second"] = requests_per_second
|
|
1753
1762
|
if error_trace is not None:
|
|
1754
1763
|
__query["error_trace"] = error_trace
|
|
1755
1764
|
if filter_path is not None:
|
|
@@ -1758,8 +1767,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1758
1767
|
__query["human"] = human
|
|
1759
1768
|
if pretty is not None:
|
|
1760
1769
|
__query["pretty"] = pretty
|
|
1761
|
-
if requests_per_second is not None:
|
|
1762
|
-
__query["requests_per_second"] = requests_per_second
|
|
1763
1770
|
__headers = {"accept": "application/json"}
|
|
1764
1771
|
return await self.perform_request( # type: ignore[return-value]
|
|
1765
1772
|
"POST",
|
|
@@ -1853,7 +1860,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1853
1860
|
stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1854
1861
|
version: t.Optional[int] = None,
|
|
1855
1862
|
version_type: t.Optional[
|
|
1856
|
-
t.Union[str, t.Literal["external", "external_gte", "
|
|
1863
|
+
t.Union[str, t.Literal["external", "external_gte", "internal"]]
|
|
1857
1864
|
] = None,
|
|
1858
1865
|
) -> HeadApiResponse:
|
|
1859
1866
|
"""
|
|
@@ -1982,7 +1989,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1982
1989
|
source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1983
1990
|
version: t.Optional[int] = None,
|
|
1984
1991
|
version_type: t.Optional[
|
|
1985
|
-
t.Union[str, t.Literal["external", "external_gte", "
|
|
1992
|
+
t.Union[str, t.Literal["external", "external_gte", "internal"]]
|
|
1986
1993
|
] = None,
|
|
1987
1994
|
) -> HeadApiResponse:
|
|
1988
1995
|
"""
|
|
@@ -2111,8 +2118,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2111
2118
|
This parameter can be used only when the `q` query string parameter is specified.
|
|
2112
2119
|
:param analyzer: The analyzer to use for the query string. This parameter can
|
|
2113
2120
|
be used only when the `q` query string parameter is specified.
|
|
2114
|
-
:param default_operator: The default operator for query string query: `
|
|
2115
|
-
`
|
|
2121
|
+
:param default_operator: The default operator for query string query: `and` or
|
|
2122
|
+
`or`. This parameter can be used only when the `q` query string parameter
|
|
2116
2123
|
is specified.
|
|
2117
2124
|
:param df: The field to use as default where no field prefix is given in the
|
|
2118
2125
|
query string. This parameter can be used only when the `q` query string parameter
|
|
@@ -2354,7 +2361,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2354
2361
|
stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2355
2362
|
version: t.Optional[int] = None,
|
|
2356
2363
|
version_type: t.Optional[
|
|
2357
|
-
t.Union[str, t.Literal["external", "external_gte", "
|
|
2364
|
+
t.Union[str, t.Literal["external", "external_gte", "internal"]]
|
|
2358
2365
|
] = None,
|
|
2359
2366
|
) -> ObjectApiResponse[t.Any]:
|
|
2360
2367
|
"""
|
|
@@ -2641,7 +2648,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2641
2648
|
source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2642
2649
|
version: t.Optional[int] = None,
|
|
2643
2650
|
version_type: t.Optional[
|
|
2644
|
-
t.Union[str, t.Literal["external", "external_gte", "
|
|
2651
|
+
t.Union[str, t.Literal["external", "external_gte", "internal"]]
|
|
2645
2652
|
] = None,
|
|
2646
2653
|
) -> ObjectApiResponse[t.Any]:
|
|
2647
2654
|
"""
|
|
@@ -2821,7 +2828,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2821
2828
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
2822
2829
|
version: t.Optional[int] = None,
|
|
2823
2830
|
version_type: t.Optional[
|
|
2824
|
-
t.Union[str, t.Literal["external", "external_gte", "
|
|
2831
|
+
t.Union[str, t.Literal["external", "external_gte", "internal"]]
|
|
2825
2832
|
] = None,
|
|
2826
2833
|
wait_for_active_shards: t.Optional[
|
|
2827
2834
|
t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
|
|
@@ -3090,7 +3097,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3090
3097
|
),
|
|
3091
3098
|
parameter_aliases={"_source": "source"},
|
|
3092
3099
|
)
|
|
3093
|
-
@
|
|
3100
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
3094
3101
|
async def knn_search(
|
|
3095
3102
|
self,
|
|
3096
3103
|
*,
|
|
@@ -3185,11 +3192,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3185
3192
|
__body["_source"] = source
|
|
3186
3193
|
if stored_fields is not None:
|
|
3187
3194
|
__body["stored_fields"] = stored_fields
|
|
3188
|
-
|
|
3189
|
-
__body = None # type: ignore[assignment]
|
|
3190
|
-
__headers = {"accept": "application/json"}
|
|
3191
|
-
if __body is not None:
|
|
3192
|
-
__headers["content-type"] = "application/json"
|
|
3195
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
3193
3196
|
return await self.perform_request( # type: ignore[return-value]
|
|
3194
3197
|
"POST",
|
|
3195
3198
|
__path,
|
|
@@ -3614,7 +3617,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3614
3617
|
term_statistics: t.Optional[bool] = None,
|
|
3615
3618
|
version: t.Optional[int] = None,
|
|
3616
3619
|
version_type: t.Optional[
|
|
3617
|
-
t.Union[str, t.Literal["external", "external_gte", "
|
|
3620
|
+
t.Union[str, t.Literal["external", "external_gte", "internal"]]
|
|
3618
3621
|
] = None,
|
|
3619
3622
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3620
3623
|
) -> ObjectApiResponse[t.Any]:
|
|
@@ -4024,7 +4027,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4024
4027
|
)
|
|
4025
4028
|
|
|
4026
4029
|
@_rewrite_parameters(
|
|
4027
|
-
body_fields=("dest", "source", "conflicts", "max_docs", "script"
|
|
4030
|
+
body_fields=("dest", "source", "conflicts", "max_docs", "script"),
|
|
4028
4031
|
)
|
|
4029
4032
|
async def reindex(
|
|
4030
4033
|
self,
|
|
@@ -4042,7 +4045,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4042
4045
|
require_alias: t.Optional[bool] = None,
|
|
4043
4046
|
script: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4044
4047
|
scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4045
|
-
size: t.Optional[int] = None,
|
|
4046
4048
|
slices: t.Optional[t.Union[int, t.Union[str, t.Literal["auto"]]]] = None,
|
|
4047
4049
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4048
4050
|
wait_for_active_shards: t.Optional[
|
|
@@ -4214,7 +4216,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4214
4216
|
reindexing.
|
|
4215
4217
|
:param scroll: The period of time that a consistent view of the index should
|
|
4216
4218
|
be maintained for scrolled search.
|
|
4217
|
-
:param size:
|
|
4218
4219
|
:param slices: The number of slices this task should be divided into. It defaults
|
|
4219
4220
|
to one slice, which means the task isn't sliced into subtasks. Reindex supports
|
|
4220
4221
|
sliced scroll to parallelize the reindexing process. This parallelization
|
|
@@ -4279,8 +4280,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4279
4280
|
__body["max_docs"] = max_docs
|
|
4280
4281
|
if script is not None:
|
|
4281
4282
|
__body["script"] = script
|
|
4282
|
-
if size is not None:
|
|
4283
|
-
__body["size"] = size
|
|
4284
4283
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4285
4284
|
return await self.perform_request( # type: ignore[return-value]
|
|
4286
4285
|
"POST",
|
|
@@ -4297,11 +4296,11 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4297
4296
|
self,
|
|
4298
4297
|
*,
|
|
4299
4298
|
task_id: str,
|
|
4299
|
+
requests_per_second: float,
|
|
4300
4300
|
error_trace: t.Optional[bool] = None,
|
|
4301
4301
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
4302
4302
|
human: t.Optional[bool] = None,
|
|
4303
4303
|
pretty: t.Optional[bool] = None,
|
|
4304
|
-
requests_per_second: t.Optional[float] = None,
|
|
4305
4304
|
) -> ObjectApiResponse[t.Any]:
|
|
4306
4305
|
"""
|
|
4307
4306
|
.. raw:: html
|
|
@@ -4325,9 +4324,13 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4325
4324
|
"""
|
|
4326
4325
|
if task_id in SKIP_IN_PATH:
|
|
4327
4326
|
raise ValueError("Empty value passed for parameter 'task_id'")
|
|
4327
|
+
if requests_per_second is None:
|
|
4328
|
+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
|
|
4328
4329
|
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
|
|
4329
4330
|
__path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle'
|
|
4330
4331
|
__query: t.Dict[str, t.Any] = {}
|
|
4332
|
+
if requests_per_second is not None:
|
|
4333
|
+
__query["requests_per_second"] = requests_per_second
|
|
4331
4334
|
if error_trace is not None:
|
|
4332
4335
|
__query["error_trace"] = error_trace
|
|
4333
4336
|
if filter_path is not None:
|
|
@@ -4336,8 +4339,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4336
4339
|
__query["human"] = human
|
|
4337
4340
|
if pretty is not None:
|
|
4338
4341
|
__query["pretty"] = pretty
|
|
4339
|
-
if requests_per_second is not None:
|
|
4340
|
-
__query["requests_per_second"] = requests_per_second
|
|
4341
4342
|
__headers = {"accept": "application/json"}
|
|
4342
4343
|
return await self.perform_request( # type: ignore[return-value]
|
|
4343
4344
|
"POST",
|
|
@@ -4407,11 +4408,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4407
4408
|
__body["params"] = params
|
|
4408
4409
|
if source is not None:
|
|
4409
4410
|
__body["source"] = source
|
|
4410
|
-
|
|
4411
|
-
__body = None # type: ignore[assignment]
|
|
4412
|
-
__headers = {"accept": "application/json"}
|
|
4413
|
-
if __body is not None:
|
|
4414
|
-
__headers["content-type"] = "application/json"
|
|
4411
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4415
4412
|
return await self.perform_request( # type: ignore[return-value]
|
|
4416
4413
|
"POST",
|
|
4417
4414
|
__path,
|
|
@@ -4425,7 +4422,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4425
4422
|
@_rewrite_parameters(
|
|
4426
4423
|
body_fields=("context", "context_setup", "script"),
|
|
4427
4424
|
)
|
|
4428
|
-
@
|
|
4425
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
4429
4426
|
async def scripts_painless_execute(
|
|
4430
4427
|
self,
|
|
4431
4428
|
*,
|
|
@@ -4494,11 +4491,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4494
4491
|
__body["context_setup"] = context_setup
|
|
4495
4492
|
if script is not None:
|
|
4496
4493
|
__body["script"] = script
|
|
4497
|
-
|
|
4498
|
-
__body = None # type: ignore[assignment]
|
|
4499
|
-
__headers = {"accept": "application/json"}
|
|
4500
|
-
if __body is not None:
|
|
4501
|
-
__headers["content-type"] = "application/json"
|
|
4494
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4502
4495
|
return await self.perform_request( # type: ignore[return-value]
|
|
4503
4496
|
"POST",
|
|
4504
4497
|
__path,
|
|
@@ -4774,8 +4767,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4774
4767
|
node and the remote clusters are minimized when running cross-cluster search
|
|
4775
4768
|
(CCS) requests.
|
|
4776
4769
|
:param collapse: Collapses search results the values of the specified field.
|
|
4777
|
-
:param default_operator: The default operator for the query string query: `
|
|
4778
|
-
or `
|
|
4770
|
+
:param default_operator: The default operator for the query string query: `and`
|
|
4771
|
+
or `or`. This parameter can be used only when the `q` query string parameter
|
|
4779
4772
|
is specified.
|
|
4780
4773
|
:param df: The field to use as a default when no field prefix is given in the
|
|
4781
4774
|
query string. This parameter can be used only when the `q` query string parameter
|
|
@@ -5498,11 +5491,19 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5498
5491
|
|
|
5499
5492
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-vector-tile-api.html>`_
|
|
5500
5493
|
|
|
5501
|
-
:param index:
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
:param
|
|
5494
|
+
:param index: A list of indices, data streams, or aliases to search. It supports
|
|
5495
|
+
wildcards (`*`). To search all data streams and indices, omit this parameter
|
|
5496
|
+
or use `*` or `_all`. To search a remote cluster, use the `<cluster>:<target>`
|
|
5497
|
+
syntax.
|
|
5498
|
+
:param field: A field that contains the geospatial data to return. It must be
|
|
5499
|
+
a `geo_point` or `geo_shape` field. The field must have doc values enabled.
|
|
5500
|
+
It cannot be a nested field. NOTE: Vector tiles do not natively support geometry
|
|
5501
|
+
collections. For `geometrycollection` values in a `geo_shape` field, the
|
|
5502
|
+
API returns a hits layer feature for each element of the collection. This
|
|
5503
|
+
behavior may change in a future release.
|
|
5504
|
+
:param zoom: The zoom level of the vector tile to search. It accepts `0` to `29`.
|
|
5505
|
+
:param x: The X coordinate for the vector tile to search.
|
|
5506
|
+
:param y: The Y coordinate for the vector tile to search.
|
|
5506
5507
|
:param aggs: Sub-aggregations for the geotile_grid. It supports the following
|
|
5507
5508
|
aggregation types: - `avg` - `boxplot` - `cardinality` - `extended stats`
|
|
5508
5509
|
- `max` - `median absolute deviation` - `min` - `percentile` - `percentile-rank`
|
|
@@ -5977,11 +5978,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5977
5978
|
__body["string"] = string
|
|
5978
5979
|
if timeout is not None:
|
|
5979
5980
|
__body["timeout"] = timeout
|
|
5980
|
-
|
|
5981
|
-
__body = None # type: ignore[assignment]
|
|
5982
|
-
__headers = {"accept": "application/json"}
|
|
5983
|
-
if __body is not None:
|
|
5984
|
-
__headers["content-type"] = "application/json"
|
|
5981
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
5985
5982
|
return await self.perform_request( # type: ignore[return-value]
|
|
5986
5983
|
"POST",
|
|
5987
5984
|
__path,
|
|
@@ -6031,7 +6028,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6031
6028
|
term_statistics: t.Optional[bool] = None,
|
|
6032
6029
|
version: t.Optional[int] = None,
|
|
6033
6030
|
version_type: t.Optional[
|
|
6034
|
-
t.Union[str, t.Literal["external", "external_gte", "
|
|
6031
|
+
t.Union[str, t.Literal["external", "external_gte", "internal"]]
|
|
6035
6032
|
] = None,
|
|
6036
6033
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
6037
6034
|
) -> ObjectApiResponse[t.Any]:
|
|
@@ -6497,8 +6494,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6497
6494
|
be used only when the `q` query string parameter is specified.
|
|
6498
6495
|
:param conflicts: The preferred behavior when update by query hits version conflicts:
|
|
6499
6496
|
`abort` or `proceed`.
|
|
6500
|
-
:param default_operator: The default operator for query string query: `
|
|
6501
|
-
`
|
|
6497
|
+
:param default_operator: The default operator for query string query: `and` or
|
|
6498
|
+
`or`. This parameter can be used only when the `q` query string parameter
|
|
6502
6499
|
is specified.
|
|
6503
6500
|
:param df: The field to use as default where no field prefix is given in the
|
|
6504
6501
|
query string. This parameter can be used only when the `q` query string parameter
|
|
@@ -6686,11 +6683,11 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6686
6683
|
self,
|
|
6687
6684
|
*,
|
|
6688
6685
|
task_id: str,
|
|
6686
|
+
requests_per_second: float,
|
|
6689
6687
|
error_trace: t.Optional[bool] = None,
|
|
6690
6688
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
6691
6689
|
human: t.Optional[bool] = None,
|
|
6692
6690
|
pretty: t.Optional[bool] = None,
|
|
6693
|
-
requests_per_second: t.Optional[float] = None,
|
|
6694
6691
|
) -> ObjectApiResponse[t.Any]:
|
|
6695
6692
|
"""
|
|
6696
6693
|
.. raw:: html
|
|
@@ -6708,9 +6705,13 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6708
6705
|
"""
|
|
6709
6706
|
if task_id in SKIP_IN_PATH:
|
|
6710
6707
|
raise ValueError("Empty value passed for parameter 'task_id'")
|
|
6708
|
+
if requests_per_second is None:
|
|
6709
|
+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
|
|
6711
6710
|
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
|
|
6712
6711
|
__path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle'
|
|
6713
6712
|
__query: t.Dict[str, t.Any] = {}
|
|
6713
|
+
if requests_per_second is not None:
|
|
6714
|
+
__query["requests_per_second"] = requests_per_second
|
|
6714
6715
|
if error_trace is not None:
|
|
6715
6716
|
__query["error_trace"] = error_trace
|
|
6716
6717
|
if filter_path is not None:
|
|
@@ -6719,8 +6720,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6719
6720
|
__query["human"] = human
|
|
6720
6721
|
if pretty is not None:
|
|
6721
6722
|
__query["pretty"] = pretty
|
|
6722
|
-
if requests_per_second is not None:
|
|
6723
|
-
__query["requests_per_second"] = requests_per_second
|
|
6724
6723
|
__headers = {"accept": "application/json"}
|
|
6725
6724
|
return await self.perform_request( # type: ignore[return-value]
|
|
6726
6725
|
"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/guide/en/elasticsearch/reference/8.19/autoscaling-delete-autoscaling-policy.html>`_
|
|
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/guide/en/elasticsearch/reference/8.19/autoscaling-get-autoscaling-capacity.html>`_
|
|
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/guide/en/elasticsearch/reference/8.19/autoscaling-put-autoscaling-policy.html>`_
|
|
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
|