elasticsearch 8.18.0__py3-none-any.whl → 9.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- elasticsearch/_async/client/__init__.py +62 -277
- elasticsearch/_async/client/_base.py +1 -1
- elasticsearch/_async/client/async_search.py +6 -10
- elasticsearch/_async/client/autoscaling.py +4 -4
- elasticsearch/_async/client/cat.py +26 -33
- elasticsearch/_async/client/ccr.py +13 -13
- elasticsearch/_async/client/cluster.py +20 -20
- elasticsearch/_async/client/connector.py +44 -30
- elasticsearch/_async/client/dangling_indices.py +3 -3
- elasticsearch/_async/client/enrich.py +5 -5
- elasticsearch/_async/client/eql.py +4 -4
- elasticsearch/_async/client/esql.py +7 -11
- elasticsearch/_async/client/features.py +2 -2
- elasticsearch/_async/client/fleet.py +18 -20
- elasticsearch/_async/client/graph.py +1 -1
- elasticsearch/_async/client/ilm.py +18 -11
- elasticsearch/_async/client/indices.py +75 -163
- elasticsearch/_async/client/inference.py +132 -25
- elasticsearch/_async/client/ingest.py +12 -12
- elasticsearch/_async/client/license.py +7 -7
- elasticsearch/_async/client/logstash.py +3 -3
- elasticsearch/_async/client/migration.py +3 -3
- elasticsearch/_async/client/ml.py +80 -85
- elasticsearch/_async/client/monitoring.py +1 -1
- elasticsearch/_async/client/nodes.py +8 -8
- elasticsearch/_async/client/query_rules.py +8 -8
- elasticsearch/_async/client/rollup.py +8 -8
- elasticsearch/_async/client/search_application.py +10 -10
- elasticsearch/_async/client/searchable_snapshots.py +4 -4
- elasticsearch/_async/client/security.py +71 -68
- elasticsearch/_async/client/shutdown.py +3 -3
- elasticsearch/_async/client/simulate.py +1 -1
- elasticsearch/_async/client/slm.py +9 -9
- elasticsearch/_async/client/snapshot.py +280 -130
- 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 -3
- elasticsearch/_async/client/text_structure.py +4 -4
- elasticsearch/_async/client/transform.py +11 -11
- elasticsearch/_async/client/watcher.py +14 -14
- elasticsearch/_async/client/xpack.py +2 -2
- elasticsearch/_sync/client/__init__.py +62 -277
- elasticsearch/_sync/client/_base.py +1 -1
- elasticsearch/_sync/client/async_search.py +6 -10
- elasticsearch/_sync/client/autoscaling.py +4 -4
- elasticsearch/_sync/client/cat.py +26 -33
- elasticsearch/_sync/client/ccr.py +13 -13
- elasticsearch/_sync/client/cluster.py +20 -20
- elasticsearch/_sync/client/connector.py +44 -30
- elasticsearch/_sync/client/dangling_indices.py +3 -3
- elasticsearch/_sync/client/enrich.py +5 -5
- elasticsearch/_sync/client/eql.py +4 -4
- elasticsearch/_sync/client/esql.py +7 -11
- elasticsearch/_sync/client/features.py +2 -2
- elasticsearch/_sync/client/fleet.py +18 -20
- elasticsearch/_sync/client/graph.py +1 -1
- elasticsearch/_sync/client/ilm.py +18 -11
- elasticsearch/_sync/client/indices.py +75 -163
- elasticsearch/_sync/client/inference.py +132 -25
- elasticsearch/_sync/client/ingest.py +12 -12
- elasticsearch/_sync/client/license.py +7 -7
- elasticsearch/_sync/client/logstash.py +3 -3
- elasticsearch/_sync/client/migration.py +3 -3
- elasticsearch/_sync/client/ml.py +80 -85
- elasticsearch/_sync/client/monitoring.py +1 -1
- elasticsearch/_sync/client/nodes.py +8 -8
- elasticsearch/_sync/client/query_rules.py +8 -8
- elasticsearch/_sync/client/rollup.py +8 -8
- elasticsearch/_sync/client/search_application.py +10 -10
- elasticsearch/_sync/client/searchable_snapshots.py +4 -4
- elasticsearch/_sync/client/security.py +71 -68
- elasticsearch/_sync/client/shutdown.py +3 -3
- elasticsearch/_sync/client/simulate.py +1 -1
- elasticsearch/_sync/client/slm.py +9 -9
- elasticsearch/_sync/client/snapshot.py +280 -130
- 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 -3
- elasticsearch/_sync/client/text_structure.py +4 -4
- elasticsearch/_sync/client/transform.py +11 -11
- elasticsearch/_sync/client/utils.py +0 -37
- elasticsearch/_sync/client/watcher.py +14 -14
- elasticsearch/_sync/client/xpack.py +2 -2
- elasticsearch/_version.py +1 -1
- elasticsearch/dsl/_async/search.py +7 -3
- elasticsearch/dsl/_sync/search.py +7 -3
- elasticsearch/dsl/aggs.py +11 -7
- elasticsearch/dsl/faceted_search_base.py +4 -4
- elasticsearch/dsl/field.py +139 -1
- elasticsearch/dsl/query.py +7 -1
- elasticsearch/dsl/search_base.py +16 -3
- elasticsearch/dsl/types.py +66 -84
- elasticsearch/dsl/wrappers.py +25 -0
- elasticsearch/exceptions.py +2 -0
- elasticsearch/helpers/vectorstore/_async/strategies.py +12 -12
- elasticsearch/helpers/vectorstore/_sync/strategies.py +12 -12
- {elasticsearch-8.18.0.dist-info → elasticsearch-9.0.1.dist-info}/METADATA +17 -29
- elasticsearch-9.0.1.dist-info/RECORD +162 -0
- elasticsearch-9.0.1.dist-info/licenses/LICENSE.txt +175 -0
- elasticsearch-9.0.1.dist-info/licenses/NOTICE.txt +559 -0
- elasticsearch/transport.py +0 -57
- elasticsearch-8.18.0.dist-info/RECORD +0 -161
- {elasticsearch-8.18.0.dist-info → elasticsearch-9.0.1.dist-info}/WHEEL +0 -0
- {elasticsearch-8.18.0.dist-info → elasticsearch-9.0.1.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.18.0.dist-info → elasticsearch-9.0.1.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
|
BaseNode,
|
|
@@ -181,37 +180,13 @@ class Elasticsearch(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[Transport] = 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 Elasticsearch(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 Elasticsearch(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
|
)
|
|
@@ -729,7 +637,7 @@ class Elasticsearch(BaseClient):
|
|
|
729
637
|
The other two shards that make up the index do not participate in the <code>_bulk</code> request at all.</p>
|
|
730
638
|
|
|
731
639
|
|
|
732
|
-
`<https://www.elastic.co/
|
|
640
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-bulk>`_
|
|
733
641
|
|
|
734
642
|
:param operations:
|
|
735
643
|
:param index: The name of the data stream, index, or index alias to perform bulk
|
|
@@ -854,7 +762,7 @@ class Elasticsearch(BaseClient):
|
|
|
854
762
|
Clear the search context and results for a scrolling search.</p>
|
|
855
763
|
|
|
856
764
|
|
|
857
|
-
`<https://www.elastic.co/
|
|
765
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-clear-scroll>`_
|
|
858
766
|
|
|
859
767
|
:param scroll_id: The scroll IDs to clear. To clear all scroll IDs, use `_all`.
|
|
860
768
|
"""
|
|
@@ -911,7 +819,7 @@ class Elasticsearch(BaseClient):
|
|
|
911
819
|
However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.</p>
|
|
912
820
|
|
|
913
821
|
|
|
914
|
-
`<https://www.elastic.co/
|
|
822
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-open-point-in-time>`_
|
|
915
823
|
|
|
916
824
|
:param id: The ID of the point-in-time.
|
|
917
825
|
"""
|
|
@@ -995,7 +903,7 @@ class Elasticsearch(BaseClient):
|
|
|
995
903
|
This means that replicas increase the scalability of the count.</p>
|
|
996
904
|
|
|
997
905
|
|
|
998
|
-
`<https://www.elastic.co/
|
|
906
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-count>`_
|
|
999
907
|
|
|
1000
908
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
1001
909
|
search. It supports wildcards (`*`). To search all data streams and indices,
|
|
@@ -1197,7 +1105,7 @@ class Elasticsearch(BaseClient):
|
|
|
1197
1105
|
The <code>_shards</code> section of the API response reveals the number of shard copies on which replication succeeded and failed.</p>
|
|
1198
1106
|
|
|
1199
1107
|
|
|
1200
|
-
`<https://www.elastic.co/
|
|
1108
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-create>`_
|
|
1201
1109
|
|
|
1202
1110
|
:param index: The name of the data stream or index to target. If the target doesn't
|
|
1203
1111
|
exist and matches the name or wildcard (`*`) pattern of an index template
|
|
@@ -1364,7 +1272,7 @@ class Elasticsearch(BaseClient):
|
|
|
1364
1272
|
It then gets redirected into the primary shard within that ID group and replicated (if needed) to shard replicas within that ID group.</p>
|
|
1365
1273
|
|
|
1366
1274
|
|
|
1367
|
-
`<https://www.elastic.co/
|
|
1275
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-delete>`_
|
|
1368
1276
|
|
|
1369
1277
|
:param index: The name of the target index.
|
|
1370
1278
|
:param id: A unique identifier for the document.
|
|
@@ -1553,7 +1461,7 @@ class Elasticsearch(BaseClient):
|
|
|
1553
1461
|
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>
|
|
1554
1462
|
|
|
1555
1463
|
|
|
1556
|
-
`<https://www.elastic.co/
|
|
1464
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-delete-by-query>`_
|
|
1557
1465
|
|
|
1558
1466
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
1559
1467
|
search. It supports wildcards (`*`). To search all data streams or indices,
|
|
@@ -1750,7 +1658,7 @@ class Elasticsearch(BaseClient):
|
|
|
1750
1658
|
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>
|
|
1751
1659
|
|
|
1752
1660
|
|
|
1753
|
-
`<https://www.elastic.co/
|
|
1661
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-delete-by-query-rethrottle>`_
|
|
1754
1662
|
|
|
1755
1663
|
:param task_id: The ID for the task.
|
|
1756
1664
|
:param requests_per_second: The throttle for this request in sub-requests per
|
|
@@ -1800,7 +1708,7 @@ class Elasticsearch(BaseClient):
|
|
|
1800
1708
|
Deletes a stored script or search template.</p>
|
|
1801
1709
|
|
|
1802
1710
|
|
|
1803
|
-
`<https://www.elastic.co/
|
|
1711
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-delete-script>`_
|
|
1804
1712
|
|
|
1805
1713
|
:param id: The identifier for the stored script or search template.
|
|
1806
1714
|
:param master_timeout: The period to wait for a connection to the master node.
|
|
@@ -1884,7 +1792,7 @@ class Elasticsearch(BaseClient):
|
|
|
1884
1792
|
Elasticsearch cleans up deleted documents in the background as you continue to index more data.</p>
|
|
1885
1793
|
|
|
1886
1794
|
|
|
1887
|
-
`<https://www.elastic.co/
|
|
1795
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get>`_
|
|
1888
1796
|
|
|
1889
1797
|
:param index: A comma-separated list of data streams, indices, and aliases. It
|
|
1890
1798
|
supports wildcards (`*`).
|
|
@@ -2007,7 +1915,7 @@ class Elasticsearch(BaseClient):
|
|
|
2007
1915
|
<p>A document's source is not available if it is disabled in the mapping.</p>
|
|
2008
1916
|
|
|
2009
1917
|
|
|
2010
|
-
`<https://www.elastic.co/
|
|
1918
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get>`_
|
|
2011
1919
|
|
|
2012
1920
|
:param index: A comma-separated list of data streams, indices, and aliases. It
|
|
2013
1921
|
supports wildcards (`*`).
|
|
@@ -2113,7 +2021,7 @@ class Elasticsearch(BaseClient):
|
|
|
2113
2021
|
It computes a score explanation for a query and a specific document.</p>
|
|
2114
2022
|
|
|
2115
2023
|
|
|
2116
|
-
`<https://www.elastic.co/
|
|
2024
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-explain>`_
|
|
2117
2025
|
|
|
2118
2026
|
:param index: Index names that are used to limit the request. Only a single index
|
|
2119
2027
|
name can be provided to this parameter.
|
|
@@ -2248,7 +2156,7 @@ class Elasticsearch(BaseClient):
|
|
|
2248
2156
|
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>
|
|
2249
2157
|
|
|
2250
2158
|
|
|
2251
|
-
`<https://www.elastic.co/
|
|
2159
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-field-caps>`_
|
|
2252
2160
|
|
|
2253
2161
|
:param index: A comma-separated list of data streams, indices, and aliases used
|
|
2254
2162
|
to limit the request. Supports wildcards (*). To target all data streams
|
|
@@ -2409,7 +2317,7 @@ class Elasticsearch(BaseClient):
|
|
|
2409
2317
|
Elasticsearch cleans up deleted documents in the background as you continue to index more data.</p>
|
|
2410
2318
|
|
|
2411
2319
|
|
|
2412
|
-
`<https://www.elastic.co/
|
|
2320
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get>`_
|
|
2413
2321
|
|
|
2414
2322
|
:param index: The name of the index that contains the document.
|
|
2415
2323
|
:param id: A unique document identifier.
|
|
@@ -2516,7 +2424,7 @@ class Elasticsearch(BaseClient):
|
|
|
2516
2424
|
Retrieves a stored script or search template.</p>
|
|
2517
2425
|
|
|
2518
2426
|
|
|
2519
|
-
`<https://www.elastic.co/
|
|
2427
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get-script>`_
|
|
2520
2428
|
|
|
2521
2429
|
:param id: The identifier for the stored script or search template.
|
|
2522
2430
|
:param master_timeout: The period to wait for the master node. If the master
|
|
@@ -2565,7 +2473,7 @@ class Elasticsearch(BaseClient):
|
|
|
2565
2473
|
<p>Get a list of supported script contexts and their methods.</p>
|
|
2566
2474
|
|
|
2567
2475
|
|
|
2568
|
-
`<https://www.elastic.co/
|
|
2476
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get-script-context>`_
|
|
2569
2477
|
"""
|
|
2570
2478
|
__path_parts: t.Dict[str, str] = {}
|
|
2571
2479
|
__path = "/_script_context"
|
|
@@ -2604,7 +2512,7 @@ class Elasticsearch(BaseClient):
|
|
|
2604
2512
|
<p>Get a list of available script types, languages, and contexts.</p>
|
|
2605
2513
|
|
|
2606
2514
|
|
|
2607
|
-
`<https://www.elastic.co/
|
|
2515
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get-script-languages>`_
|
|
2608
2516
|
"""
|
|
2609
2517
|
__path_parts: t.Dict[str, str] = {}
|
|
2610
2518
|
__path = "/_script_language"
|
|
@@ -2669,7 +2577,7 @@ class Elasticsearch(BaseClient):
|
|
|
2669
2577
|
</code></pre>
|
|
2670
2578
|
|
|
2671
2579
|
|
|
2672
|
-
`<https://www.elastic.co/
|
|
2580
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-get>`_
|
|
2673
2581
|
|
|
2674
2582
|
:param index: The name of the index that contains the document.
|
|
2675
2583
|
:param id: A unique document identifier.
|
|
@@ -2769,7 +2677,7 @@ class Elasticsearch(BaseClient):
|
|
|
2769
2677
|
When setting up automated polling of the API for health status, set verbose to false to disable the more expensive analysis logic.</p>
|
|
2770
2678
|
|
|
2771
2679
|
|
|
2772
|
-
`<https://www.elastic.co/
|
|
2680
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-health-report>`_
|
|
2773
2681
|
|
|
2774
2682
|
:param feature: A feature of the cluster, as returned by the top-level health
|
|
2775
2683
|
report API.
|
|
@@ -2934,7 +2842,7 @@ class Elasticsearch(BaseClient):
|
|
|
2934
2842
|
</code></pre>
|
|
2935
2843
|
|
|
2936
2844
|
|
|
2937
|
-
`<https://www.elastic.co/
|
|
2845
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-create>`_
|
|
2938
2846
|
|
|
2939
2847
|
:param index: The name of the data stream or index to target. If the target doesn't
|
|
2940
2848
|
exist and matches the name or wildcard (`*`) pattern of an index template
|
|
@@ -3066,7 +2974,7 @@ class Elasticsearch(BaseClient):
|
|
|
3066
2974
|
Get basic build, version, and cluster information.</p>
|
|
3067
2975
|
|
|
3068
2976
|
|
|
3069
|
-
`<https://www.elastic.co/
|
|
2977
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/group/endpoint-info>`_
|
|
3070
2978
|
"""
|
|
3071
2979
|
__path_parts: t.Dict[str, str] = {}
|
|
3072
2980
|
__path = "/"
|
|
@@ -3089,127 +2997,6 @@ class Elasticsearch(BaseClient):
|
|
|
3089
2997
|
path_parts=__path_parts,
|
|
3090
2998
|
)
|
|
3091
2999
|
|
|
3092
|
-
@_rewrite_parameters(
|
|
3093
|
-
body_fields=(
|
|
3094
|
-
"knn",
|
|
3095
|
-
"docvalue_fields",
|
|
3096
|
-
"fields",
|
|
3097
|
-
"filter",
|
|
3098
|
-
"source",
|
|
3099
|
-
"stored_fields",
|
|
3100
|
-
),
|
|
3101
|
-
parameter_aliases={"_source": "source"},
|
|
3102
|
-
)
|
|
3103
|
-
@_stability_warning(Stability.EXPERIMENTAL)
|
|
3104
|
-
def knn_search(
|
|
3105
|
-
self,
|
|
3106
|
-
*,
|
|
3107
|
-
index: t.Union[str, t.Sequence[str]],
|
|
3108
|
-
knn: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
3109
|
-
docvalue_fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
3110
|
-
error_trace: t.Optional[bool] = None,
|
|
3111
|
-
fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
3112
|
-
filter: t.Optional[
|
|
3113
|
-
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
|
|
3114
|
-
] = None,
|
|
3115
|
-
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
3116
|
-
human: t.Optional[bool] = None,
|
|
3117
|
-
pretty: t.Optional[bool] = None,
|
|
3118
|
-
routing: t.Optional[str] = None,
|
|
3119
|
-
source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None,
|
|
3120
|
-
stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
3121
|
-
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3122
|
-
) -> ObjectApiResponse[t.Any]:
|
|
3123
|
-
"""
|
|
3124
|
-
.. raw:: html
|
|
3125
|
-
|
|
3126
|
-
<p>Run a knn search.</p>
|
|
3127
|
-
<p>NOTE: The kNN search API has been replaced by the <code>knn</code> option in the search API.</p>
|
|
3128
|
-
<p>Perform a k-nearest neighbor (kNN) search on a dense_vector field and return the matching documents.
|
|
3129
|
-
Given a query vector, the API finds the k closest vectors and returns those documents as search hits.</p>
|
|
3130
|
-
<p>Elasticsearch uses the HNSW algorithm to support efficient kNN search.
|
|
3131
|
-
Like most kNN algorithms, HNSW is an approximate method that sacrifices result accuracy for improved search speed.
|
|
3132
|
-
This means the results returned are not always the true k closest neighbors.</p>
|
|
3133
|
-
<p>The kNN search API supports restricting the search using a filter.
|
|
3134
|
-
The search will return the top k documents that also match the filter query.</p>
|
|
3135
|
-
<p>A kNN search response has the exact same structure as a search API response.
|
|
3136
|
-
However, certain sections have a meaning specific to kNN search:</p>
|
|
3137
|
-
<ul>
|
|
3138
|
-
<li>The document <code>_score</code> is determined by the similarity between the query and document vector.</li>
|
|
3139
|
-
<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>
|
|
3140
|
-
</ul>
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/knn-search-api.html>`_
|
|
3144
|
-
|
|
3145
|
-
:param index: A comma-separated list of index names to search; use `_all` or
|
|
3146
|
-
to perform the operation on all indices.
|
|
3147
|
-
:param knn: The kNN query to run.
|
|
3148
|
-
:param docvalue_fields: The request returns doc values for field names matching
|
|
3149
|
-
these patterns in the `hits.fields` property of the response. It accepts
|
|
3150
|
-
wildcard (`*`) patterns.
|
|
3151
|
-
:param fields: The request returns values for field names matching these patterns
|
|
3152
|
-
in the `hits.fields` property of the response. It accepts wildcard (`*`)
|
|
3153
|
-
patterns.
|
|
3154
|
-
:param filter: A query to filter the documents that can match. The kNN search
|
|
3155
|
-
will return the top `k` documents that also match this filter. The value
|
|
3156
|
-
can be a single query or a list of queries. If `filter` isn't provided, all
|
|
3157
|
-
documents are allowed to match.
|
|
3158
|
-
:param routing: A comma-separated list of specific routing values.
|
|
3159
|
-
:param source: Indicates which source fields are returned for matching documents.
|
|
3160
|
-
These fields are returned in the `hits._source` property of the search response.
|
|
3161
|
-
:param stored_fields: A list of stored fields to return as part of a hit. If
|
|
3162
|
-
no fields are specified, no stored fields are included in the response. If
|
|
3163
|
-
this field is specified, the `_source` parameter defaults to `false`. You
|
|
3164
|
-
can pass `_source: true` to return both source fields and stored fields in
|
|
3165
|
-
the search response.
|
|
3166
|
-
"""
|
|
3167
|
-
if index in SKIP_IN_PATH:
|
|
3168
|
-
raise ValueError("Empty value passed for parameter 'index'")
|
|
3169
|
-
if knn is None and body is None:
|
|
3170
|
-
raise ValueError("Empty value passed for parameter 'knn'")
|
|
3171
|
-
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
3172
|
-
__path = f'/{__path_parts["index"]}/_knn_search'
|
|
3173
|
-
__query: t.Dict[str, t.Any] = {}
|
|
3174
|
-
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3175
|
-
if error_trace is not None:
|
|
3176
|
-
__query["error_trace"] = error_trace
|
|
3177
|
-
if filter_path is not None:
|
|
3178
|
-
__query["filter_path"] = filter_path
|
|
3179
|
-
if human is not None:
|
|
3180
|
-
__query["human"] = human
|
|
3181
|
-
if pretty is not None:
|
|
3182
|
-
__query["pretty"] = pretty
|
|
3183
|
-
if routing is not None:
|
|
3184
|
-
__query["routing"] = routing
|
|
3185
|
-
if not __body:
|
|
3186
|
-
if knn is not None:
|
|
3187
|
-
__body["knn"] = knn
|
|
3188
|
-
if docvalue_fields is not None:
|
|
3189
|
-
__body["docvalue_fields"] = docvalue_fields
|
|
3190
|
-
if fields is not None:
|
|
3191
|
-
__body["fields"] = fields
|
|
3192
|
-
if filter is not None:
|
|
3193
|
-
__body["filter"] = filter
|
|
3194
|
-
if source is not None:
|
|
3195
|
-
__body["_source"] = source
|
|
3196
|
-
if stored_fields is not None:
|
|
3197
|
-
__body["stored_fields"] = stored_fields
|
|
3198
|
-
if not __body:
|
|
3199
|
-
__body = None # type: ignore[assignment]
|
|
3200
|
-
__headers = {"accept": "application/json"}
|
|
3201
|
-
if __body is not None:
|
|
3202
|
-
__headers["content-type"] = "application/json"
|
|
3203
|
-
return self.perform_request( # type: ignore[return-value]
|
|
3204
|
-
"POST",
|
|
3205
|
-
__path,
|
|
3206
|
-
params=__query,
|
|
3207
|
-
headers=__headers,
|
|
3208
|
-
body=__body,
|
|
3209
|
-
endpoint_id="knn_search",
|
|
3210
|
-
path_parts=__path_parts,
|
|
3211
|
-
)
|
|
3212
|
-
|
|
3213
3000
|
@_rewrite_parameters(
|
|
3214
3001
|
body_fields=("docs", "ids"),
|
|
3215
3002
|
parameter_aliases={
|
|
@@ -3256,7 +3043,7 @@ class Elasticsearch(BaseClient):
|
|
|
3256
3043
|
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>
|
|
3257
3044
|
|
|
3258
3045
|
|
|
3259
|
-
`<https://www.elastic.co/
|
|
3046
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-mget>`_
|
|
3260
3047
|
|
|
3261
3048
|
:param index: Name of the index to retrieve documents from when `ids` are specified,
|
|
3262
3049
|
or when a document in the `docs` array does not specify an index.
|
|
@@ -3391,7 +3178,7 @@ class Elasticsearch(BaseClient):
|
|
|
3391
3178
|
When sending requests to this endpoint the <code>Content-Type</code> header should be set to <code>application/x-ndjson</code>.</p>
|
|
3392
3179
|
|
|
3393
3180
|
|
|
3394
|
-
`<https://www.elastic.co/
|
|
3181
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-msearch>`_
|
|
3395
3182
|
|
|
3396
3183
|
:param searches:
|
|
3397
3184
|
:param index: Comma-separated list of data streams, indices, and index aliases
|
|
@@ -3418,7 +3205,8 @@ class Elasticsearch(BaseClient):
|
|
|
3418
3205
|
computationally expensive named queries on a large number of hits may add
|
|
3419
3206
|
significant overhead.
|
|
3420
3207
|
:param max_concurrent_searches: Maximum number of concurrent searches the multi
|
|
3421
|
-
search API can execute.
|
|
3208
|
+
search API can execute. Defaults to `max(1, (# of data nodes * min(search
|
|
3209
|
+
thread pool size, 10)))`.
|
|
3422
3210
|
:param max_concurrent_shard_requests: Maximum number of concurrent shard requests
|
|
3423
3211
|
that each sub-search request executes per node.
|
|
3424
3212
|
:param pre_filter_shard_size: Defines a threshold that enforces a pre-filter
|
|
@@ -3537,7 +3325,7 @@ class Elasticsearch(BaseClient):
|
|
|
3537
3325
|
</code></pre>
|
|
3538
3326
|
|
|
3539
3327
|
|
|
3540
|
-
`<https://www.elastic.co/
|
|
3328
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-msearch-template>`_
|
|
3541
3329
|
|
|
3542
3330
|
:param search_templates:
|
|
3543
3331
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
@@ -3642,7 +3430,7 @@ class Elasticsearch(BaseClient):
|
|
|
3642
3430
|
The mapping used is determined by the specified <code>_index</code>.</p>
|
|
3643
3431
|
|
|
3644
3432
|
|
|
3645
|
-
`<https://www.elastic.co/
|
|
3433
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-mtermvectors>`_
|
|
3646
3434
|
|
|
3647
3435
|
:param index: The name of the index that contains the documents.
|
|
3648
3436
|
:param docs: An array of existing or artificial documents.
|
|
@@ -3783,7 +3571,7 @@ class Elasticsearch(BaseClient):
|
|
|
3783
3571
|
You can check how many point-in-times (that is, search contexts) are open with the nodes stats API.</p>
|
|
3784
3572
|
|
|
3785
3573
|
|
|
3786
|
-
`<https://www.elastic.co/
|
|
3574
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-open-point-in-time>`_
|
|
3787
3575
|
|
|
3788
3576
|
:param index: A comma-separated list of index names to open point in time; use
|
|
3789
3577
|
`_all` or empty string to perform the operation on all indices
|
|
@@ -3881,7 +3669,7 @@ class Elasticsearch(BaseClient):
|
|
|
3881
3669
|
Creates or updates a stored script or search template.</p>
|
|
3882
3670
|
|
|
3883
3671
|
|
|
3884
|
-
`<https://www.elastic.co/
|
|
3672
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-put-script>`_
|
|
3885
3673
|
|
|
3886
3674
|
:param id: The identifier for the stored script or search template. It must be
|
|
3887
3675
|
unique within the cluster.
|
|
@@ -3971,7 +3759,7 @@ class Elasticsearch(BaseClient):
|
|
|
3971
3759
|
<p>Evaluate the quality of ranked search results over a set of typical search queries.</p>
|
|
3972
3760
|
|
|
3973
3761
|
|
|
3974
|
-
`<https://www.elastic.co/
|
|
3762
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-rank-eval>`_
|
|
3975
3763
|
|
|
3976
3764
|
:param requests: A set of typical search requests, together with their provided
|
|
3977
3765
|
ratings.
|
|
@@ -4203,7 +3991,7 @@ class Elasticsearch(BaseClient):
|
|
|
4203
3991
|
It is not possible to configure SSL in the body of the reindex request.</p>
|
|
4204
3992
|
|
|
4205
3993
|
|
|
4206
|
-
`<https://www.elastic.co/
|
|
3994
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-reindex>`_
|
|
4207
3995
|
|
|
4208
3996
|
:param dest: The destination you are copying to.
|
|
4209
3997
|
:param source: The source you are copying from.
|
|
@@ -4327,7 +4115,7 @@ class Elasticsearch(BaseClient):
|
|
|
4327
4115
|
This behavior prevents scroll timeouts.</p>
|
|
4328
4116
|
|
|
4329
4117
|
|
|
4330
|
-
`<https://www.elastic.co/
|
|
4118
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-reindex>`_
|
|
4331
4119
|
|
|
4332
4120
|
:param task_id: The task identifier, which can be found by using the tasks API.
|
|
4333
4121
|
:param requests_per_second: The throttle for this request in sub-requests per
|
|
@@ -4373,7 +4161,7 @@ class Elasticsearch(BaseClient):
|
|
|
4373
4161
|
human: t.Optional[bool] = None,
|
|
4374
4162
|
params: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4375
4163
|
pretty: t.Optional[bool] = None,
|
|
4376
|
-
source: t.Optional[str] = None,
|
|
4164
|
+
source: t.Optional[t.Union[str, t.Mapping[str, t.Any]]] = None,
|
|
4377
4165
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4378
4166
|
) -> ObjectApiResponse[t.Any]:
|
|
4379
4167
|
"""
|
|
@@ -4383,7 +4171,7 @@ class Elasticsearch(BaseClient):
|
|
|
4383
4171
|
<p>Render a search template as a search request body.</p>
|
|
4384
4172
|
|
|
4385
4173
|
|
|
4386
|
-
`<https://www.elastic.co/
|
|
4174
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-render-search-template>`_
|
|
4387
4175
|
|
|
4388
4176
|
:param id: The ID of the search template to render. If no `source` is specified,
|
|
4389
4177
|
this or the `id` request body parameter is required.
|
|
@@ -4477,7 +4265,7 @@ class Elasticsearch(BaseClient):
|
|
|
4477
4265
|
<p>Each context requires a script, but additional parameters depend on the context you're using for that script.</p>
|
|
4478
4266
|
|
|
4479
4267
|
|
|
4480
|
-
`<https://www.elastic.co/
|
|
4268
|
+
`<https://www.elastic.co/docs/reference/scripting-languages/painless/painless-api-examples>`_
|
|
4481
4269
|
|
|
4482
4270
|
:param context: The context that the script should run in. NOTE: Result ordering
|
|
4483
4271
|
in the field contexts is not guaranteed.
|
|
@@ -4550,7 +4338,7 @@ class Elasticsearch(BaseClient):
|
|
|
4550
4338
|
<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>
|
|
4551
4339
|
|
|
4552
4340
|
|
|
4553
|
-
`<https://www.elastic.co/
|
|
4341
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-scroll>`_
|
|
4554
4342
|
|
|
4555
4343
|
:param scroll_id: The scroll ID of the search.
|
|
4556
4344
|
:param rest_total_hits_as_int: If true, the API response’s hit.total property
|
|
@@ -4681,7 +4469,6 @@ class Elasticsearch(BaseClient):
|
|
|
4681
4469
|
] = None,
|
|
4682
4470
|
lenient: t.Optional[bool] = None,
|
|
4683
4471
|
max_concurrent_shard_requests: t.Optional[int] = None,
|
|
4684
|
-
min_compatible_shard_node: t.Optional[str] = None,
|
|
4685
4472
|
min_score: t.Optional[float] = None,
|
|
4686
4473
|
pit: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4687
4474
|
post_filter: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
@@ -4703,7 +4490,7 @@ class Elasticsearch(BaseClient):
|
|
|
4703
4490
|
script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
|
|
4704
4491
|
scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4705
4492
|
search_after: t.Optional[
|
|
4706
|
-
t.Sequence[t.Union[None, bool, float, int, str
|
|
4493
|
+
t.Sequence[t.Union[None, bool, float, int, str]]
|
|
4707
4494
|
] = None,
|
|
4708
4495
|
search_type: t.Optional[
|
|
4709
4496
|
t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
|
|
@@ -4756,7 +4543,7 @@ class Elasticsearch(BaseClient):
|
|
|
4756
4543
|
This situation can occur because the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index.</p>
|
|
4757
4544
|
|
|
4758
4545
|
|
|
4759
|
-
`<https://www.elastic.co/
|
|
4546
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-search>`_
|
|
4760
4547
|
|
|
4761
4548
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
4762
4549
|
search. It supports wildcards (`*`). To search all data streams and indices,
|
|
@@ -4834,10 +4621,9 @@ class Elasticsearch(BaseClient):
|
|
|
4834
4621
|
per node that the search runs concurrently. This value should be used to
|
|
4835
4622
|
limit the impact of the search on the cluster in order to limit the number
|
|
4836
4623
|
of concurrent shard requests.
|
|
4837
|
-
:param min_compatible_shard_node: The minimum version of the node that can handle
|
|
4838
|
-
the request Any handling node with a lower version will fail the request.
|
|
4839
4624
|
:param min_score: The minimum `_score` for matching documents. Documents with
|
|
4840
|
-
a lower `_score` are not included in
|
|
4625
|
+
a lower `_score` are not included in search results and results collected
|
|
4626
|
+
by aggregations.
|
|
4841
4627
|
:param pit: Limit the search to a point in time (PIT). If you provide a PIT,
|
|
4842
4628
|
you cannot specify an `<index>` in the request path.
|
|
4843
4629
|
:param post_filter: Use the `post_filter` parameter to filter search results.
|
|
@@ -4856,18 +4642,19 @@ class Elasticsearch(BaseClient):
|
|
|
4856
4642
|
:param preference: The nodes and shards used for the search. By default, Elasticsearch
|
|
4857
4643
|
selects from eligible nodes and shards using adaptive replica selection,
|
|
4858
4644
|
accounting for allocation awareness. Valid values are: * `_only_local` to
|
|
4859
|
-
run the search only on shards on the local node
|
|
4645
|
+
run the search only on shards on the local node. * `_local` to, if possible,
|
|
4860
4646
|
run the search on shards on the local node, or if not, select shards using
|
|
4861
|
-
the default method
|
|
4862
|
-
on only the specified nodes IDs
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4647
|
+
the default method. * `_only_nodes:<node-id>,<node-id>` to run the search
|
|
4648
|
+
on only the specified nodes IDs. If suitable shards exist on more than one
|
|
4649
|
+
selected node, use shards on those nodes using the default method. If none
|
|
4650
|
+
of the specified nodes are available, select shards from any available node
|
|
4651
|
+
using the default method. * `_prefer_nodes:<node-id>,<node-id>` to if possible,
|
|
4652
|
+
run the search on the specified nodes IDs. If not, select shards using the
|
|
4653
|
+
default method. `_shards:<shard>,<shard>` to run the search only on the specified
|
|
4654
|
+
shards. You can combine this value with other `preference` values. However,
|
|
4655
|
+
the `_shards` value must come first. For example: `_shards:2,3|_local`. `<custom-string>`
|
|
4656
|
+
(any string that does not start with `_`) to route searches with the same
|
|
4657
|
+
`<custom-string>` to the same shards in the same order.
|
|
4871
4658
|
:param profile: Set to `true` to return detailed timing information about the
|
|
4872
4659
|
execution of individual components in a search request. NOTE: This is a debugging
|
|
4873
4660
|
tool and adds significant overhead to search execution.
|
|
@@ -5018,8 +4805,6 @@ class Elasticsearch(BaseClient):
|
|
|
5018
4805
|
__query["lenient"] = lenient
|
|
5019
4806
|
if max_concurrent_shard_requests is not None:
|
|
5020
4807
|
__query["max_concurrent_shard_requests"] = max_concurrent_shard_requests
|
|
5021
|
-
if min_compatible_shard_node is not None:
|
|
5022
|
-
__query["min_compatible_shard_node"] = min_compatible_shard_node
|
|
5023
4808
|
if pre_filter_shard_size is not None:
|
|
5024
4809
|
__query["pre_filter_shard_size"] = pre_filter_shard_size
|
|
5025
4810
|
if preference is not None:
|
|
@@ -5506,7 +5291,7 @@ class Elasticsearch(BaseClient):
|
|
|
5506
5291
|
Elasticsearch uses the H3 resolution that is closest to the corresponding geotile density.</p>
|
|
5507
5292
|
|
|
5508
5293
|
|
|
5509
|
-
`<https://www.elastic.co/
|
|
5294
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-search-mvt>`_
|
|
5510
5295
|
|
|
5511
5296
|
:param index: Comma-separated list of data streams, indices, or aliases to search
|
|
5512
5297
|
:param field: Field containing geospatial data to return
|
|
@@ -5680,7 +5465,7 @@ class Elasticsearch(BaseClient):
|
|
|
5680
5465
|
<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>
|
|
5681
5466
|
|
|
5682
5467
|
|
|
5683
|
-
`<https://www.elastic.co/
|
|
5468
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-search-shards>`_
|
|
5684
5469
|
|
|
5685
5470
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
5686
5471
|
search. It supports wildcards (`*`). To search all data streams and indices,
|
|
@@ -5781,7 +5566,7 @@ class Elasticsearch(BaseClient):
|
|
|
5781
5566
|
search_type: t.Optional[
|
|
5782
5567
|
t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
|
|
5783
5568
|
] = None,
|
|
5784
|
-
source: t.Optional[str] = None,
|
|
5569
|
+
source: t.Optional[t.Union[str, t.Mapping[str, t.Any]]] = None,
|
|
5785
5570
|
typed_keys: t.Optional[bool] = None,
|
|
5786
5571
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5787
5572
|
) -> ObjectApiResponse[t.Any]:
|
|
@@ -5791,7 +5576,7 @@ class Elasticsearch(BaseClient):
|
|
|
5791
5576
|
<p>Run a search with a search template.</p>
|
|
5792
5577
|
|
|
5793
5578
|
|
|
5794
|
-
`<https://www.elastic.co/
|
|
5579
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-search-template>`_
|
|
5795
5580
|
|
|
5796
5581
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
5797
5582
|
search. It supports wildcards (`*`).
|
|
@@ -5934,7 +5719,7 @@ class Elasticsearch(BaseClient):
|
|
|
5934
5719
|
</blockquote>
|
|
5935
5720
|
|
|
5936
5721
|
|
|
5937
|
-
`<https://www.elastic.co/
|
|
5722
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-terms-enum>`_
|
|
5938
5723
|
|
|
5939
5724
|
:param index: A comma-separated list of data streams, indices, and index aliases
|
|
5940
5725
|
to search. Wildcard (`*`) expressions are supported. To search all data streams
|
|
@@ -6083,7 +5868,7 @@ class Elasticsearch(BaseClient):
|
|
|
6083
5868
|
Use <code>routing</code> only to hit a particular shard.</p>
|
|
6084
5869
|
|
|
6085
5870
|
|
|
6086
|
-
`<https://www.elastic.co/
|
|
5871
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-termvectors>`_
|
|
6087
5872
|
|
|
6088
5873
|
:param index: The name of the index that contains the document.
|
|
6089
5874
|
:param id: A unique identifier for the document.
|
|
@@ -6254,7 +6039,7 @@ class Elasticsearch(BaseClient):
|
|
|
6254
6039
|
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>
|
|
6255
6040
|
|
|
6256
6041
|
|
|
6257
|
-
`<https://www.elastic.co/
|
|
6042
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-update>`_
|
|
6258
6043
|
|
|
6259
6044
|
:param index: The name of the target index. By default, the index is created
|
|
6260
6045
|
automatically if it doesn't exist.
|
|
@@ -6492,7 +6277,7 @@ class Elasticsearch(BaseClient):
|
|
|
6492
6277
|
This API enables you to only modify the source of matching documents; you cannot move them.</p>
|
|
6493
6278
|
|
|
6494
6279
|
|
|
6495
|
-
`<https://www.elastic.co/
|
|
6280
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-update-by-query>`_
|
|
6496
6281
|
|
|
6497
6282
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
6498
6283
|
search. It supports wildcards (`*`). To search all data streams or indices,
|
|
@@ -6712,7 +6497,7 @@ class Elasticsearch(BaseClient):
|
|
|
6712
6497
|
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>
|
|
6713
6498
|
|
|
6714
6499
|
|
|
6715
|
-
`<https://www.elastic.co/
|
|
6500
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-update-by-query-rethrottle>`_
|
|
6716
6501
|
|
|
6717
6502
|
:param task_id: The ID for the task.
|
|
6718
6503
|
:param requests_per_second: The throttle for this request in sub-requests per
|