elasticsearch 8.17.2__py3-none-any.whl → 9.0.0__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 +192 -312
- elasticsearch/_async/client/_base.py +1 -2
- elasticsearch/_async/client/async_search.py +14 -14
- elasticsearch/_async/client/autoscaling.py +4 -4
- elasticsearch/_async/client/cat.py +26 -33
- elasticsearch/_async/client/ccr.py +186 -72
- elasticsearch/_async/client/cluster.py +42 -23
- elasticsearch/_async/client/connector.py +44 -30
- elasticsearch/_async/client/dangling_indices.py +3 -3
- elasticsearch/_async/client/enrich.py +26 -5
- elasticsearch/_async/client/eql.py +32 -4
- elasticsearch/_async/client/esql.py +64 -12
- elasticsearch/_async/client/features.py +12 -2
- elasticsearch/_async/client/fleet.py +23 -19
- elasticsearch/_async/client/graph.py +1 -1
- elasticsearch/_async/client/ilm.py +30 -22
- elasticsearch/_async/client/indices.py +435 -231
- elasticsearch/_async/client/inference.py +1906 -61
- elasticsearch/_async/client/ingest.py +32 -38
- elasticsearch/_async/client/license.py +51 -16
- elasticsearch/_async/client/logstash.py +3 -3
- elasticsearch/_async/client/migration.py +3 -3
- elasticsearch/_async/client/ml.py +145 -121
- elasticsearch/_async/client/monitoring.py +1 -1
- elasticsearch/_async/client/nodes.py +10 -28
- elasticsearch/_async/client/query_rules.py +8 -8
- elasticsearch/_async/client/rollup.py +8 -8
- elasticsearch/_async/client/search_application.py +13 -13
- elasticsearch/_async/client/searchable_snapshots.py +4 -4
- elasticsearch/_async/client/security.py +78 -75
- elasticsearch/_async/client/shutdown.py +3 -10
- elasticsearch/_async/client/simulate.py +6 -6
- elasticsearch/_async/client/slm.py +9 -9
- elasticsearch/_async/client/snapshot.py +280 -134
- elasticsearch/_async/client/sql.py +6 -6
- elasticsearch/_async/client/ssl.py +1 -1
- elasticsearch/_async/client/synonyms.py +7 -7
- elasticsearch/_async/client/tasks.py +3 -9
- elasticsearch/_async/client/text_structure.py +4 -4
- elasticsearch/_async/client/transform.py +30 -28
- elasticsearch/_async/client/watcher.py +23 -15
- elasticsearch/_async/client/xpack.py +2 -2
- elasticsearch/_async/helpers.py +0 -1
- elasticsearch/_sync/client/__init__.py +192 -312
- elasticsearch/_sync/client/_base.py +1 -2
- elasticsearch/_sync/client/async_search.py +14 -14
- elasticsearch/_sync/client/autoscaling.py +4 -4
- elasticsearch/_sync/client/cat.py +26 -33
- elasticsearch/_sync/client/ccr.py +186 -72
- elasticsearch/_sync/client/cluster.py +42 -23
- elasticsearch/_sync/client/connector.py +44 -30
- elasticsearch/_sync/client/dangling_indices.py +3 -3
- elasticsearch/_sync/client/enrich.py +26 -5
- elasticsearch/_sync/client/eql.py +32 -4
- elasticsearch/_sync/client/esql.py +64 -12
- elasticsearch/_sync/client/features.py +12 -2
- elasticsearch/_sync/client/fleet.py +23 -19
- elasticsearch/_sync/client/graph.py +1 -1
- elasticsearch/_sync/client/ilm.py +30 -22
- elasticsearch/_sync/client/indices.py +435 -231
- elasticsearch/_sync/client/inference.py +1906 -61
- elasticsearch/_sync/client/ingest.py +32 -38
- elasticsearch/_sync/client/license.py +51 -16
- elasticsearch/_sync/client/logstash.py +3 -3
- elasticsearch/_sync/client/migration.py +3 -3
- elasticsearch/_sync/client/ml.py +145 -121
- elasticsearch/_sync/client/monitoring.py +1 -1
- elasticsearch/_sync/client/nodes.py +10 -28
- elasticsearch/_sync/client/query_rules.py +8 -8
- elasticsearch/_sync/client/rollup.py +8 -8
- elasticsearch/_sync/client/search_application.py +13 -13
- elasticsearch/_sync/client/searchable_snapshots.py +4 -4
- elasticsearch/_sync/client/security.py +78 -75
- elasticsearch/_sync/client/shutdown.py +3 -10
- elasticsearch/_sync/client/simulate.py +6 -6
- elasticsearch/_sync/client/slm.py +9 -9
- elasticsearch/_sync/client/snapshot.py +280 -134
- elasticsearch/_sync/client/sql.py +6 -6
- elasticsearch/_sync/client/ssl.py +1 -1
- elasticsearch/_sync/client/synonyms.py +7 -7
- elasticsearch/_sync/client/tasks.py +3 -9
- elasticsearch/_sync/client/text_structure.py +4 -4
- elasticsearch/_sync/client/transform.py +30 -28
- elasticsearch/_sync/client/utils.py +0 -40
- elasticsearch/_sync/client/watcher.py +23 -15
- elasticsearch/_sync/client/xpack.py +2 -2
- elasticsearch/_version.py +1 -1
- elasticsearch/dsl/__init__.py +203 -0
- elasticsearch/dsl/_async/__init__.py +16 -0
- elasticsearch/dsl/_async/document.py +522 -0
- elasticsearch/dsl/_async/faceted_search.py +50 -0
- elasticsearch/dsl/_async/index.py +639 -0
- elasticsearch/dsl/_async/mapping.py +49 -0
- elasticsearch/dsl/_async/search.py +237 -0
- elasticsearch/dsl/_async/update_by_query.py +47 -0
- elasticsearch/dsl/_sync/__init__.py +16 -0
- elasticsearch/dsl/_sync/document.py +514 -0
- elasticsearch/dsl/_sync/faceted_search.py +50 -0
- elasticsearch/dsl/_sync/index.py +597 -0
- elasticsearch/dsl/_sync/mapping.py +49 -0
- elasticsearch/dsl/_sync/search.py +230 -0
- elasticsearch/dsl/_sync/update_by_query.py +45 -0
- elasticsearch/dsl/aggs.py +3734 -0
- elasticsearch/dsl/analysis.py +341 -0
- elasticsearch/dsl/async_connections.py +37 -0
- elasticsearch/dsl/connections.py +142 -0
- elasticsearch/dsl/document.py +20 -0
- elasticsearch/dsl/document_base.py +444 -0
- elasticsearch/dsl/exceptions.py +32 -0
- elasticsearch/dsl/faceted_search.py +28 -0
- elasticsearch/dsl/faceted_search_base.py +489 -0
- elasticsearch/dsl/field.py +4392 -0
- elasticsearch/dsl/function.py +180 -0
- elasticsearch/dsl/index.py +23 -0
- elasticsearch/dsl/index_base.py +178 -0
- elasticsearch/dsl/mapping.py +19 -0
- elasticsearch/dsl/mapping_base.py +219 -0
- elasticsearch/dsl/query.py +2822 -0
- elasticsearch/dsl/response/__init__.py +388 -0
- elasticsearch/dsl/response/aggs.py +100 -0
- elasticsearch/dsl/response/hit.py +53 -0
- elasticsearch/dsl/search.py +20 -0
- elasticsearch/dsl/search_base.py +1053 -0
- elasticsearch/dsl/serializer.py +34 -0
- elasticsearch/dsl/types.py +6453 -0
- elasticsearch/dsl/update_by_query.py +19 -0
- elasticsearch/dsl/update_by_query_base.py +149 -0
- elasticsearch/dsl/utils.py +687 -0
- elasticsearch/dsl/wrappers.py +144 -0
- elasticsearch/helpers/vectorstore/_async/strategies.py +12 -12
- elasticsearch/helpers/vectorstore/_sync/strategies.py +12 -12
- {elasticsearch-8.17.2.dist-info → elasticsearch-9.0.0.dist-info}/METADATA +12 -15
- elasticsearch-9.0.0.dist-info/RECORD +160 -0
- elasticsearch/transport.py +0 -57
- elasticsearch-8.17.2.dist-info/RECORD +0 -119
- {elasticsearch-8.17.2.dist-info → elasticsearch-9.0.0.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.2.dist-info → elasticsearch-9.0.0.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.2.dist-info → elasticsearch-9.0.0.dist-info}/licenses/NOTICE +0 -0
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
|
|
19
19
|
import logging
|
|
20
20
|
import typing as t
|
|
21
|
-
import warnings
|
|
22
21
|
|
|
23
22
|
from elastic_transport import (
|
|
24
23
|
AsyncTransport,
|
|
@@ -181,37 +180,13 @@ class AsyncElasticsearch(BaseClient):
|
|
|
181
180
|
t.Callable[[t.Dict[str, t.Any], NodeConfig], t.Optional[NodeConfig]]
|
|
182
181
|
] = None,
|
|
183
182
|
meta_header: t.Union[DefaultType, bool] = DEFAULT,
|
|
184
|
-
timeout: t.Union[DefaultType, None, float] = DEFAULT,
|
|
185
|
-
randomize_hosts: t.Union[DefaultType, bool] = DEFAULT,
|
|
186
|
-
host_info_callback: t.Optional[
|
|
187
|
-
t.Callable[
|
|
188
|
-
[t.Dict[str, t.Any], t.Dict[str, t.Union[str, int]]],
|
|
189
|
-
t.Optional[t.Dict[str, t.Union[str, int]]],
|
|
190
|
-
]
|
|
191
|
-
] = None,
|
|
192
|
-
sniffer_timeout: t.Union[DefaultType, None, float] = DEFAULT,
|
|
193
|
-
sniff_on_connection_fail: t.Union[DefaultType, bool] = DEFAULT,
|
|
194
183
|
http_auth: t.Union[DefaultType, t.Any] = DEFAULT,
|
|
195
|
-
maxsize: t.Union[DefaultType, int] = DEFAULT,
|
|
196
184
|
# Internal use only
|
|
197
185
|
_transport: t.Optional[AsyncTransport] = None,
|
|
198
186
|
) -> None:
|
|
199
187
|
if hosts is None and cloud_id is None and _transport is None:
|
|
200
188
|
raise ValueError("Either 'hosts' or 'cloud_id' must be specified")
|
|
201
189
|
|
|
202
|
-
if timeout is not DEFAULT:
|
|
203
|
-
if request_timeout is not DEFAULT:
|
|
204
|
-
raise ValueError(
|
|
205
|
-
"Can't specify both 'timeout' and 'request_timeout', "
|
|
206
|
-
"instead only specify 'request_timeout'"
|
|
207
|
-
)
|
|
208
|
-
warnings.warn(
|
|
209
|
-
"The 'timeout' parameter is deprecated in favor of 'request_timeout'",
|
|
210
|
-
category=DeprecationWarning,
|
|
211
|
-
stacklevel=2,
|
|
212
|
-
)
|
|
213
|
-
request_timeout = timeout
|
|
214
|
-
|
|
215
190
|
if serializer is not None:
|
|
216
191
|
if serializers is not DEFAULT:
|
|
217
192
|
raise ValueError(
|
|
@@ -220,58 +195,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
220
195
|
)
|
|
221
196
|
serializers = {default_mimetype: serializer}
|
|
222
197
|
|
|
223
|
-
if randomize_hosts is not DEFAULT:
|
|
224
|
-
if randomize_nodes_in_pool is not DEFAULT:
|
|
225
|
-
raise ValueError(
|
|
226
|
-
"Can't specify both 'randomize_hosts' and 'randomize_nodes_in_pool', "
|
|
227
|
-
"instead only specify 'randomize_nodes_in_pool'"
|
|
228
|
-
)
|
|
229
|
-
warnings.warn(
|
|
230
|
-
"The 'randomize_hosts' parameter is deprecated in favor of 'randomize_nodes_in_pool'",
|
|
231
|
-
category=DeprecationWarning,
|
|
232
|
-
stacklevel=2,
|
|
233
|
-
)
|
|
234
|
-
randomize_nodes_in_pool = randomize_hosts
|
|
235
|
-
|
|
236
|
-
if sniffer_timeout is not DEFAULT:
|
|
237
|
-
if min_delay_between_sniffing is not DEFAULT:
|
|
238
|
-
raise ValueError(
|
|
239
|
-
"Can't specify both 'sniffer_timeout' and 'min_delay_between_sniffing', "
|
|
240
|
-
"instead only specify 'min_delay_between_sniffing'"
|
|
241
|
-
)
|
|
242
|
-
warnings.warn(
|
|
243
|
-
"The 'sniffer_timeout' parameter is deprecated in favor of 'min_delay_between_sniffing'",
|
|
244
|
-
category=DeprecationWarning,
|
|
245
|
-
stacklevel=2,
|
|
246
|
-
)
|
|
247
|
-
min_delay_between_sniffing = sniffer_timeout
|
|
248
|
-
|
|
249
|
-
if sniff_on_connection_fail is not DEFAULT:
|
|
250
|
-
if sniff_on_node_failure is not DEFAULT:
|
|
251
|
-
raise ValueError(
|
|
252
|
-
"Can't specify both 'sniff_on_connection_fail' and 'sniff_on_node_failure', "
|
|
253
|
-
"instead only specify 'sniff_on_node_failure'"
|
|
254
|
-
)
|
|
255
|
-
warnings.warn(
|
|
256
|
-
"The 'sniff_on_connection_fail' parameter is deprecated in favor of 'sniff_on_node_failure'",
|
|
257
|
-
category=DeprecationWarning,
|
|
258
|
-
stacklevel=2,
|
|
259
|
-
)
|
|
260
|
-
sniff_on_node_failure = sniff_on_connection_fail
|
|
261
|
-
|
|
262
|
-
if maxsize is not DEFAULT:
|
|
263
|
-
if connections_per_node is not DEFAULT:
|
|
264
|
-
raise ValueError(
|
|
265
|
-
"Can't specify both 'maxsize' and 'connections_per_node', "
|
|
266
|
-
"instead only specify 'connections_per_node'"
|
|
267
|
-
)
|
|
268
|
-
warnings.warn(
|
|
269
|
-
"The 'maxsize' parameter is deprecated in favor of 'connections_per_node'",
|
|
270
|
-
category=DeprecationWarning,
|
|
271
|
-
stacklevel=2,
|
|
272
|
-
)
|
|
273
|
-
connections_per_node = maxsize
|
|
274
|
-
|
|
275
198
|
# Setting min_delay_between_sniffing=True implies sniff_before_requests=True
|
|
276
199
|
if min_delay_between_sniffing is not DEFAULT:
|
|
277
200
|
sniff_before_requests = True
|
|
@@ -293,22 +216,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
293
216
|
)
|
|
294
217
|
|
|
295
218
|
sniff_callback = None
|
|
296
|
-
if
|
|
297
|
-
if sniffed_node_callback is not None:
|
|
298
|
-
raise ValueError(
|
|
299
|
-
"Can't specify both 'host_info_callback' and 'sniffed_node_callback', "
|
|
300
|
-
"instead only specify 'sniffed_node_callback'"
|
|
301
|
-
)
|
|
302
|
-
warnings.warn(
|
|
303
|
-
"The 'host_info_callback' parameter is deprecated in favor of 'sniffed_node_callback'",
|
|
304
|
-
category=DeprecationWarning,
|
|
305
|
-
stacklevel=2,
|
|
306
|
-
)
|
|
307
|
-
|
|
308
|
-
sniff_callback = create_sniff_callback(
|
|
309
|
-
host_info_callback=host_info_callback
|
|
310
|
-
)
|
|
311
|
-
elif sniffed_node_callback is not None:
|
|
219
|
+
if sniffed_node_callback is not None:
|
|
312
220
|
sniff_callback = create_sniff_callback(
|
|
313
221
|
sniffed_node_callback=sniffed_node_callback
|
|
314
222
|
)
|
|
@@ -628,6 +536,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
628
536
|
error_trace: t.Optional[bool] = None,
|
|
629
537
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
630
538
|
human: t.Optional[bool] = None,
|
|
539
|
+
include_source_on_error: t.Optional[bool] = None,
|
|
631
540
|
list_executed_pipelines: t.Optional[bool] = None,
|
|
632
541
|
pipeline: t.Optional[str] = None,
|
|
633
542
|
pretty: t.Optional[bool] = None,
|
|
@@ -730,11 +639,13 @@ class AsyncElasticsearch(BaseClient):
|
|
|
730
639
|
The other two shards that make up the index do not participate in the <code>_bulk</code> request at all.</p>
|
|
731
640
|
|
|
732
641
|
|
|
733
|
-
`<https://www.elastic.co/
|
|
642
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-bulk>`_
|
|
734
643
|
|
|
735
644
|
:param operations:
|
|
736
645
|
:param index: The name of the data stream, index, or index alias to perform bulk
|
|
737
646
|
actions on.
|
|
647
|
+
:param include_source_on_error: True or false if to include the document source
|
|
648
|
+
in the error message in case of parsing errors.
|
|
738
649
|
:param list_executed_pipelines: If `true`, the response will include the ingest
|
|
739
650
|
pipelines that were run for each index or create.
|
|
740
651
|
:param pipeline: The pipeline identifier to use to preprocess incoming documents.
|
|
@@ -792,6 +703,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
792
703
|
__query["filter_path"] = filter_path
|
|
793
704
|
if human is not None:
|
|
794
705
|
__query["human"] = human
|
|
706
|
+
if include_source_on_error is not None:
|
|
707
|
+
__query["include_source_on_error"] = include_source_on_error
|
|
795
708
|
if list_executed_pipelines is not None:
|
|
796
709
|
__query["list_executed_pipelines"] = list_executed_pipelines
|
|
797
710
|
if pipeline is not None:
|
|
@@ -851,7 +764,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
851
764
|
Clear the search context and results for a scrolling search.</p>
|
|
852
765
|
|
|
853
766
|
|
|
854
|
-
`<https://www.elastic.co/
|
|
767
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-clear-scroll>`_
|
|
855
768
|
|
|
856
769
|
:param scroll_id: The scroll IDs to clear. To clear all scroll IDs, use `_all`.
|
|
857
770
|
"""
|
|
@@ -908,7 +821,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
908
821
|
However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.</p>
|
|
909
822
|
|
|
910
823
|
|
|
911
|
-
`<https://www.elastic.co/
|
|
824
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-open-point-in-time>`_
|
|
912
825
|
|
|
913
826
|
:param id: The ID of the point-in-time.
|
|
914
827
|
"""
|
|
@@ -992,7 +905,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
992
905
|
This means that replicas increase the scalability of the count.</p>
|
|
993
906
|
|
|
994
907
|
|
|
995
|
-
`<https://www.elastic.co/
|
|
908
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-count>`_
|
|
996
909
|
|
|
997
910
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
998
911
|
search. It supports wildcards (`*`). To search all data streams and indices,
|
|
@@ -1116,11 +1029,17 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1116
1029
|
error_trace: t.Optional[bool] = None,
|
|
1117
1030
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1118
1031
|
human: t.Optional[bool] = None,
|
|
1032
|
+
if_primary_term: t.Optional[int] = None,
|
|
1033
|
+
if_seq_no: t.Optional[int] = None,
|
|
1034
|
+
include_source_on_error: t.Optional[bool] = None,
|
|
1035
|
+
op_type: t.Optional[t.Union[str, t.Literal["create", "index"]]] = None,
|
|
1119
1036
|
pipeline: t.Optional[str] = None,
|
|
1120
1037
|
pretty: t.Optional[bool] = None,
|
|
1121
1038
|
refresh: t.Optional[
|
|
1122
1039
|
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
1123
1040
|
] = None,
|
|
1041
|
+
require_alias: t.Optional[bool] = None,
|
|
1042
|
+
require_data_stream: t.Optional[bool] = None,
|
|
1124
1043
|
routing: t.Optional[str] = None,
|
|
1125
1044
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1126
1045
|
version: t.Optional[int] = None,
|
|
@@ -1165,7 +1084,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1165
1084
|
This does come at the (very minimal) cost of an additional document parsing pass.
|
|
1166
1085
|
If the <code>_routing</code> mapping is defined and set to be required, the index operation will fail if no routing value is provided or extracted.</p>
|
|
1167
1086
|
<p>NOTE: Data streams do not support custom routing unless they were created with the <code>allow_custom_routing</code> setting enabled in the template.</p>
|
|
1168
|
-
<p
|
|
1087
|
+
<p><strong>Distributed</strong></p>
|
|
1169
1088
|
<p>The index operation is directed to the primary shard based on its route and performed on the actual node containing this shard.
|
|
1170
1089
|
After the primary shard completes the operation, if needed, the update is distributed to applicable replicas.</p>
|
|
1171
1090
|
<p><strong>Active shards</strong></p>
|
|
@@ -1188,7 +1107,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1188
1107
|
The <code>_shards</code> section of the API response reveals the number of shard copies on which replication succeeded and failed.</p>
|
|
1189
1108
|
|
|
1190
1109
|
|
|
1191
|
-
`<https://www.elastic.co/
|
|
1110
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-create>`_
|
|
1192
1111
|
|
|
1193
1112
|
:param index: The name of the data stream or index to target. If the target doesn't
|
|
1194
1113
|
exist and matches the name or wildcard (`*`) pattern of an index template
|
|
@@ -1198,6 +1117,18 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1198
1117
|
:param id: A unique identifier for the document. To automatically generate a
|
|
1199
1118
|
document ID, use the `POST /<target>/_doc/` request format.
|
|
1200
1119
|
:param document:
|
|
1120
|
+
:param if_primary_term: Only perform the operation if the document has this primary
|
|
1121
|
+
term.
|
|
1122
|
+
:param if_seq_no: Only perform the operation if the document has this sequence
|
|
1123
|
+
number.
|
|
1124
|
+
:param include_source_on_error: True or false if to include the document source
|
|
1125
|
+
in the error message in case of parsing errors.
|
|
1126
|
+
:param op_type: Set to `create` to only index the document if it does not already
|
|
1127
|
+
exist (put if absent). If a document with the specified `_id` already exists,
|
|
1128
|
+
the indexing operation will fail. The behavior is the same as using the `<index>/_create`
|
|
1129
|
+
endpoint. If a document ID is specified, this paramater defaults to `index`.
|
|
1130
|
+
Otherwise, it defaults to `create`. If the request targets a data stream,
|
|
1131
|
+
an `op_type` of `create` is required.
|
|
1201
1132
|
:param pipeline: The ID of the pipeline to use to preprocess incoming documents.
|
|
1202
1133
|
If the index has a default ingest pipeline specified, setting the value to
|
|
1203
1134
|
`_none` turns off the default ingest pipeline for this request. If a final
|
|
@@ -1206,6 +1137,9 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1206
1137
|
:param refresh: If `true`, Elasticsearch refreshes the affected shards to make
|
|
1207
1138
|
this operation visible to search. If `wait_for`, it waits for a refresh to
|
|
1208
1139
|
make this operation visible to search. If `false`, it does nothing with refreshes.
|
|
1140
|
+
:param require_alias: If `true`, the destination must be an index alias.
|
|
1141
|
+
:param require_data_stream: If `true`, the request's actions must target a data
|
|
1142
|
+
stream (existing or to be created).
|
|
1209
1143
|
:param routing: A custom value that is used to route operations to a specific
|
|
1210
1144
|
shard.
|
|
1211
1145
|
:param timeout: The period the request waits for the following operations: automatic
|
|
@@ -1246,12 +1180,24 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1246
1180
|
__query["filter_path"] = filter_path
|
|
1247
1181
|
if human is not None:
|
|
1248
1182
|
__query["human"] = human
|
|
1183
|
+
if if_primary_term is not None:
|
|
1184
|
+
__query["if_primary_term"] = if_primary_term
|
|
1185
|
+
if if_seq_no is not None:
|
|
1186
|
+
__query["if_seq_no"] = if_seq_no
|
|
1187
|
+
if include_source_on_error is not None:
|
|
1188
|
+
__query["include_source_on_error"] = include_source_on_error
|
|
1189
|
+
if op_type is not None:
|
|
1190
|
+
__query["op_type"] = op_type
|
|
1249
1191
|
if pipeline is not None:
|
|
1250
1192
|
__query["pipeline"] = pipeline
|
|
1251
1193
|
if pretty is not None:
|
|
1252
1194
|
__query["pretty"] = pretty
|
|
1253
1195
|
if refresh is not None:
|
|
1254
1196
|
__query["refresh"] = refresh
|
|
1197
|
+
if require_alias is not None:
|
|
1198
|
+
__query["require_alias"] = require_alias
|
|
1199
|
+
if require_data_stream is not None:
|
|
1200
|
+
__query["require_data_stream"] = require_data_stream
|
|
1255
1201
|
if routing is not None:
|
|
1256
1202
|
__query["routing"] = routing
|
|
1257
1203
|
if timeout is not None:
|
|
@@ -1328,7 +1274,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1328
1274
|
It then gets redirected into the primary shard within that ID group and replicated (if needed) to shard replicas within that ID group.</p>
|
|
1329
1275
|
|
|
1330
1276
|
|
|
1331
|
-
`<https://www.elastic.co/
|
|
1277
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-delete>`_
|
|
1332
1278
|
|
|
1333
1279
|
:param index: The name of the target index.
|
|
1334
1280
|
:param id: A unique identifier for the document.
|
|
@@ -1517,7 +1463,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1517
1463
|
The get task status API will continue to list the delete by query task until this task checks that it has been cancelled and terminates itself.</p>
|
|
1518
1464
|
|
|
1519
1465
|
|
|
1520
|
-
`<https://www.elastic.co/
|
|
1466
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-delete-by-query>`_
|
|
1521
1467
|
|
|
1522
1468
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
1523
1469
|
search. It supports wildcards (`*`). To search all data streams or indices,
|
|
@@ -1543,7 +1489,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1543
1489
|
If the request can target data streams, this argument determines whether
|
|
1544
1490
|
wildcard expressions match hidden data streams. It supports comma-separated
|
|
1545
1491
|
values, such as `open,hidden`.
|
|
1546
|
-
:param from_:
|
|
1492
|
+
:param from_: Skips the specified number of documents.
|
|
1547
1493
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
1548
1494
|
a missing or closed index.
|
|
1549
1495
|
:param lenient: If `true`, format-based query failures (such as providing text
|
|
@@ -1714,7 +1660,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1714
1660
|
Rethrottling that speeds up the query takes effect immediately but rethrotting that slows down the query takes effect after completing the current batch to prevent scroll timeouts.</p>
|
|
1715
1661
|
|
|
1716
1662
|
|
|
1717
|
-
`<https://www.elastic.co/
|
|
1663
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-delete-by-query-rethrottle>`_
|
|
1718
1664
|
|
|
1719
1665
|
:param task_id: The ID for the task.
|
|
1720
1666
|
:param requests_per_second: The throttle for this request in sub-requests per
|
|
@@ -1764,7 +1710,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1764
1710
|
Deletes a stored script or search template.</p>
|
|
1765
1711
|
|
|
1766
1712
|
|
|
1767
|
-
`<https://www.elastic.co/
|
|
1713
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-delete-script>`_
|
|
1768
1714
|
|
|
1769
1715
|
:param id: The identifier for the stored script or search template.
|
|
1770
1716
|
:param master_timeout: The period to wait for a connection to the master node.
|
|
@@ -1848,7 +1794,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1848
1794
|
Elasticsearch cleans up deleted documents in the background as you continue to index more data.</p>
|
|
1849
1795
|
|
|
1850
1796
|
|
|
1851
|
-
`<https://www.elastic.co/
|
|
1797
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get>`_
|
|
1852
1798
|
|
|
1853
1799
|
:param index: A comma-separated list of data streams, indices, and aliases. It
|
|
1854
1800
|
supports wildcards (`*`).
|
|
@@ -1971,7 +1917,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1971
1917
|
<p>A document's source is not available if it is disabled in the mapping.</p>
|
|
1972
1918
|
|
|
1973
1919
|
|
|
1974
|
-
`<https://www.elastic.co/
|
|
1920
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get>`_
|
|
1975
1921
|
|
|
1976
1922
|
:param index: A comma-separated list of data streams, indices, and aliases. It
|
|
1977
1923
|
supports wildcards (`*`).
|
|
@@ -2077,7 +2023,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2077
2023
|
It computes a score explanation for a query and a specific document.</p>
|
|
2078
2024
|
|
|
2079
2025
|
|
|
2080
|
-
`<https://www.elastic.co/
|
|
2026
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-explain>`_
|
|
2081
2027
|
|
|
2082
2028
|
:param index: Index names that are used to limit the request. Only a single index
|
|
2083
2029
|
name can be provided to this parameter.
|
|
@@ -2212,7 +2158,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2212
2158
|
For example, a runtime field with a type of keyword is returned the same as any other field that belongs to the <code>keyword</code> family.</p>
|
|
2213
2159
|
|
|
2214
2160
|
|
|
2215
|
-
`<https://www.elastic.co/
|
|
2161
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-field-caps>`_
|
|
2216
2162
|
|
|
2217
2163
|
:param index: A comma-separated list of data streams, indices, and aliases used
|
|
2218
2164
|
to limit the request. Supports wildcards (*). To target all data streams
|
|
@@ -2373,7 +2319,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2373
2319
|
Elasticsearch cleans up deleted documents in the background as you continue to index more data.</p>
|
|
2374
2320
|
|
|
2375
2321
|
|
|
2376
|
-
`<https://www.elastic.co/
|
|
2322
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get>`_
|
|
2377
2323
|
|
|
2378
2324
|
:param index: The name of the index that contains the document.
|
|
2379
2325
|
:param id: A unique document identifier.
|
|
@@ -2480,7 +2426,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2480
2426
|
Retrieves a stored script or search template.</p>
|
|
2481
2427
|
|
|
2482
2428
|
|
|
2483
|
-
`<https://www.elastic.co/
|
|
2429
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get-script>`_
|
|
2484
2430
|
|
|
2485
2431
|
:param id: The identifier for the stored script or search template.
|
|
2486
2432
|
:param master_timeout: The period to wait for the master node. If the master
|
|
@@ -2529,7 +2475,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2529
2475
|
<p>Get a list of supported script contexts and their methods.</p>
|
|
2530
2476
|
|
|
2531
2477
|
|
|
2532
|
-
`<https://www.elastic.co/
|
|
2478
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get-script-context>`_
|
|
2533
2479
|
"""
|
|
2534
2480
|
__path_parts: t.Dict[str, str] = {}
|
|
2535
2481
|
__path = "/_script_context"
|
|
@@ -2568,7 +2514,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2568
2514
|
<p>Get a list of available script types, languages, and contexts.</p>
|
|
2569
2515
|
|
|
2570
2516
|
|
|
2571
|
-
`<https://www.elastic.co/
|
|
2517
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get-script-languages>`_
|
|
2572
2518
|
"""
|
|
2573
2519
|
__path_parts: t.Dict[str, str] = {}
|
|
2574
2520
|
__path = "/_script_language"
|
|
@@ -2633,7 +2579,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2633
2579
|
</code></pre>
|
|
2634
2580
|
|
|
2635
2581
|
|
|
2636
|
-
`<https://www.elastic.co/
|
|
2582
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get>`_
|
|
2637
2583
|
|
|
2638
2584
|
:param index: The name of the index that contains the document.
|
|
2639
2585
|
:param id: A unique document identifier.
|
|
@@ -2733,7 +2679,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2733
2679
|
When setting up automated polling of the API for health status, set verbose to false to disable the more expensive analysis logic.</p>
|
|
2734
2680
|
|
|
2735
2681
|
|
|
2736
|
-
`<https://www.elastic.co/
|
|
2682
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-health-report>`_
|
|
2737
2683
|
|
|
2738
2684
|
:param feature: A feature of the cluster, as returned by the top-level health
|
|
2739
2685
|
report API.
|
|
@@ -2788,6 +2734,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2788
2734
|
human: t.Optional[bool] = None,
|
|
2789
2735
|
if_primary_term: t.Optional[int] = None,
|
|
2790
2736
|
if_seq_no: t.Optional[int] = None,
|
|
2737
|
+
include_source_on_error: t.Optional[bool] = None,
|
|
2791
2738
|
op_type: t.Optional[t.Union[str, t.Literal["create", "index"]]] = None,
|
|
2792
2739
|
pipeline: t.Optional[str] = None,
|
|
2793
2740
|
pretty: t.Optional[bool] = None,
|
|
@@ -2844,9 +2791,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2844
2791
|
This does come at the (very minimal) cost of an additional document parsing pass.
|
|
2845
2792
|
If the <code>_routing</code> mapping is defined and set to be required, the index operation will fail if no routing value is provided or extracted.</p>
|
|
2846
2793
|
<p>NOTE: Data streams do not support custom routing unless they were created with the <code>allow_custom_routing</code> setting enabled in the template.</p>
|
|
2847
|
-
<
|
|
2848
|
-
<li>** Distributed**</li>
|
|
2849
|
-
</ul>
|
|
2794
|
+
<p><strong>Distributed</strong></p>
|
|
2850
2795
|
<p>The index operation is directed to the primary shard based on its route and performed on the actual node containing this shard.
|
|
2851
2796
|
After the primary shard completes the operation, if needed, the update is distributed to applicable replicas.</p>
|
|
2852
2797
|
<p><strong>Active shards</strong></p>
|
|
@@ -2899,7 +2844,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2899
2844
|
</code></pre>
|
|
2900
2845
|
|
|
2901
2846
|
|
|
2902
|
-
`<https://www.elastic.co/
|
|
2847
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-create>`_
|
|
2903
2848
|
|
|
2904
2849
|
:param index: The name of the data stream or index to target. If the target doesn't
|
|
2905
2850
|
exist and matches the name or wildcard (`*`) pattern of an index template
|
|
@@ -2915,6 +2860,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2915
2860
|
term.
|
|
2916
2861
|
:param if_seq_no: Only perform the operation if the document has this sequence
|
|
2917
2862
|
number.
|
|
2863
|
+
:param include_source_on_error: True or false if to include the document source
|
|
2864
|
+
in the error message in case of parsing errors.
|
|
2918
2865
|
:param op_type: Set to `create` to only index the document if it does not already
|
|
2919
2866
|
exist (put if absent). If a document with the specified `_id` already exists,
|
|
2920
2867
|
the indexing operation will fail. The behavior is the same as using the `<index>/_create`
|
|
@@ -2979,6 +2926,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2979
2926
|
__query["if_primary_term"] = if_primary_term
|
|
2980
2927
|
if if_seq_no is not None:
|
|
2981
2928
|
__query["if_seq_no"] = if_seq_no
|
|
2929
|
+
if include_source_on_error is not None:
|
|
2930
|
+
__query["include_source_on_error"] = include_source_on_error
|
|
2982
2931
|
if op_type is not None:
|
|
2983
2932
|
__query["op_type"] = op_type
|
|
2984
2933
|
if pipeline is not None:
|
|
@@ -3027,7 +2976,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3027
2976
|
Get basic build, version, and cluster information.</p>
|
|
3028
2977
|
|
|
3029
2978
|
|
|
3030
|
-
`<https://www.elastic.co/
|
|
2979
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/group/endpoint-info>`_
|
|
3031
2980
|
"""
|
|
3032
2981
|
__path_parts: t.Dict[str, str] = {}
|
|
3033
2982
|
__path = "/"
|
|
@@ -3050,127 +2999,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3050
2999
|
path_parts=__path_parts,
|
|
3051
3000
|
)
|
|
3052
3001
|
|
|
3053
|
-
@_rewrite_parameters(
|
|
3054
|
-
body_fields=(
|
|
3055
|
-
"knn",
|
|
3056
|
-
"docvalue_fields",
|
|
3057
|
-
"fields",
|
|
3058
|
-
"filter",
|
|
3059
|
-
"source",
|
|
3060
|
-
"stored_fields",
|
|
3061
|
-
),
|
|
3062
|
-
parameter_aliases={"_source": "source"},
|
|
3063
|
-
)
|
|
3064
|
-
@_stability_warning(Stability.EXPERIMENTAL)
|
|
3065
|
-
async def knn_search(
|
|
3066
|
-
self,
|
|
3067
|
-
*,
|
|
3068
|
-
index: t.Union[str, t.Sequence[str]],
|
|
3069
|
-
knn: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
3070
|
-
docvalue_fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
3071
|
-
error_trace: t.Optional[bool] = None,
|
|
3072
|
-
fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
3073
|
-
filter: t.Optional[
|
|
3074
|
-
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
|
|
3075
|
-
] = None,
|
|
3076
|
-
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
3077
|
-
human: t.Optional[bool] = None,
|
|
3078
|
-
pretty: t.Optional[bool] = None,
|
|
3079
|
-
routing: t.Optional[str] = None,
|
|
3080
|
-
source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None,
|
|
3081
|
-
stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
3082
|
-
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3083
|
-
) -> ObjectApiResponse[t.Any]:
|
|
3084
|
-
"""
|
|
3085
|
-
.. raw:: html
|
|
3086
|
-
|
|
3087
|
-
<p>Run a knn search.</p>
|
|
3088
|
-
<p>NOTE: The kNN search API has been replaced by the <code>knn</code> option in the search API.</p>
|
|
3089
|
-
<p>Perform a k-nearest neighbor (kNN) search on a dense_vector field and return the matching documents.
|
|
3090
|
-
Given a query vector, the API finds the k closest vectors and returns those documents as search hits.</p>
|
|
3091
|
-
<p>Elasticsearch uses the HNSW algorithm to support efficient kNN search.
|
|
3092
|
-
Like most kNN algorithms, HNSW is an approximate method that sacrifices result accuracy for improved search speed.
|
|
3093
|
-
This means the results returned are not always the true k closest neighbors.</p>
|
|
3094
|
-
<p>The kNN search API supports restricting the search using a filter.
|
|
3095
|
-
The search will return the top k documents that also match the filter query.</p>
|
|
3096
|
-
<p>A kNN search response has the exact same structure as a search API response.
|
|
3097
|
-
However, certain sections have a meaning specific to kNN search:</p>
|
|
3098
|
-
<ul>
|
|
3099
|
-
<li>The document <code>_score</code> is determined by the similarity between the query and document vector.</li>
|
|
3100
|
-
<li>The <code>hits.total</code> object contains the total number of nearest neighbor candidates considered, which is <code>num_candidates * num_shards</code>. The <code>hits.total.relation</code> will always be <code>eq</code>, indicating an exact value.</li>
|
|
3101
|
-
</ul>
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/knn-search-api.html>`_
|
|
3105
|
-
|
|
3106
|
-
:param index: A comma-separated list of index names to search; use `_all` or
|
|
3107
|
-
to perform the operation on all indices.
|
|
3108
|
-
:param knn: The kNN query to run.
|
|
3109
|
-
:param docvalue_fields: The request returns doc values for field names matching
|
|
3110
|
-
these patterns in the `hits.fields` property of the response. It accepts
|
|
3111
|
-
wildcard (`*`) patterns.
|
|
3112
|
-
:param fields: The request returns values for field names matching these patterns
|
|
3113
|
-
in the `hits.fields` property of the response. It accepts wildcard (`*`)
|
|
3114
|
-
patterns.
|
|
3115
|
-
:param filter: A query to filter the documents that can match. The kNN search
|
|
3116
|
-
will return the top `k` documents that also match this filter. The value
|
|
3117
|
-
can be a single query or a list of queries. If `filter` isn't provided, all
|
|
3118
|
-
documents are allowed to match.
|
|
3119
|
-
:param routing: A comma-separated list of specific routing values.
|
|
3120
|
-
:param source: Indicates which source fields are returned for matching documents.
|
|
3121
|
-
These fields are returned in the `hits._source` property of the search response.
|
|
3122
|
-
:param stored_fields: A list of stored fields to return as part of a hit. If
|
|
3123
|
-
no fields are specified, no stored fields are included in the response. If
|
|
3124
|
-
this field is specified, the `_source` parameter defaults to `false`. You
|
|
3125
|
-
can pass `_source: true` to return both source fields and stored fields in
|
|
3126
|
-
the search response.
|
|
3127
|
-
"""
|
|
3128
|
-
if index in SKIP_IN_PATH:
|
|
3129
|
-
raise ValueError("Empty value passed for parameter 'index'")
|
|
3130
|
-
if knn is None and body is None:
|
|
3131
|
-
raise ValueError("Empty value passed for parameter 'knn'")
|
|
3132
|
-
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
3133
|
-
__path = f'/{__path_parts["index"]}/_knn_search'
|
|
3134
|
-
__query: t.Dict[str, t.Any] = {}
|
|
3135
|
-
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3136
|
-
if error_trace is not None:
|
|
3137
|
-
__query["error_trace"] = error_trace
|
|
3138
|
-
if filter_path is not None:
|
|
3139
|
-
__query["filter_path"] = filter_path
|
|
3140
|
-
if human is not None:
|
|
3141
|
-
__query["human"] = human
|
|
3142
|
-
if pretty is not None:
|
|
3143
|
-
__query["pretty"] = pretty
|
|
3144
|
-
if routing is not None:
|
|
3145
|
-
__query["routing"] = routing
|
|
3146
|
-
if not __body:
|
|
3147
|
-
if knn is not None:
|
|
3148
|
-
__body["knn"] = knn
|
|
3149
|
-
if docvalue_fields is not None:
|
|
3150
|
-
__body["docvalue_fields"] = docvalue_fields
|
|
3151
|
-
if fields is not None:
|
|
3152
|
-
__body["fields"] = fields
|
|
3153
|
-
if filter is not None:
|
|
3154
|
-
__body["filter"] = filter
|
|
3155
|
-
if source is not None:
|
|
3156
|
-
__body["_source"] = source
|
|
3157
|
-
if stored_fields is not None:
|
|
3158
|
-
__body["stored_fields"] = stored_fields
|
|
3159
|
-
if not __body:
|
|
3160
|
-
__body = None # type: ignore[assignment]
|
|
3161
|
-
__headers = {"accept": "application/json"}
|
|
3162
|
-
if __body is not None:
|
|
3163
|
-
__headers["content-type"] = "application/json"
|
|
3164
|
-
return await self.perform_request( # type: ignore[return-value]
|
|
3165
|
-
"POST",
|
|
3166
|
-
__path,
|
|
3167
|
-
params=__query,
|
|
3168
|
-
headers=__headers,
|
|
3169
|
-
body=__body,
|
|
3170
|
-
endpoint_id="knn_search",
|
|
3171
|
-
path_parts=__path_parts,
|
|
3172
|
-
)
|
|
3173
|
-
|
|
3174
3002
|
@_rewrite_parameters(
|
|
3175
3003
|
body_fields=("docs", "ids"),
|
|
3176
3004
|
parameter_aliases={
|
|
@@ -3217,7 +3045,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3217
3045
|
You can include the <code>stored_fields</code> query parameter in the request URI to specify the defaults to use when there are no per-document instructions.</p>
|
|
3218
3046
|
|
|
3219
3047
|
|
|
3220
|
-
`<https://www.elastic.co/
|
|
3048
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-mget>`_
|
|
3221
3049
|
|
|
3222
3050
|
:param index: Name of the index to retrieve documents from when `ids` are specified,
|
|
3223
3051
|
or when a document in the `docs` array does not specify an index.
|
|
@@ -3352,7 +3180,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3352
3180
|
When sending requests to this endpoint the <code>Content-Type</code> header should be set to <code>application/x-ndjson</code>.</p>
|
|
3353
3181
|
|
|
3354
3182
|
|
|
3355
|
-
`<https://www.elastic.co/
|
|
3183
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-msearch>`_
|
|
3356
3184
|
|
|
3357
3185
|
:param searches:
|
|
3358
3186
|
:param index: Comma-separated list of data streams, indices, and index aliases
|
|
@@ -3379,7 +3207,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3379
3207
|
computationally expensive named queries on a large number of hits may add
|
|
3380
3208
|
significant overhead.
|
|
3381
3209
|
:param max_concurrent_searches: Maximum number of concurrent searches the multi
|
|
3382
|
-
search API can execute.
|
|
3210
|
+
search API can execute. Defaults to `max(1, (# of data nodes * min(search
|
|
3211
|
+
thread pool size, 10)))`.
|
|
3383
3212
|
:param max_concurrent_shard_requests: Maximum number of concurrent shard requests
|
|
3384
3213
|
that each sub-search request executes per node.
|
|
3385
3214
|
:param pre_filter_shard_size: Defines a threshold that enforces a pre-filter
|
|
@@ -3498,7 +3327,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3498
3327
|
</code></pre>
|
|
3499
3328
|
|
|
3500
3329
|
|
|
3501
|
-
`<https://www.elastic.co/
|
|
3330
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-msearch-template>`_
|
|
3502
3331
|
|
|
3503
3332
|
:param search_templates:
|
|
3504
3333
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
@@ -3603,7 +3432,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3603
3432
|
The mapping used is determined by the specified <code>_index</code>.</p>
|
|
3604
3433
|
|
|
3605
3434
|
|
|
3606
|
-
`<https://www.elastic.co/
|
|
3435
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-mtermvectors>`_
|
|
3607
3436
|
|
|
3608
3437
|
:param index: The name of the index that contains the documents.
|
|
3609
3438
|
:param docs: An array of existing or artificial documents.
|
|
@@ -3707,6 +3536,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3707
3536
|
human: t.Optional[bool] = None,
|
|
3708
3537
|
ignore_unavailable: t.Optional[bool] = None,
|
|
3709
3538
|
index_filter: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
3539
|
+
max_concurrent_shard_requests: t.Optional[int] = None,
|
|
3710
3540
|
preference: t.Optional[str] = None,
|
|
3711
3541
|
pretty: t.Optional[bool] = None,
|
|
3712
3542
|
routing: t.Optional[str] = None,
|
|
@@ -3743,7 +3573,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3743
3573
|
You can check how many point-in-times (that is, search contexts) are open with the nodes stats API.</p>
|
|
3744
3574
|
|
|
3745
3575
|
|
|
3746
|
-
`<https://www.elastic.co/
|
|
3576
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-open-point-in-time>`_
|
|
3747
3577
|
|
|
3748
3578
|
:param index: A comma-separated list of index names to open point in time; use
|
|
3749
3579
|
`_all` or empty string to perform the operation on all indices
|
|
@@ -3762,6 +3592,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3762
3592
|
a missing or closed index.
|
|
3763
3593
|
:param index_filter: Filter indices if the provided query rewrites to `match_none`
|
|
3764
3594
|
on every shard.
|
|
3595
|
+
:param max_concurrent_shard_requests: Maximum number of concurrent shard requests
|
|
3596
|
+
that each sub-search request executes per node.
|
|
3765
3597
|
:param preference: The node or shard the operation should be performed on. By
|
|
3766
3598
|
default, it is random.
|
|
3767
3599
|
:param routing: A custom value that is used to route operations to a specific
|
|
@@ -3789,6 +3621,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3789
3621
|
__query["human"] = human
|
|
3790
3622
|
if ignore_unavailable is not None:
|
|
3791
3623
|
__query["ignore_unavailable"] = ignore_unavailable
|
|
3624
|
+
if max_concurrent_shard_requests is not None:
|
|
3625
|
+
__query["max_concurrent_shard_requests"] = max_concurrent_shard_requests
|
|
3792
3626
|
if preference is not None:
|
|
3793
3627
|
__query["preference"] = preference
|
|
3794
3628
|
if pretty is not None:
|
|
@@ -3837,7 +3671,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3837
3671
|
Creates or updates a stored script or search template.</p>
|
|
3838
3672
|
|
|
3839
3673
|
|
|
3840
|
-
`<https://www.elastic.co/
|
|
3674
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-put-script>`_
|
|
3841
3675
|
|
|
3842
3676
|
:param id: The identifier for the stored script or search template. It must be
|
|
3843
3677
|
unique within the cluster.
|
|
@@ -3927,7 +3761,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
3927
3761
|
<p>Evaluate the quality of ranked search results over a set of typical search queries.</p>
|
|
3928
3762
|
|
|
3929
3763
|
|
|
3930
|
-
`<https://www.elastic.co/
|
|
3764
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-rank-eval>`_
|
|
3931
3765
|
|
|
3932
3766
|
:param requests: A set of typical search requests, together with their provided
|
|
3933
3767
|
ratings.
|
|
@@ -4075,7 +3909,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4075
3909
|
}'
|
|
4076
3910
|
done
|
|
4077
3911
|
</code></pre>
|
|
4078
|
-
<p
|
|
3912
|
+
<p><strong>Throttling</strong></p>
|
|
4079
3913
|
<p>Set <code>requests_per_second</code> to any positive decimal number (<code>1.4</code>, <code>6</code>, <code>1000</code>, for example) to throttle the rate at which reindex issues batches of index operations.
|
|
4080
3914
|
Requests are throttled by padding each batch with a wait time.
|
|
4081
3915
|
To turn off throttling, set <code>requests_per_second</code> to <code>-1</code>.</p>
|
|
@@ -4159,7 +3993,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4159
3993
|
It is not possible to configure SSL in the body of the reindex request.</p>
|
|
4160
3994
|
|
|
4161
3995
|
|
|
4162
|
-
`<https://www.elastic.co/
|
|
3996
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-reindex>`_
|
|
4163
3997
|
|
|
4164
3998
|
:param dest: The destination you are copying to.
|
|
4165
3999
|
:param source: The source you are copying from.
|
|
@@ -4283,7 +4117,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4283
4117
|
This behavior prevents scroll timeouts.</p>
|
|
4284
4118
|
|
|
4285
4119
|
|
|
4286
|
-
`<https://www.elastic.co/
|
|
4120
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-reindex>`_
|
|
4287
4121
|
|
|
4288
4122
|
:param task_id: The task identifier, which can be found by using the tasks API.
|
|
4289
4123
|
:param requests_per_second: The throttle for this request in sub-requests per
|
|
@@ -4329,7 +4163,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4329
4163
|
human: t.Optional[bool] = None,
|
|
4330
4164
|
params: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4331
4165
|
pretty: t.Optional[bool] = None,
|
|
4332
|
-
source: t.Optional[str] = None,
|
|
4166
|
+
source: t.Optional[t.Union[str, t.Mapping[str, t.Any]]] = None,
|
|
4333
4167
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4334
4168
|
) -> ObjectApiResponse[t.Any]:
|
|
4335
4169
|
"""
|
|
@@ -4339,7 +4173,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4339
4173
|
<p>Render a search template as a search request body.</p>
|
|
4340
4174
|
|
|
4341
4175
|
|
|
4342
|
-
`<https://www.elastic.co/
|
|
4176
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-render-search-template>`_
|
|
4343
4177
|
|
|
4344
4178
|
:param id: The ID of the search template to render. If no `source` is specified,
|
|
4345
4179
|
this or the `id` request body parameter is required.
|
|
@@ -4396,7 +4230,24 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4396
4230
|
async def scripts_painless_execute(
|
|
4397
4231
|
self,
|
|
4398
4232
|
*,
|
|
4399
|
-
context: t.Optional[
|
|
4233
|
+
context: t.Optional[
|
|
4234
|
+
t.Union[
|
|
4235
|
+
str,
|
|
4236
|
+
t.Literal[
|
|
4237
|
+
"boolean_field",
|
|
4238
|
+
"composite_field",
|
|
4239
|
+
"date_field",
|
|
4240
|
+
"double_field",
|
|
4241
|
+
"filter",
|
|
4242
|
+
"geo_point_field",
|
|
4243
|
+
"ip_field",
|
|
4244
|
+
"keyword_field",
|
|
4245
|
+
"long_field",
|
|
4246
|
+
"painless_test",
|
|
4247
|
+
"score",
|
|
4248
|
+
],
|
|
4249
|
+
]
|
|
4250
|
+
] = None,
|
|
4400
4251
|
context_setup: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4401
4252
|
error_trace: t.Optional[bool] = None,
|
|
4402
4253
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
@@ -4408,15 +4259,22 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4408
4259
|
"""
|
|
4409
4260
|
.. raw:: html
|
|
4410
4261
|
|
|
4411
|
-
<p>Run a script
|
|
4412
|
-
Runs a script and returns a result
|
|
4262
|
+
<p>Run a script.</p>
|
|
4263
|
+
<p>Runs a script and returns a result.
|
|
4264
|
+
Use this API to build and test scripts, such as when defining a script for a runtime field.
|
|
4265
|
+
This API requires very few dependencies and is especially useful if you don't have permissions to write documents on a cluster.</p>
|
|
4266
|
+
<p>The API uses several <em>contexts</em>, which control how scripts are run, what variables are available at runtime, and what the return type is.</p>
|
|
4267
|
+
<p>Each context requires a script, but additional parameters depend on the context you're using for that script.</p>
|
|
4413
4268
|
|
|
4414
4269
|
|
|
4415
|
-
`<https://www.elastic.co/
|
|
4270
|
+
`<https://www.elastic.co/docs/reference/scripting-languages/painless/painless-api-examples>`_
|
|
4416
4271
|
|
|
4417
|
-
:param context: The context that the script should run in.
|
|
4418
|
-
|
|
4419
|
-
:param
|
|
4272
|
+
:param context: The context that the script should run in. NOTE: Result ordering
|
|
4273
|
+
in the field contexts is not guaranteed.
|
|
4274
|
+
:param context_setup: Additional parameters for the `context`. NOTE: This parameter
|
|
4275
|
+
is required for all contexts except `painless_test`, which is the default
|
|
4276
|
+
if no value is provided for `context`.
|
|
4277
|
+
:param script: The Painless script to run.
|
|
4420
4278
|
"""
|
|
4421
4279
|
__path_parts: t.Dict[str, str] = {}
|
|
4422
4280
|
__path = "/_scripts/painless/_execute"
|
|
@@ -4482,7 +4340,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4482
4340
|
<p>IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests.</p>
|
|
4483
4341
|
|
|
4484
4342
|
|
|
4485
|
-
`<https://www.elastic.co/
|
|
4343
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-scroll>`_
|
|
4486
4344
|
|
|
4487
4345
|
:param scroll_id: The scroll ID of the search.
|
|
4488
4346
|
:param rest_total_hits_as_int: If true, the API response’s hit.total property
|
|
@@ -4613,7 +4471,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4613
4471
|
] = None,
|
|
4614
4472
|
lenient: t.Optional[bool] = None,
|
|
4615
4473
|
max_concurrent_shard_requests: t.Optional[int] = None,
|
|
4616
|
-
min_compatible_shard_node: t.Optional[str] = None,
|
|
4617
4474
|
min_score: t.Optional[float] = None,
|
|
4618
4475
|
pit: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4619
4476
|
post_filter: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
@@ -4635,7 +4492,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4635
4492
|
script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
|
|
4636
4493
|
scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4637
4494
|
search_after: t.Optional[
|
|
4638
|
-
t.Sequence[t.Union[None, bool, float, int, str
|
|
4495
|
+
t.Sequence[t.Union[None, bool, float, int, str]]
|
|
4639
4496
|
] = None,
|
|
4640
4497
|
search_type: t.Optional[
|
|
4641
4498
|
t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
|
|
@@ -4688,7 +4545,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4688
4545
|
This situation can occur because the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index.</p>
|
|
4689
4546
|
|
|
4690
4547
|
|
|
4691
|
-
`<https://www.elastic.co/
|
|
4548
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-search>`_
|
|
4692
4549
|
|
|
4693
4550
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
4694
4551
|
search. It supports wildcards (`*`). To search all data streams and indices,
|
|
@@ -4766,10 +4623,9 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4766
4623
|
per node that the search runs concurrently. This value should be used to
|
|
4767
4624
|
limit the impact of the search on the cluster in order to limit the number
|
|
4768
4625
|
of concurrent shard requests.
|
|
4769
|
-
:param min_compatible_shard_node: The minimum version of the node that can handle
|
|
4770
|
-
the request. Any handling node with a lower version will fail the request.
|
|
4771
4626
|
:param min_score: The minimum `_score` for matching documents. Documents with
|
|
4772
|
-
a lower `_score` are not included in
|
|
4627
|
+
a lower `_score` are not included in search results and results collected
|
|
4628
|
+
by aggregations.
|
|
4773
4629
|
:param pit: Limit the search to a point in time (PIT). If you provide a PIT,
|
|
4774
4630
|
you cannot specify an `<index>` in the request path.
|
|
4775
4631
|
:param post_filter: Use the `post_filter` parameter to filter search results.
|
|
@@ -4788,18 +4644,19 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4788
4644
|
:param preference: The nodes and shards used for the search. By default, Elasticsearch
|
|
4789
4645
|
selects from eligible nodes and shards using adaptive replica selection,
|
|
4790
4646
|
accounting for allocation awareness. Valid values are: * `_only_local` to
|
|
4791
|
-
run the search only on shards on the local node
|
|
4647
|
+
run the search only on shards on the local node. * `_local` to, if possible,
|
|
4792
4648
|
run the search on shards on the local node, or if not, select shards using
|
|
4793
|
-
the default method
|
|
4794
|
-
on only the specified nodes IDs
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4649
|
+
the default method. * `_only_nodes:<node-id>,<node-id>` to run the search
|
|
4650
|
+
on only the specified nodes IDs. If suitable shards exist on more than one
|
|
4651
|
+
selected node, use shards on those nodes using the default method. If none
|
|
4652
|
+
of the specified nodes are available, select shards from any available node
|
|
4653
|
+
using the default method. * `_prefer_nodes:<node-id>,<node-id>` to if possible,
|
|
4654
|
+
run the search on the specified nodes IDs. If not, select shards using the
|
|
4655
|
+
default method. `_shards:<shard>,<shard>` to run the search only on the specified
|
|
4656
|
+
shards. You can combine this value with other `preference` values. However,
|
|
4657
|
+
the `_shards` value must come first. For example: `_shards:2,3|_local`. `<custom-string>`
|
|
4658
|
+
(any string that does not start with `_`) to route searches with the same
|
|
4659
|
+
`<custom-string>` to the same shards in the same order.
|
|
4803
4660
|
:param profile: Set to `true` to return detailed timing information about the
|
|
4804
4661
|
execution of individual components in a search request. NOTE: This is a debugging
|
|
4805
4662
|
tool and adds significant overhead to search execution.
|
|
@@ -4950,8 +4807,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
4950
4807
|
__query["lenient"] = lenient
|
|
4951
4808
|
if max_concurrent_shard_requests is not None:
|
|
4952
4809
|
__query["max_concurrent_shard_requests"] = max_concurrent_shard_requests
|
|
4953
|
-
if min_compatible_shard_node is not None:
|
|
4954
|
-
__query["min_compatible_shard_node"] = min_compatible_shard_node
|
|
4955
4810
|
if pre_filter_shard_size is not None:
|
|
4956
4811
|
__query["pre_filter_shard_size"] = pre_filter_shard_size
|
|
4957
4812
|
if preference is not None:
|
|
@@ -5438,7 +5293,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5438
5293
|
Elasticsearch uses the H3 resolution that is closest to the corresponding geotile density.</p>
|
|
5439
5294
|
|
|
5440
5295
|
|
|
5441
|
-
`<https://www.elastic.co/
|
|
5296
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-search-mvt>`_
|
|
5442
5297
|
|
|
5443
5298
|
:param index: Comma-separated list of data streams, indices, or aliases to search
|
|
5444
5299
|
:param field: Field containing geospatial data to return
|
|
@@ -5597,6 +5452,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5597
5452
|
human: t.Optional[bool] = None,
|
|
5598
5453
|
ignore_unavailable: t.Optional[bool] = None,
|
|
5599
5454
|
local: t.Optional[bool] = None,
|
|
5455
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
5600
5456
|
preference: t.Optional[str] = None,
|
|
5601
5457
|
pretty: t.Optional[bool] = None,
|
|
5602
5458
|
routing: t.Optional[str] = None,
|
|
@@ -5611,7 +5467,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5611
5467
|
<p>If the Elasticsearch security features are enabled, you must have the <code>view_index_metadata</code> or <code>manage</code> index privilege for the target data stream, index, or alias.</p>
|
|
5612
5468
|
|
|
5613
5469
|
|
|
5614
|
-
`<https://www.elastic.co/
|
|
5470
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-search-shards>`_
|
|
5615
5471
|
|
|
5616
5472
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
5617
5473
|
search. It supports wildcards (`*`). To search all data streams and indices,
|
|
@@ -5629,6 +5485,10 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5629
5485
|
a missing or closed index.
|
|
5630
5486
|
:param local: If `true`, the request retrieves information from the local node
|
|
5631
5487
|
only.
|
|
5488
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
5489
|
+
If the master node is not available before the timeout expires, the request
|
|
5490
|
+
fails and returns an error. IT can also be set to `-1` to indicate that the
|
|
5491
|
+
request should never timeout.
|
|
5632
5492
|
:param preference: The node or shard the operation should be performed on. It
|
|
5633
5493
|
is random by default.
|
|
5634
5494
|
:param routing: A custom value used to route operations to a specific shard.
|
|
@@ -5655,6 +5515,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5655
5515
|
__query["ignore_unavailable"] = ignore_unavailable
|
|
5656
5516
|
if local is not None:
|
|
5657
5517
|
__query["local"] = local
|
|
5518
|
+
if master_timeout is not None:
|
|
5519
|
+
__query["master_timeout"] = master_timeout
|
|
5658
5520
|
if preference is not None:
|
|
5659
5521
|
__query["preference"] = preference
|
|
5660
5522
|
if pretty is not None:
|
|
@@ -5706,7 +5568,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5706
5568
|
search_type: t.Optional[
|
|
5707
5569
|
t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
|
|
5708
5570
|
] = None,
|
|
5709
|
-
source: t.Optional[str] = None,
|
|
5571
|
+
source: t.Optional[t.Union[str, t.Mapping[str, t.Any]]] = None,
|
|
5710
5572
|
typed_keys: t.Optional[bool] = None,
|
|
5711
5573
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5712
5574
|
) -> ObjectApiResponse[t.Any]:
|
|
@@ -5716,7 +5578,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5716
5578
|
<p>Run a search with a search template.</p>
|
|
5717
5579
|
|
|
5718
5580
|
|
|
5719
|
-
`<https://www.elastic.co/
|
|
5581
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-search-template>`_
|
|
5720
5582
|
|
|
5721
5583
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
5722
5584
|
search. It supports wildcards (`*`).
|
|
@@ -5859,7 +5721,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5859
5721
|
</blockquote>
|
|
5860
5722
|
|
|
5861
5723
|
|
|
5862
|
-
`<https://www.elastic.co/
|
|
5724
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-terms-enum>`_
|
|
5863
5725
|
|
|
5864
5726
|
:param index: A comma-separated list of data streams, indices, and index aliases
|
|
5865
5727
|
to search. Wildcard (`*`) expressions are supported. To search all data streams
|
|
@@ -5929,7 +5791,20 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5929
5791
|
)
|
|
5930
5792
|
|
|
5931
5793
|
@_rewrite_parameters(
|
|
5932
|
-
body_fields=(
|
|
5794
|
+
body_fields=(
|
|
5795
|
+
"doc",
|
|
5796
|
+
"field_statistics",
|
|
5797
|
+
"fields",
|
|
5798
|
+
"filter",
|
|
5799
|
+
"offsets",
|
|
5800
|
+
"payloads",
|
|
5801
|
+
"per_field_analyzer",
|
|
5802
|
+
"positions",
|
|
5803
|
+
"routing",
|
|
5804
|
+
"term_statistics",
|
|
5805
|
+
"version",
|
|
5806
|
+
"version_type",
|
|
5807
|
+
),
|
|
5933
5808
|
)
|
|
5934
5809
|
async def termvectors(
|
|
5935
5810
|
self,
|
|
@@ -5995,7 +5870,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
5995
5870
|
Use <code>routing</code> only to hit a particular shard.</p>
|
|
5996
5871
|
|
|
5997
5872
|
|
|
5998
|
-
`<https://www.elastic.co/
|
|
5873
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-termvectors>`_
|
|
5999
5874
|
|
|
6000
5875
|
:param index: The name of the index that contains the document.
|
|
6001
5876
|
:param id: A unique identifier for the document.
|
|
@@ -6006,9 +5881,9 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6006
5881
|
(the sum of document frequencies for all terms in this field). * The sum
|
|
6007
5882
|
of total term frequencies (the sum of total term frequencies of each term
|
|
6008
5883
|
in this field).
|
|
6009
|
-
:param fields: A
|
|
6010
|
-
|
|
6011
|
-
|
|
5884
|
+
:param fields: A list of fields to include in the statistics. It is used as the
|
|
5885
|
+
default list unless a specific field list is provided in the `completion_fields`
|
|
5886
|
+
or `fielddata_fields` parameters.
|
|
6012
5887
|
:param filter: Filter terms based on their tf-idf scores. This could be useful
|
|
6013
5888
|
in order find out a good characteristic vector of a document. This feature
|
|
6014
5889
|
works in a similar manner to the second phase of the More Like This Query.
|
|
@@ -6046,41 +5921,41 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6046
5921
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
6047
5922
|
if error_trace is not None:
|
|
6048
5923
|
__query["error_trace"] = error_trace
|
|
6049
|
-
if field_statistics is not None:
|
|
6050
|
-
__query["field_statistics"] = field_statistics
|
|
6051
|
-
if fields is not None:
|
|
6052
|
-
__query["fields"] = fields
|
|
6053
5924
|
if filter_path is not None:
|
|
6054
5925
|
__query["filter_path"] = filter_path
|
|
6055
5926
|
if human is not None:
|
|
6056
5927
|
__query["human"] = human
|
|
6057
|
-
if offsets is not None:
|
|
6058
|
-
__query["offsets"] = offsets
|
|
6059
|
-
if payloads is not None:
|
|
6060
|
-
__query["payloads"] = payloads
|
|
6061
|
-
if positions is not None:
|
|
6062
|
-
__query["positions"] = positions
|
|
6063
5928
|
if preference is not None:
|
|
6064
5929
|
__query["preference"] = preference
|
|
6065
5930
|
if pretty is not None:
|
|
6066
5931
|
__query["pretty"] = pretty
|
|
6067
5932
|
if realtime is not None:
|
|
6068
5933
|
__query["realtime"] = realtime
|
|
6069
|
-
if routing is not None:
|
|
6070
|
-
__query["routing"] = routing
|
|
6071
|
-
if term_statistics is not None:
|
|
6072
|
-
__query["term_statistics"] = term_statistics
|
|
6073
|
-
if version is not None:
|
|
6074
|
-
__query["version"] = version
|
|
6075
|
-
if version_type is not None:
|
|
6076
|
-
__query["version_type"] = version_type
|
|
6077
5934
|
if not __body:
|
|
6078
5935
|
if doc is not None:
|
|
6079
5936
|
__body["doc"] = doc
|
|
5937
|
+
if field_statistics is not None:
|
|
5938
|
+
__body["field_statistics"] = field_statistics
|
|
5939
|
+
if fields is not None:
|
|
5940
|
+
__body["fields"] = fields
|
|
6080
5941
|
if filter is not None:
|
|
6081
5942
|
__body["filter"] = filter
|
|
5943
|
+
if offsets is not None:
|
|
5944
|
+
__body["offsets"] = offsets
|
|
5945
|
+
if payloads is not None:
|
|
5946
|
+
__body["payloads"] = payloads
|
|
6082
5947
|
if per_field_analyzer is not None:
|
|
6083
5948
|
__body["per_field_analyzer"] = per_field_analyzer
|
|
5949
|
+
if positions is not None:
|
|
5950
|
+
__body["positions"] = positions
|
|
5951
|
+
if routing is not None:
|
|
5952
|
+
__body["routing"] = routing
|
|
5953
|
+
if term_statistics is not None:
|
|
5954
|
+
__body["term_statistics"] = term_statistics
|
|
5955
|
+
if version is not None:
|
|
5956
|
+
__body["version"] = version
|
|
5957
|
+
if version_type is not None:
|
|
5958
|
+
__body["version_type"] = version_type
|
|
6084
5959
|
if not __body:
|
|
6085
5960
|
__body = None # type: ignore[assignment]
|
|
6086
5961
|
__headers = {"accept": "application/json"}
|
|
@@ -6125,6 +6000,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6125
6000
|
human: t.Optional[bool] = None,
|
|
6126
6001
|
if_primary_term: t.Optional[int] = None,
|
|
6127
6002
|
if_seq_no: t.Optional[int] = None,
|
|
6003
|
+
include_source_on_error: t.Optional[bool] = None,
|
|
6128
6004
|
lang: t.Optional[str] = None,
|
|
6129
6005
|
pretty: t.Optional[bool] = None,
|
|
6130
6006
|
refresh: t.Optional[
|
|
@@ -6165,7 +6041,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6165
6041
|
In addition to <code>_source</code>, you can access the following variables through the <code>ctx</code> map: <code>_index</code>, <code>_type</code>, <code>_id</code>, <code>_version</code>, <code>_routing</code>, and <code>_now</code> (the current timestamp).</p>
|
|
6166
6042
|
|
|
6167
6043
|
|
|
6168
|
-
`<https://www.elastic.co/
|
|
6044
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-update>`_
|
|
6169
6045
|
|
|
6170
6046
|
:param index: The name of the target index. By default, the index is created
|
|
6171
6047
|
automatically if it doesn't exist.
|
|
@@ -6180,6 +6056,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6180
6056
|
term.
|
|
6181
6057
|
:param if_seq_no: Only perform the operation if the document has this sequence
|
|
6182
6058
|
number.
|
|
6059
|
+
:param include_source_on_error: True or false if to include the document source
|
|
6060
|
+
in the error message in case of parsing errors.
|
|
6183
6061
|
:param lang: The script language.
|
|
6184
6062
|
:param refresh: If 'true', Elasticsearch refreshes the affected shards to make
|
|
6185
6063
|
this operation visible to search. If 'wait_for', it waits for a refresh to
|
|
@@ -6224,6 +6102,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6224
6102
|
__query["if_primary_term"] = if_primary_term
|
|
6225
6103
|
if if_seq_no is not None:
|
|
6226
6104
|
__query["if_seq_no"] = if_seq_no
|
|
6105
|
+
if include_source_on_error is not None:
|
|
6106
|
+
__query["include_source_on_error"] = include_source_on_error
|
|
6227
6107
|
if lang is not None:
|
|
6228
6108
|
__query["lang"] = lang
|
|
6229
6109
|
if pretty is not None:
|
|
@@ -6399,7 +6279,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6399
6279
|
This API enables you to only modify the source of matching documents; you cannot move them.</p>
|
|
6400
6280
|
|
|
6401
6281
|
|
|
6402
|
-
`<https://www.elastic.co/
|
|
6282
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-update-by-query>`_
|
|
6403
6283
|
|
|
6404
6284
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
6405
6285
|
search. It supports wildcards (`*`). To search all data streams or indices,
|
|
@@ -6426,7 +6306,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6426
6306
|
wildcard expressions match hidden data streams. It supports comma-separated
|
|
6427
6307
|
values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`,
|
|
6428
6308
|
`hidden`, `none`.
|
|
6429
|
-
:param from_:
|
|
6309
|
+
:param from_: Skips the specified number of documents.
|
|
6430
6310
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
6431
6311
|
a missing or closed index.
|
|
6432
6312
|
:param lenient: If `true`, format-based query failures (such as providing text
|
|
@@ -6619,7 +6499,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6619
6499
|
Rethrottling that speeds up the query takes effect immediately but rethrotting that slows down the query takes effect after completing the current batch to prevent scroll timeouts.</p>
|
|
6620
6500
|
|
|
6621
6501
|
|
|
6622
|
-
`<https://www.elastic.co/
|
|
6502
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-update-by-query-rethrottle>`_
|
|
6623
6503
|
|
|
6624
6504
|
:param task_id: The ID for the task.
|
|
6625
6505
|
:param requests_per_second: The throttle for this request in sub-requests per
|