elasticsearch 8.17.2__py3-none-any.whl → 8.18.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 +174 -79
- elasticsearch/_async/client/_base.py +0 -1
- elasticsearch/_async/client/async_search.py +12 -8
- elasticsearch/_async/client/autoscaling.py +4 -4
- elasticsearch/_async/client/cat.py +26 -26
- elasticsearch/_async/client/ccr.py +186 -72
- elasticsearch/_async/client/cluster.py +38 -19
- elasticsearch/_async/client/connector.py +30 -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 +62 -6
- elasticsearch/_async/client/features.py +12 -2
- elasticsearch/_async/client/fleet.py +8 -2
- elasticsearch/_async/client/graph.py +1 -1
- elasticsearch/_async/client/ilm.py +23 -22
- elasticsearch/_async/client/indices.py +424 -132
- elasticsearch/_async/client/inference.py +1853 -115
- 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 +141 -112
- elasticsearch/_async/client/monitoring.py +1 -1
- elasticsearch/_async/client/nodes.py +9 -27
- 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 +71 -71
- 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 +13 -17
- 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 +22 -14
- elasticsearch/_async/client/xpack.py +2 -2
- elasticsearch/_async/helpers.py +0 -1
- elasticsearch/_sync/client/__init__.py +174 -79
- elasticsearch/_sync/client/_base.py +0 -1
- elasticsearch/_sync/client/async_search.py +12 -8
- elasticsearch/_sync/client/autoscaling.py +4 -4
- elasticsearch/_sync/client/cat.py +26 -26
- elasticsearch/_sync/client/ccr.py +186 -72
- elasticsearch/_sync/client/cluster.py +38 -19
- elasticsearch/_sync/client/connector.py +30 -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 +62 -6
- elasticsearch/_sync/client/features.py +12 -2
- elasticsearch/_sync/client/fleet.py +8 -2
- elasticsearch/_sync/client/graph.py +1 -1
- elasticsearch/_sync/client/ilm.py +23 -22
- elasticsearch/_sync/client/indices.py +424 -132
- elasticsearch/_sync/client/inference.py +1853 -115
- 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 +141 -112
- elasticsearch/_sync/client/monitoring.py +1 -1
- elasticsearch/_sync/client/nodes.py +9 -27
- 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 +71 -71
- 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 +13 -17
- 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 -3
- elasticsearch/_sync/client/watcher.py +22 -14
- 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 +233 -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 +226 -0
- elasticsearch/dsl/_sync/update_by_query.py +45 -0
- elasticsearch/dsl/aggs.py +3730 -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 +4254 -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 +2816 -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 +1040 -0
- elasticsearch/dsl/serializer.py +34 -0
- elasticsearch/dsl/types.py +6471 -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 +119 -0
- {elasticsearch-8.17.2.dist-info → elasticsearch-8.18.0.dist-info}/METADATA +12 -2
- elasticsearch-8.18.0.dist-info/RECORD +161 -0
- elasticsearch-8.17.2.dist-info/RECORD +0 -119
- {elasticsearch-8.17.2.dist-info → elasticsearch-8.18.0.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.2.dist-info → elasticsearch-8.18.0.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.2.dist-info → elasticsearch-8.18.0.dist-info}/licenses/NOTICE +0 -0
|
@@ -626,6 +626,7 @@ class Elasticsearch(BaseClient):
|
|
|
626
626
|
error_trace: t.Optional[bool] = None,
|
|
627
627
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
628
628
|
human: t.Optional[bool] = None,
|
|
629
|
+
include_source_on_error: t.Optional[bool] = None,
|
|
629
630
|
list_executed_pipelines: t.Optional[bool] = None,
|
|
630
631
|
pipeline: t.Optional[str] = None,
|
|
631
632
|
pretty: t.Optional[bool] = None,
|
|
@@ -728,11 +729,13 @@ class Elasticsearch(BaseClient):
|
|
|
728
729
|
The other two shards that make up the index do not participate in the <code>_bulk</code> request at all.</p>
|
|
729
730
|
|
|
730
731
|
|
|
731
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
732
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-bulk.html>`_
|
|
732
733
|
|
|
733
734
|
:param operations:
|
|
734
735
|
:param index: The name of the data stream, index, or index alias to perform bulk
|
|
735
736
|
actions on.
|
|
737
|
+
:param include_source_on_error: True or false if to include the document source
|
|
738
|
+
in the error message in case of parsing errors.
|
|
736
739
|
:param list_executed_pipelines: If `true`, the response will include the ingest
|
|
737
740
|
pipelines that were run for each index or create.
|
|
738
741
|
:param pipeline: The pipeline identifier to use to preprocess incoming documents.
|
|
@@ -790,6 +793,8 @@ class Elasticsearch(BaseClient):
|
|
|
790
793
|
__query["filter_path"] = filter_path
|
|
791
794
|
if human is not None:
|
|
792
795
|
__query["human"] = human
|
|
796
|
+
if include_source_on_error is not None:
|
|
797
|
+
__query["include_source_on_error"] = include_source_on_error
|
|
793
798
|
if list_executed_pipelines is not None:
|
|
794
799
|
__query["list_executed_pipelines"] = list_executed_pipelines
|
|
795
800
|
if pipeline is not None:
|
|
@@ -849,7 +854,7 @@ class Elasticsearch(BaseClient):
|
|
|
849
854
|
Clear the search context and results for a scrolling search.</p>
|
|
850
855
|
|
|
851
856
|
|
|
852
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
857
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/clear-scroll-api.html>`_
|
|
853
858
|
|
|
854
859
|
:param scroll_id: The scroll IDs to clear. To clear all scroll IDs, use `_all`.
|
|
855
860
|
"""
|
|
@@ -906,7 +911,7 @@ class Elasticsearch(BaseClient):
|
|
|
906
911
|
However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.</p>
|
|
907
912
|
|
|
908
913
|
|
|
909
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
914
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/point-in-time-api.html>`_
|
|
910
915
|
|
|
911
916
|
:param id: The ID of the point-in-time.
|
|
912
917
|
"""
|
|
@@ -990,7 +995,7 @@ class Elasticsearch(BaseClient):
|
|
|
990
995
|
This means that replicas increase the scalability of the count.</p>
|
|
991
996
|
|
|
992
997
|
|
|
993
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
998
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/search-count.html>`_
|
|
994
999
|
|
|
995
1000
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
996
1001
|
search. It supports wildcards (`*`). To search all data streams and indices,
|
|
@@ -1114,11 +1119,17 @@ class Elasticsearch(BaseClient):
|
|
|
1114
1119
|
error_trace: t.Optional[bool] = None,
|
|
1115
1120
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1116
1121
|
human: t.Optional[bool] = None,
|
|
1122
|
+
if_primary_term: t.Optional[int] = None,
|
|
1123
|
+
if_seq_no: t.Optional[int] = None,
|
|
1124
|
+
include_source_on_error: t.Optional[bool] = None,
|
|
1125
|
+
op_type: t.Optional[t.Union[str, t.Literal["create", "index"]]] = None,
|
|
1117
1126
|
pipeline: t.Optional[str] = None,
|
|
1118
1127
|
pretty: t.Optional[bool] = None,
|
|
1119
1128
|
refresh: t.Optional[
|
|
1120
1129
|
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
1121
1130
|
] = None,
|
|
1131
|
+
require_alias: t.Optional[bool] = None,
|
|
1132
|
+
require_data_stream: t.Optional[bool] = None,
|
|
1122
1133
|
routing: t.Optional[str] = None,
|
|
1123
1134
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1124
1135
|
version: t.Optional[int] = None,
|
|
@@ -1163,7 +1174,7 @@ class Elasticsearch(BaseClient):
|
|
|
1163
1174
|
This does come at the (very minimal) cost of an additional document parsing pass.
|
|
1164
1175
|
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>
|
|
1165
1176
|
<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>
|
|
1166
|
-
<p
|
|
1177
|
+
<p><strong>Distributed</strong></p>
|
|
1167
1178
|
<p>The index operation is directed to the primary shard based on its route and performed on the actual node containing this shard.
|
|
1168
1179
|
After the primary shard completes the operation, if needed, the update is distributed to applicable replicas.</p>
|
|
1169
1180
|
<p><strong>Active shards</strong></p>
|
|
@@ -1186,7 +1197,7 @@ class Elasticsearch(BaseClient):
|
|
|
1186
1197
|
The <code>_shards</code> section of the API response reveals the number of shard copies on which replication succeeded and failed.</p>
|
|
1187
1198
|
|
|
1188
1199
|
|
|
1189
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1200
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-index_.html>`_
|
|
1190
1201
|
|
|
1191
1202
|
:param index: The name of the data stream or index to target. If the target doesn't
|
|
1192
1203
|
exist and matches the name or wildcard (`*`) pattern of an index template
|
|
@@ -1196,6 +1207,18 @@ class Elasticsearch(BaseClient):
|
|
|
1196
1207
|
:param id: A unique identifier for the document. To automatically generate a
|
|
1197
1208
|
document ID, use the `POST /<target>/_doc/` request format.
|
|
1198
1209
|
:param document:
|
|
1210
|
+
:param if_primary_term: Only perform the operation if the document has this primary
|
|
1211
|
+
term.
|
|
1212
|
+
:param if_seq_no: Only perform the operation if the document has this sequence
|
|
1213
|
+
number.
|
|
1214
|
+
:param include_source_on_error: True or false if to include the document source
|
|
1215
|
+
in the error message in case of parsing errors.
|
|
1216
|
+
:param op_type: Set to `create` to only index the document if it does not already
|
|
1217
|
+
exist (put if absent). If a document with the specified `_id` already exists,
|
|
1218
|
+
the indexing operation will fail. The behavior is the same as using the `<index>/_create`
|
|
1219
|
+
endpoint. If a document ID is specified, this paramater defaults to `index`.
|
|
1220
|
+
Otherwise, it defaults to `create`. If the request targets a data stream,
|
|
1221
|
+
an `op_type` of `create` is required.
|
|
1199
1222
|
:param pipeline: The ID of the pipeline to use to preprocess incoming documents.
|
|
1200
1223
|
If the index has a default ingest pipeline specified, setting the value to
|
|
1201
1224
|
`_none` turns off the default ingest pipeline for this request. If a final
|
|
@@ -1204,6 +1227,9 @@ class Elasticsearch(BaseClient):
|
|
|
1204
1227
|
:param refresh: If `true`, Elasticsearch refreshes the affected shards to make
|
|
1205
1228
|
this operation visible to search. If `wait_for`, it waits for a refresh to
|
|
1206
1229
|
make this operation visible to search. If `false`, it does nothing with refreshes.
|
|
1230
|
+
:param require_alias: If `true`, the destination must be an index alias.
|
|
1231
|
+
:param require_data_stream: If `true`, the request's actions must target a data
|
|
1232
|
+
stream (existing or to be created).
|
|
1207
1233
|
:param routing: A custom value that is used to route operations to a specific
|
|
1208
1234
|
shard.
|
|
1209
1235
|
:param timeout: The period the request waits for the following operations: automatic
|
|
@@ -1244,12 +1270,24 @@ class Elasticsearch(BaseClient):
|
|
|
1244
1270
|
__query["filter_path"] = filter_path
|
|
1245
1271
|
if human is not None:
|
|
1246
1272
|
__query["human"] = human
|
|
1273
|
+
if if_primary_term is not None:
|
|
1274
|
+
__query["if_primary_term"] = if_primary_term
|
|
1275
|
+
if if_seq_no is not None:
|
|
1276
|
+
__query["if_seq_no"] = if_seq_no
|
|
1277
|
+
if include_source_on_error is not None:
|
|
1278
|
+
__query["include_source_on_error"] = include_source_on_error
|
|
1279
|
+
if op_type is not None:
|
|
1280
|
+
__query["op_type"] = op_type
|
|
1247
1281
|
if pipeline is not None:
|
|
1248
1282
|
__query["pipeline"] = pipeline
|
|
1249
1283
|
if pretty is not None:
|
|
1250
1284
|
__query["pretty"] = pretty
|
|
1251
1285
|
if refresh is not None:
|
|
1252
1286
|
__query["refresh"] = refresh
|
|
1287
|
+
if require_alias is not None:
|
|
1288
|
+
__query["require_alias"] = require_alias
|
|
1289
|
+
if require_data_stream is not None:
|
|
1290
|
+
__query["require_data_stream"] = require_data_stream
|
|
1253
1291
|
if routing is not None:
|
|
1254
1292
|
__query["routing"] = routing
|
|
1255
1293
|
if timeout is not None:
|
|
@@ -1326,7 +1364,7 @@ class Elasticsearch(BaseClient):
|
|
|
1326
1364
|
It then gets redirected into the primary shard within that ID group and replicated (if needed) to shard replicas within that ID group.</p>
|
|
1327
1365
|
|
|
1328
1366
|
|
|
1329
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1367
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-delete.html>`_
|
|
1330
1368
|
|
|
1331
1369
|
:param index: The name of the target index.
|
|
1332
1370
|
:param id: A unique identifier for the document.
|
|
@@ -1515,7 +1553,7 @@ class Elasticsearch(BaseClient):
|
|
|
1515
1553
|
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>
|
|
1516
1554
|
|
|
1517
1555
|
|
|
1518
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1556
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-delete-by-query.html>`_
|
|
1519
1557
|
|
|
1520
1558
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
1521
1559
|
search. It supports wildcards (`*`). To search all data streams or indices,
|
|
@@ -1541,7 +1579,7 @@ class Elasticsearch(BaseClient):
|
|
|
1541
1579
|
If the request can target data streams, this argument determines whether
|
|
1542
1580
|
wildcard expressions match hidden data streams. It supports comma-separated
|
|
1543
1581
|
values, such as `open,hidden`.
|
|
1544
|
-
:param from_:
|
|
1582
|
+
:param from_: Skips the specified number of documents.
|
|
1545
1583
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
1546
1584
|
a missing or closed index.
|
|
1547
1585
|
:param lenient: If `true`, format-based query failures (such as providing text
|
|
@@ -1712,7 +1750,7 @@ class Elasticsearch(BaseClient):
|
|
|
1712
1750
|
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>
|
|
1713
1751
|
|
|
1714
1752
|
|
|
1715
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1753
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-delete-by-query.html#docs-delete-by-query-rethrottle>`_
|
|
1716
1754
|
|
|
1717
1755
|
:param task_id: The ID for the task.
|
|
1718
1756
|
:param requests_per_second: The throttle for this request in sub-requests per
|
|
@@ -1762,7 +1800,7 @@ class Elasticsearch(BaseClient):
|
|
|
1762
1800
|
Deletes a stored script or search template.</p>
|
|
1763
1801
|
|
|
1764
1802
|
|
|
1765
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1803
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/delete-stored-script-api.html>`_
|
|
1766
1804
|
|
|
1767
1805
|
:param id: The identifier for the stored script or search template.
|
|
1768
1806
|
:param master_timeout: The period to wait for a connection to the master node.
|
|
@@ -1846,7 +1884,7 @@ class Elasticsearch(BaseClient):
|
|
|
1846
1884
|
Elasticsearch cleans up deleted documents in the background as you continue to index more data.</p>
|
|
1847
1885
|
|
|
1848
1886
|
|
|
1849
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1887
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-get.html>`_
|
|
1850
1888
|
|
|
1851
1889
|
:param index: A comma-separated list of data streams, indices, and aliases. It
|
|
1852
1890
|
supports wildcards (`*`).
|
|
@@ -1969,7 +2007,7 @@ class Elasticsearch(BaseClient):
|
|
|
1969
2007
|
<p>A document's source is not available if it is disabled in the mapping.</p>
|
|
1970
2008
|
|
|
1971
2009
|
|
|
1972
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2010
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-get.html>`_
|
|
1973
2011
|
|
|
1974
2012
|
:param index: A comma-separated list of data streams, indices, and aliases. It
|
|
1975
2013
|
supports wildcards (`*`).
|
|
@@ -2075,7 +2113,7 @@ class Elasticsearch(BaseClient):
|
|
|
2075
2113
|
It computes a score explanation for a query and a specific document.</p>
|
|
2076
2114
|
|
|
2077
2115
|
|
|
2078
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2116
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/search-explain.html>`_
|
|
2079
2117
|
|
|
2080
2118
|
:param index: Index names that are used to limit the request. Only a single index
|
|
2081
2119
|
name can be provided to this parameter.
|
|
@@ -2210,7 +2248,7 @@ class Elasticsearch(BaseClient):
|
|
|
2210
2248
|
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>
|
|
2211
2249
|
|
|
2212
2250
|
|
|
2213
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2251
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/search-field-caps.html>`_
|
|
2214
2252
|
|
|
2215
2253
|
:param index: A comma-separated list of data streams, indices, and aliases used
|
|
2216
2254
|
to limit the request. Supports wildcards (*). To target all data streams
|
|
@@ -2371,7 +2409,7 @@ class Elasticsearch(BaseClient):
|
|
|
2371
2409
|
Elasticsearch cleans up deleted documents in the background as you continue to index more data.</p>
|
|
2372
2410
|
|
|
2373
2411
|
|
|
2374
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2412
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-get.html>`_
|
|
2375
2413
|
|
|
2376
2414
|
:param index: The name of the index that contains the document.
|
|
2377
2415
|
:param id: A unique document identifier.
|
|
@@ -2478,7 +2516,7 @@ class Elasticsearch(BaseClient):
|
|
|
2478
2516
|
Retrieves a stored script or search template.</p>
|
|
2479
2517
|
|
|
2480
2518
|
|
|
2481
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2519
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/get-stored-script-api.html>`_
|
|
2482
2520
|
|
|
2483
2521
|
:param id: The identifier for the stored script or search template.
|
|
2484
2522
|
:param master_timeout: The period to wait for the master node. If the master
|
|
@@ -2527,7 +2565,7 @@ class Elasticsearch(BaseClient):
|
|
|
2527
2565
|
<p>Get a list of supported script contexts and their methods.</p>
|
|
2528
2566
|
|
|
2529
2567
|
|
|
2530
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2568
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/get-script-contexts-api.html>`_
|
|
2531
2569
|
"""
|
|
2532
2570
|
__path_parts: t.Dict[str, str] = {}
|
|
2533
2571
|
__path = "/_script_context"
|
|
@@ -2566,7 +2604,7 @@ class Elasticsearch(BaseClient):
|
|
|
2566
2604
|
<p>Get a list of available script types, languages, and contexts.</p>
|
|
2567
2605
|
|
|
2568
2606
|
|
|
2569
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2607
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/get-script-languages-api.html>`_
|
|
2570
2608
|
"""
|
|
2571
2609
|
__path_parts: t.Dict[str, str] = {}
|
|
2572
2610
|
__path = "/_script_language"
|
|
@@ -2631,7 +2669,7 @@ class Elasticsearch(BaseClient):
|
|
|
2631
2669
|
</code></pre>
|
|
2632
2670
|
|
|
2633
2671
|
|
|
2634
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2672
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-get.html>`_
|
|
2635
2673
|
|
|
2636
2674
|
:param index: The name of the index that contains the document.
|
|
2637
2675
|
:param id: A unique document identifier.
|
|
@@ -2731,7 +2769,7 @@ class Elasticsearch(BaseClient):
|
|
|
2731
2769
|
When setting up automated polling of the API for health status, set verbose to false to disable the more expensive analysis logic.</p>
|
|
2732
2770
|
|
|
2733
2771
|
|
|
2734
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2772
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/health-api.html>`_
|
|
2735
2773
|
|
|
2736
2774
|
:param feature: A feature of the cluster, as returned by the top-level health
|
|
2737
2775
|
report API.
|
|
@@ -2786,6 +2824,7 @@ class Elasticsearch(BaseClient):
|
|
|
2786
2824
|
human: t.Optional[bool] = None,
|
|
2787
2825
|
if_primary_term: t.Optional[int] = None,
|
|
2788
2826
|
if_seq_no: t.Optional[int] = None,
|
|
2827
|
+
include_source_on_error: t.Optional[bool] = None,
|
|
2789
2828
|
op_type: t.Optional[t.Union[str, t.Literal["create", "index"]]] = None,
|
|
2790
2829
|
pipeline: t.Optional[str] = None,
|
|
2791
2830
|
pretty: t.Optional[bool] = None,
|
|
@@ -2842,9 +2881,7 @@ class Elasticsearch(BaseClient):
|
|
|
2842
2881
|
This does come at the (very minimal) cost of an additional document parsing pass.
|
|
2843
2882
|
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>
|
|
2844
2883
|
<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>
|
|
2845
|
-
<
|
|
2846
|
-
<li>** Distributed**</li>
|
|
2847
|
-
</ul>
|
|
2884
|
+
<p><strong>Distributed</strong></p>
|
|
2848
2885
|
<p>The index operation is directed to the primary shard based on its route and performed on the actual node containing this shard.
|
|
2849
2886
|
After the primary shard completes the operation, if needed, the update is distributed to applicable replicas.</p>
|
|
2850
2887
|
<p><strong>Active shards</strong></p>
|
|
@@ -2897,7 +2934,7 @@ class Elasticsearch(BaseClient):
|
|
|
2897
2934
|
</code></pre>
|
|
2898
2935
|
|
|
2899
2936
|
|
|
2900
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2937
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-index_.html>`_
|
|
2901
2938
|
|
|
2902
2939
|
:param index: The name of the data stream or index to target. If the target doesn't
|
|
2903
2940
|
exist and matches the name or wildcard (`*`) pattern of an index template
|
|
@@ -2913,6 +2950,8 @@ class Elasticsearch(BaseClient):
|
|
|
2913
2950
|
term.
|
|
2914
2951
|
:param if_seq_no: Only perform the operation if the document has this sequence
|
|
2915
2952
|
number.
|
|
2953
|
+
:param include_source_on_error: True or false if to include the document source
|
|
2954
|
+
in the error message in case of parsing errors.
|
|
2916
2955
|
:param op_type: Set to `create` to only index the document if it does not already
|
|
2917
2956
|
exist (put if absent). If a document with the specified `_id` already exists,
|
|
2918
2957
|
the indexing operation will fail. The behavior is the same as using the `<index>/_create`
|
|
@@ -2977,6 +3016,8 @@ class Elasticsearch(BaseClient):
|
|
|
2977
3016
|
__query["if_primary_term"] = if_primary_term
|
|
2978
3017
|
if if_seq_no is not None:
|
|
2979
3018
|
__query["if_seq_no"] = if_seq_no
|
|
3019
|
+
if include_source_on_error is not None:
|
|
3020
|
+
__query["include_source_on_error"] = include_source_on_error
|
|
2980
3021
|
if op_type is not None:
|
|
2981
3022
|
__query["op_type"] = op_type
|
|
2982
3023
|
if pipeline is not None:
|
|
@@ -3025,7 +3066,7 @@ class Elasticsearch(BaseClient):
|
|
|
3025
3066
|
Get basic build, version, and cluster information.</p>
|
|
3026
3067
|
|
|
3027
3068
|
|
|
3028
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3069
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/rest-api-root.html>`_
|
|
3029
3070
|
"""
|
|
3030
3071
|
__path_parts: t.Dict[str, str] = {}
|
|
3031
3072
|
__path = "/"
|
|
@@ -3099,7 +3140,7 @@ class Elasticsearch(BaseClient):
|
|
|
3099
3140
|
</ul>
|
|
3100
3141
|
|
|
3101
3142
|
|
|
3102
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3143
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/knn-search-api.html>`_
|
|
3103
3144
|
|
|
3104
3145
|
:param index: A comma-separated list of index names to search; use `_all` or
|
|
3105
3146
|
to perform the operation on all indices.
|
|
@@ -3215,7 +3256,7 @@ class Elasticsearch(BaseClient):
|
|
|
3215
3256
|
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>
|
|
3216
3257
|
|
|
3217
3258
|
|
|
3218
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3259
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-multi-get.html>`_
|
|
3219
3260
|
|
|
3220
3261
|
:param index: Name of the index to retrieve documents from when `ids` are specified,
|
|
3221
3262
|
or when a document in the `docs` array does not specify an index.
|
|
@@ -3350,7 +3391,7 @@ class Elasticsearch(BaseClient):
|
|
|
3350
3391
|
When sending requests to this endpoint the <code>Content-Type</code> header should be set to <code>application/x-ndjson</code>.</p>
|
|
3351
3392
|
|
|
3352
3393
|
|
|
3353
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3394
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/search-multi-search.html>`_
|
|
3354
3395
|
|
|
3355
3396
|
:param searches:
|
|
3356
3397
|
:param index: Comma-separated list of data streams, indices, and index aliases
|
|
@@ -3496,7 +3537,7 @@ class Elasticsearch(BaseClient):
|
|
|
3496
3537
|
</code></pre>
|
|
3497
3538
|
|
|
3498
3539
|
|
|
3499
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3540
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/multi-search-template.html>`_
|
|
3500
3541
|
|
|
3501
3542
|
:param search_templates:
|
|
3502
3543
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
@@ -3601,7 +3642,7 @@ class Elasticsearch(BaseClient):
|
|
|
3601
3642
|
The mapping used is determined by the specified <code>_index</code>.</p>
|
|
3602
3643
|
|
|
3603
3644
|
|
|
3604
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3645
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-multi-termvectors.html>`_
|
|
3605
3646
|
|
|
3606
3647
|
:param index: The name of the index that contains the documents.
|
|
3607
3648
|
:param docs: An array of existing or artificial documents.
|
|
@@ -3705,6 +3746,7 @@ class Elasticsearch(BaseClient):
|
|
|
3705
3746
|
human: t.Optional[bool] = None,
|
|
3706
3747
|
ignore_unavailable: t.Optional[bool] = None,
|
|
3707
3748
|
index_filter: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
3749
|
+
max_concurrent_shard_requests: t.Optional[int] = None,
|
|
3708
3750
|
preference: t.Optional[str] = None,
|
|
3709
3751
|
pretty: t.Optional[bool] = None,
|
|
3710
3752
|
routing: t.Optional[str] = None,
|
|
@@ -3741,7 +3783,7 @@ class Elasticsearch(BaseClient):
|
|
|
3741
3783
|
You can check how many point-in-times (that is, search contexts) are open with the nodes stats API.</p>
|
|
3742
3784
|
|
|
3743
3785
|
|
|
3744
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3786
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/point-in-time-api.html>`_
|
|
3745
3787
|
|
|
3746
3788
|
:param index: A comma-separated list of index names to open point in time; use
|
|
3747
3789
|
`_all` or empty string to perform the operation on all indices
|
|
@@ -3760,6 +3802,8 @@ class Elasticsearch(BaseClient):
|
|
|
3760
3802
|
a missing or closed index.
|
|
3761
3803
|
:param index_filter: Filter indices if the provided query rewrites to `match_none`
|
|
3762
3804
|
on every shard.
|
|
3805
|
+
:param max_concurrent_shard_requests: Maximum number of concurrent shard requests
|
|
3806
|
+
that each sub-search request executes per node.
|
|
3763
3807
|
:param preference: The node or shard the operation should be performed on. By
|
|
3764
3808
|
default, it is random.
|
|
3765
3809
|
:param routing: A custom value that is used to route operations to a specific
|
|
@@ -3787,6 +3831,8 @@ class Elasticsearch(BaseClient):
|
|
|
3787
3831
|
__query["human"] = human
|
|
3788
3832
|
if ignore_unavailable is not None:
|
|
3789
3833
|
__query["ignore_unavailable"] = ignore_unavailable
|
|
3834
|
+
if max_concurrent_shard_requests is not None:
|
|
3835
|
+
__query["max_concurrent_shard_requests"] = max_concurrent_shard_requests
|
|
3790
3836
|
if preference is not None:
|
|
3791
3837
|
__query["preference"] = preference
|
|
3792
3838
|
if pretty is not None:
|
|
@@ -3835,7 +3881,7 @@ class Elasticsearch(BaseClient):
|
|
|
3835
3881
|
Creates or updates a stored script or search template.</p>
|
|
3836
3882
|
|
|
3837
3883
|
|
|
3838
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3884
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/create-stored-script-api.html>`_
|
|
3839
3885
|
|
|
3840
3886
|
:param id: The identifier for the stored script or search template. It must be
|
|
3841
3887
|
unique within the cluster.
|
|
@@ -3925,7 +3971,7 @@ class Elasticsearch(BaseClient):
|
|
|
3925
3971
|
<p>Evaluate the quality of ranked search results over a set of typical search queries.</p>
|
|
3926
3972
|
|
|
3927
3973
|
|
|
3928
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3974
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/search-rank-eval.html>`_
|
|
3929
3975
|
|
|
3930
3976
|
:param requests: A set of typical search requests, together with their provided
|
|
3931
3977
|
ratings.
|
|
@@ -4073,7 +4119,7 @@ class Elasticsearch(BaseClient):
|
|
|
4073
4119
|
}'
|
|
4074
4120
|
done
|
|
4075
4121
|
</code></pre>
|
|
4076
|
-
<p
|
|
4122
|
+
<p><strong>Throttling</strong></p>
|
|
4077
4123
|
<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.
|
|
4078
4124
|
Requests are throttled by padding each batch with a wait time.
|
|
4079
4125
|
To turn off throttling, set <code>requests_per_second</code> to <code>-1</code>.</p>
|
|
@@ -4157,7 +4203,7 @@ class Elasticsearch(BaseClient):
|
|
|
4157
4203
|
It is not possible to configure SSL in the body of the reindex request.</p>
|
|
4158
4204
|
|
|
4159
4205
|
|
|
4160
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4206
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-reindex.html>`_
|
|
4161
4207
|
|
|
4162
4208
|
:param dest: The destination you are copying to.
|
|
4163
4209
|
:param source: The source you are copying from.
|
|
@@ -4281,7 +4327,7 @@ class Elasticsearch(BaseClient):
|
|
|
4281
4327
|
This behavior prevents scroll timeouts.</p>
|
|
4282
4328
|
|
|
4283
4329
|
|
|
4284
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4330
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-reindex.html>`_
|
|
4285
4331
|
|
|
4286
4332
|
:param task_id: The task identifier, which can be found by using the tasks API.
|
|
4287
4333
|
:param requests_per_second: The throttle for this request in sub-requests per
|
|
@@ -4337,7 +4383,7 @@ class Elasticsearch(BaseClient):
|
|
|
4337
4383
|
<p>Render a search template as a search request body.</p>
|
|
4338
4384
|
|
|
4339
4385
|
|
|
4340
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4386
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/render-search-template-api.html>`_
|
|
4341
4387
|
|
|
4342
4388
|
:param id: The ID of the search template to render. If no `source` is specified,
|
|
4343
4389
|
this or the `id` request body parameter is required.
|
|
@@ -4394,7 +4440,24 @@ class Elasticsearch(BaseClient):
|
|
|
4394
4440
|
def scripts_painless_execute(
|
|
4395
4441
|
self,
|
|
4396
4442
|
*,
|
|
4397
|
-
context: t.Optional[
|
|
4443
|
+
context: t.Optional[
|
|
4444
|
+
t.Union[
|
|
4445
|
+
str,
|
|
4446
|
+
t.Literal[
|
|
4447
|
+
"boolean_field",
|
|
4448
|
+
"composite_field",
|
|
4449
|
+
"date_field",
|
|
4450
|
+
"double_field",
|
|
4451
|
+
"filter",
|
|
4452
|
+
"geo_point_field",
|
|
4453
|
+
"ip_field",
|
|
4454
|
+
"keyword_field",
|
|
4455
|
+
"long_field",
|
|
4456
|
+
"painless_test",
|
|
4457
|
+
"score",
|
|
4458
|
+
],
|
|
4459
|
+
]
|
|
4460
|
+
] = None,
|
|
4398
4461
|
context_setup: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4399
4462
|
error_trace: t.Optional[bool] = None,
|
|
4400
4463
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
@@ -4406,15 +4469,22 @@ class Elasticsearch(BaseClient):
|
|
|
4406
4469
|
"""
|
|
4407
4470
|
.. raw:: html
|
|
4408
4471
|
|
|
4409
|
-
<p>Run a script
|
|
4410
|
-
Runs a script and returns a result
|
|
4472
|
+
<p>Run a script.</p>
|
|
4473
|
+
<p>Runs a script and returns a result.
|
|
4474
|
+
Use this API to build and test scripts, such as when defining a script for a runtime field.
|
|
4475
|
+
This API requires very few dependencies and is especially useful if you don't have permissions to write documents on a cluster.</p>
|
|
4476
|
+
<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>
|
|
4477
|
+
<p>Each context requires a script, but additional parameters depend on the context you're using for that script.</p>
|
|
4411
4478
|
|
|
4412
4479
|
|
|
4413
|
-
`<https://www.elastic.co/guide/en/elasticsearch/painless/8.
|
|
4480
|
+
`<https://www.elastic.co/guide/en/elasticsearch/painless/8.18/painless-execute-api.html>`_
|
|
4414
4481
|
|
|
4415
|
-
:param context: The context that the script should run in.
|
|
4416
|
-
|
|
4417
|
-
:param
|
|
4482
|
+
:param context: The context that the script should run in. NOTE: Result ordering
|
|
4483
|
+
in the field contexts is not guaranteed.
|
|
4484
|
+
:param context_setup: Additional parameters for the `context`. NOTE: This parameter
|
|
4485
|
+
is required for all contexts except `painless_test`, which is the default
|
|
4486
|
+
if no value is provided for `context`.
|
|
4487
|
+
:param script: The Painless script to run.
|
|
4418
4488
|
"""
|
|
4419
4489
|
__path_parts: t.Dict[str, str] = {}
|
|
4420
4490
|
__path = "/_scripts/painless/_execute"
|
|
@@ -4480,7 +4550,7 @@ class Elasticsearch(BaseClient):
|
|
|
4480
4550
|
<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>
|
|
4481
4551
|
|
|
4482
4552
|
|
|
4483
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4553
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/scroll-api.html>`_
|
|
4484
4554
|
|
|
4485
4555
|
:param scroll_id: The scroll ID of the search.
|
|
4486
4556
|
:param rest_total_hits_as_int: If true, the API response’s hit.total property
|
|
@@ -4686,7 +4756,7 @@ class Elasticsearch(BaseClient):
|
|
|
4686
4756
|
This situation can occur because the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index.</p>
|
|
4687
4757
|
|
|
4688
4758
|
|
|
4689
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4759
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/search-search.html>`_
|
|
4690
4760
|
|
|
4691
4761
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
4692
4762
|
search. It supports wildcards (`*`). To search all data streams and indices,
|
|
@@ -4765,7 +4835,7 @@ class Elasticsearch(BaseClient):
|
|
|
4765
4835
|
limit the impact of the search on the cluster in order to limit the number
|
|
4766
4836
|
of concurrent shard requests.
|
|
4767
4837
|
:param min_compatible_shard_node: The minimum version of the node that can handle
|
|
4768
|
-
the request
|
|
4838
|
+
the request Any handling node with a lower version will fail the request.
|
|
4769
4839
|
:param min_score: The minimum `_score` for matching documents. Documents with
|
|
4770
4840
|
a lower `_score` are not included in the search results.
|
|
4771
4841
|
:param pit: Limit the search to a point in time (PIT). If you provide a PIT,
|
|
@@ -5436,7 +5506,7 @@ class Elasticsearch(BaseClient):
|
|
|
5436
5506
|
Elasticsearch uses the H3 resolution that is closest to the corresponding geotile density.</p>
|
|
5437
5507
|
|
|
5438
5508
|
|
|
5439
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5509
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/search-vector-tile-api.html>`_
|
|
5440
5510
|
|
|
5441
5511
|
:param index: Comma-separated list of data streams, indices, or aliases to search
|
|
5442
5512
|
:param field: Field containing geospatial data to return
|
|
@@ -5595,6 +5665,7 @@ class Elasticsearch(BaseClient):
|
|
|
5595
5665
|
human: t.Optional[bool] = None,
|
|
5596
5666
|
ignore_unavailable: t.Optional[bool] = None,
|
|
5597
5667
|
local: t.Optional[bool] = None,
|
|
5668
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
5598
5669
|
preference: t.Optional[str] = None,
|
|
5599
5670
|
pretty: t.Optional[bool] = None,
|
|
5600
5671
|
routing: t.Optional[str] = None,
|
|
@@ -5609,7 +5680,7 @@ class Elasticsearch(BaseClient):
|
|
|
5609
5680
|
<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>
|
|
5610
5681
|
|
|
5611
5682
|
|
|
5612
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5683
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/search-shards.html>`_
|
|
5613
5684
|
|
|
5614
5685
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
5615
5686
|
search. It supports wildcards (`*`). To search all data streams and indices,
|
|
@@ -5627,6 +5698,10 @@ class Elasticsearch(BaseClient):
|
|
|
5627
5698
|
a missing or closed index.
|
|
5628
5699
|
:param local: If `true`, the request retrieves information from the local node
|
|
5629
5700
|
only.
|
|
5701
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
5702
|
+
If the master node is not available before the timeout expires, the request
|
|
5703
|
+
fails and returns an error. IT can also be set to `-1` to indicate that the
|
|
5704
|
+
request should never timeout.
|
|
5630
5705
|
:param preference: The node or shard the operation should be performed on. It
|
|
5631
5706
|
is random by default.
|
|
5632
5707
|
:param routing: A custom value used to route operations to a specific shard.
|
|
@@ -5653,6 +5728,8 @@ class Elasticsearch(BaseClient):
|
|
|
5653
5728
|
__query["ignore_unavailable"] = ignore_unavailable
|
|
5654
5729
|
if local is not None:
|
|
5655
5730
|
__query["local"] = local
|
|
5731
|
+
if master_timeout is not None:
|
|
5732
|
+
__query["master_timeout"] = master_timeout
|
|
5656
5733
|
if preference is not None:
|
|
5657
5734
|
__query["preference"] = preference
|
|
5658
5735
|
if pretty is not None:
|
|
@@ -5714,7 +5791,7 @@ class Elasticsearch(BaseClient):
|
|
|
5714
5791
|
<p>Run a search with a search template.</p>
|
|
5715
5792
|
|
|
5716
5793
|
|
|
5717
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5794
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/search-template-api.html>`_
|
|
5718
5795
|
|
|
5719
5796
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
5720
5797
|
search. It supports wildcards (`*`).
|
|
@@ -5857,7 +5934,7 @@ class Elasticsearch(BaseClient):
|
|
|
5857
5934
|
</blockquote>
|
|
5858
5935
|
|
|
5859
5936
|
|
|
5860
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5937
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/search-terms-enum.html>`_
|
|
5861
5938
|
|
|
5862
5939
|
:param index: A comma-separated list of data streams, indices, and index aliases
|
|
5863
5940
|
to search. Wildcard (`*`) expressions are supported. To search all data streams
|
|
@@ -5927,7 +6004,20 @@ class Elasticsearch(BaseClient):
|
|
|
5927
6004
|
)
|
|
5928
6005
|
|
|
5929
6006
|
@_rewrite_parameters(
|
|
5930
|
-
body_fields=(
|
|
6007
|
+
body_fields=(
|
|
6008
|
+
"doc",
|
|
6009
|
+
"field_statistics",
|
|
6010
|
+
"fields",
|
|
6011
|
+
"filter",
|
|
6012
|
+
"offsets",
|
|
6013
|
+
"payloads",
|
|
6014
|
+
"per_field_analyzer",
|
|
6015
|
+
"positions",
|
|
6016
|
+
"routing",
|
|
6017
|
+
"term_statistics",
|
|
6018
|
+
"version",
|
|
6019
|
+
"version_type",
|
|
6020
|
+
),
|
|
5931
6021
|
)
|
|
5932
6022
|
def termvectors(
|
|
5933
6023
|
self,
|
|
@@ -5993,7 +6083,7 @@ class Elasticsearch(BaseClient):
|
|
|
5993
6083
|
Use <code>routing</code> only to hit a particular shard.</p>
|
|
5994
6084
|
|
|
5995
6085
|
|
|
5996
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
6086
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-termvectors.html>`_
|
|
5997
6087
|
|
|
5998
6088
|
:param index: The name of the index that contains the document.
|
|
5999
6089
|
:param id: A unique identifier for the document.
|
|
@@ -6004,9 +6094,9 @@ class Elasticsearch(BaseClient):
|
|
|
6004
6094
|
(the sum of document frequencies for all terms in this field). * The sum
|
|
6005
6095
|
of total term frequencies (the sum of total term frequencies of each term
|
|
6006
6096
|
in this field).
|
|
6007
|
-
:param fields: A
|
|
6008
|
-
|
|
6009
|
-
|
|
6097
|
+
:param fields: A list of fields to include in the statistics. It is used as the
|
|
6098
|
+
default list unless a specific field list is provided in the `completion_fields`
|
|
6099
|
+
or `fielddata_fields` parameters.
|
|
6010
6100
|
:param filter: Filter terms based on their tf-idf scores. This could be useful
|
|
6011
6101
|
in order find out a good characteristic vector of a document. This feature
|
|
6012
6102
|
works in a similar manner to the second phase of the More Like This Query.
|
|
@@ -6044,41 +6134,41 @@ class Elasticsearch(BaseClient):
|
|
|
6044
6134
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
6045
6135
|
if error_trace is not None:
|
|
6046
6136
|
__query["error_trace"] = error_trace
|
|
6047
|
-
if field_statistics is not None:
|
|
6048
|
-
__query["field_statistics"] = field_statistics
|
|
6049
|
-
if fields is not None:
|
|
6050
|
-
__query["fields"] = fields
|
|
6051
6137
|
if filter_path is not None:
|
|
6052
6138
|
__query["filter_path"] = filter_path
|
|
6053
6139
|
if human is not None:
|
|
6054
6140
|
__query["human"] = human
|
|
6055
|
-
if offsets is not None:
|
|
6056
|
-
__query["offsets"] = offsets
|
|
6057
|
-
if payloads is not None:
|
|
6058
|
-
__query["payloads"] = payloads
|
|
6059
|
-
if positions is not None:
|
|
6060
|
-
__query["positions"] = positions
|
|
6061
6141
|
if preference is not None:
|
|
6062
6142
|
__query["preference"] = preference
|
|
6063
6143
|
if pretty is not None:
|
|
6064
6144
|
__query["pretty"] = pretty
|
|
6065
6145
|
if realtime is not None:
|
|
6066
6146
|
__query["realtime"] = realtime
|
|
6067
|
-
if routing is not None:
|
|
6068
|
-
__query["routing"] = routing
|
|
6069
|
-
if term_statistics is not None:
|
|
6070
|
-
__query["term_statistics"] = term_statistics
|
|
6071
|
-
if version is not None:
|
|
6072
|
-
__query["version"] = version
|
|
6073
|
-
if version_type is not None:
|
|
6074
|
-
__query["version_type"] = version_type
|
|
6075
6147
|
if not __body:
|
|
6076
6148
|
if doc is not None:
|
|
6077
6149
|
__body["doc"] = doc
|
|
6150
|
+
if field_statistics is not None:
|
|
6151
|
+
__body["field_statistics"] = field_statistics
|
|
6152
|
+
if fields is not None:
|
|
6153
|
+
__body["fields"] = fields
|
|
6078
6154
|
if filter is not None:
|
|
6079
6155
|
__body["filter"] = filter
|
|
6156
|
+
if offsets is not None:
|
|
6157
|
+
__body["offsets"] = offsets
|
|
6158
|
+
if payloads is not None:
|
|
6159
|
+
__body["payloads"] = payloads
|
|
6080
6160
|
if per_field_analyzer is not None:
|
|
6081
6161
|
__body["per_field_analyzer"] = per_field_analyzer
|
|
6162
|
+
if positions is not None:
|
|
6163
|
+
__body["positions"] = positions
|
|
6164
|
+
if routing is not None:
|
|
6165
|
+
__body["routing"] = routing
|
|
6166
|
+
if term_statistics is not None:
|
|
6167
|
+
__body["term_statistics"] = term_statistics
|
|
6168
|
+
if version is not None:
|
|
6169
|
+
__body["version"] = version
|
|
6170
|
+
if version_type is not None:
|
|
6171
|
+
__body["version_type"] = version_type
|
|
6082
6172
|
if not __body:
|
|
6083
6173
|
__body = None # type: ignore[assignment]
|
|
6084
6174
|
__headers = {"accept": "application/json"}
|
|
@@ -6123,6 +6213,7 @@ class Elasticsearch(BaseClient):
|
|
|
6123
6213
|
human: t.Optional[bool] = None,
|
|
6124
6214
|
if_primary_term: t.Optional[int] = None,
|
|
6125
6215
|
if_seq_no: t.Optional[int] = None,
|
|
6216
|
+
include_source_on_error: t.Optional[bool] = None,
|
|
6126
6217
|
lang: t.Optional[str] = None,
|
|
6127
6218
|
pretty: t.Optional[bool] = None,
|
|
6128
6219
|
refresh: t.Optional[
|
|
@@ -6163,7 +6254,7 @@ class Elasticsearch(BaseClient):
|
|
|
6163
6254
|
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>
|
|
6164
6255
|
|
|
6165
6256
|
|
|
6166
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
6257
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-update.html>`_
|
|
6167
6258
|
|
|
6168
6259
|
:param index: The name of the target index. By default, the index is created
|
|
6169
6260
|
automatically if it doesn't exist.
|
|
@@ -6178,6 +6269,8 @@ class Elasticsearch(BaseClient):
|
|
|
6178
6269
|
term.
|
|
6179
6270
|
:param if_seq_no: Only perform the operation if the document has this sequence
|
|
6180
6271
|
number.
|
|
6272
|
+
:param include_source_on_error: True or false if to include the document source
|
|
6273
|
+
in the error message in case of parsing errors.
|
|
6181
6274
|
:param lang: The script language.
|
|
6182
6275
|
:param refresh: If 'true', Elasticsearch refreshes the affected shards to make
|
|
6183
6276
|
this operation visible to search. If 'wait_for', it waits for a refresh to
|
|
@@ -6222,6 +6315,8 @@ class Elasticsearch(BaseClient):
|
|
|
6222
6315
|
__query["if_primary_term"] = if_primary_term
|
|
6223
6316
|
if if_seq_no is not None:
|
|
6224
6317
|
__query["if_seq_no"] = if_seq_no
|
|
6318
|
+
if include_source_on_error is not None:
|
|
6319
|
+
__query["include_source_on_error"] = include_source_on_error
|
|
6225
6320
|
if lang is not None:
|
|
6226
6321
|
__query["lang"] = lang
|
|
6227
6322
|
if pretty is not None:
|
|
@@ -6397,7 +6492,7 @@ class Elasticsearch(BaseClient):
|
|
|
6397
6492
|
This API enables you to only modify the source of matching documents; you cannot move them.</p>
|
|
6398
6493
|
|
|
6399
6494
|
|
|
6400
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
6495
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-update-by-query.html>`_
|
|
6401
6496
|
|
|
6402
6497
|
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
6403
6498
|
search. It supports wildcards (`*`). To search all data streams or indices,
|
|
@@ -6424,7 +6519,7 @@ class Elasticsearch(BaseClient):
|
|
|
6424
6519
|
wildcard expressions match hidden data streams. It supports comma-separated
|
|
6425
6520
|
values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`,
|
|
6426
6521
|
`hidden`, `none`.
|
|
6427
|
-
:param from_:
|
|
6522
|
+
:param from_: Skips the specified number of documents.
|
|
6428
6523
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
6429
6524
|
a missing or closed index.
|
|
6430
6525
|
:param lenient: If `true`, format-based query failures (such as providing text
|
|
@@ -6617,7 +6712,7 @@ class Elasticsearch(BaseClient):
|
|
|
6617
6712
|
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>
|
|
6618
6713
|
|
|
6619
6714
|
|
|
6620
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
6715
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docs-update-by-query.html#docs-update-by-query-rethrottle>`_
|
|
6621
6716
|
|
|
6622
6717
|
:param task_id: The ID for the task.
|
|
6623
6718
|
:param requests_per_second: The throttle for this request in sub-requests per
|