Skip to content

Commit bca0a67

Browse files
committed
API: Update Elasticsearch APIs for 8.0.0
1 parent bc82264 commit bca0a67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2322
-706
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ async def close(self):
262262
async def ping(self, params=None, headers=None):
263263
"""
264264
Returns whether the cluster is running.
265+
265266
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html>`_
266267
"""
267268
try:
@@ -275,6 +276,7 @@ async def ping(self, params=None, headers=None):
275276
async def info(self, params=None, headers=None):
276277
"""
277278
Returns basic information about the cluster.
279+
278280
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html>`_
279281
"""
280282
return await self.transport.perform_request(
@@ -294,6 +296,7 @@ async def create(self, index, id, body, doc_type=None, params=None, headers=None
294296
"""
295297
Creates a new document in the index. Returns a 409 response when a document
296298
with a same ID already exists in the index.
299+
297300
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html>`_
298301
299302
:arg index: The name of the index
@@ -350,6 +353,7 @@ async def create(self, index, id, body, doc_type=None, params=None, headers=None
350353
async def index(self, index, body, id=None, params=None, headers=None):
351354
"""
352355
Creates or updates a document in an index.
356+
353357
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html>`_
354358
355359
:arg index: The name of the index
@@ -409,6 +413,7 @@ async def index(self, index, body, id=None, params=None, headers=None):
409413
async def bulk(self, body, index=None, doc_type=None, params=None, headers=None):
410414
"""
411415
Allows to perform multiple index/update/delete operations in a single request.
416+
412417
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html>`_
413418
414419
:arg body: The operation definition and data (action-data
@@ -455,6 +460,7 @@ async def bulk(self, body, index=None, doc_type=None, params=None, headers=None)
455460
async def clear_scroll(self, body=None, scroll_id=None, params=None, headers=None):
456461
"""
457462
Explicitly clears the search context for a scroll.
463+
458464
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-scroll-api.html>`_
459465
460466
:arg body: A comma-separated list of scroll IDs to clear if none
@@ -491,6 +497,7 @@ async def clear_scroll(self, body=None, scroll_id=None, params=None, headers=Non
491497
async def count(self, body=None, index=None, params=None, headers=None):
492498
"""
493499
Returns number of documents matching a query.
500+
494501
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html>`_
495502
496503
:arg body: A query to restrict the results specified with the
@@ -546,6 +553,7 @@ async def count(self, body=None, index=None, params=None, headers=None):
546553
async def delete(self, index, id, doc_type=None, params=None, headers=None):
547554
"""
548555
Removes a document from the index.
556+
549557
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html>`_
550558
551559
:arg index: The name of the index
@@ -620,6 +628,7 @@ async def delete(self, index, id, doc_type=None, params=None, headers=None):
620628
async def delete_by_query(self, index, body, params=None, headers=None):
621629
"""
622630
Deletes documents matching the provided query.
631+
623632
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html>`_
624633
625634
:arg index: A comma-separated list of index names to search; use
@@ -713,6 +722,7 @@ async def delete_by_query_rethrottle(self, task_id, params=None, headers=None):
713722
"""
714723
Changes the number of requests per second for a particular Delete By Query
715724
operation.
725+
716726
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html>`_
717727
718728
:arg task_id: The task id to rethrottle
@@ -733,6 +743,7 @@ async def delete_by_query_rethrottle(self, task_id, params=None, headers=None):
733743
async def delete_script(self, id, params=None, headers=None):
734744
"""
735745
Deletes a script.
746+
736747
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
737748
738749
:arg id: Script ID
@@ -761,6 +772,7 @@ async def delete_script(self, id, params=None, headers=None):
761772
async def exists(self, index, id, params=None, headers=None):
762773
"""
763774
Returns information about whether a document exists in an index.
775+
764776
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_
765777
766778
:arg index: The name of the index
@@ -806,6 +818,7 @@ async def exists(self, index, id, params=None, headers=None):
806818
async def exists_source(self, index, id, doc_type=None, params=None, headers=None):
807819
"""
808820
Returns information about whether a document source exists in an index.
821+
809822
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_
810823
811824
:arg index: The name of the index
@@ -857,6 +870,7 @@ async def exists_source(self, index, id, doc_type=None, params=None, headers=Non
857870
async def explain(self, index, id, body=None, params=None, headers=None):
858871
"""
859872
Returns information about why a specific matches (or doesn't match) a query.
873+
860874
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html>`_
861875
862876
:arg index: The name of the index
@@ -907,6 +921,7 @@ async def field_caps(self, body=None, index=None, params=None, headers=None):
907921
"""
908922
Returns the information about the capabilities of fields among multiple
909923
indices.
924+
910925
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html>`_
911926
912927
:arg body: An index filter specified with the Query DSL
@@ -947,6 +962,7 @@ async def field_caps(self, body=None, index=None, params=None, headers=None):
947962
async def get(self, index, id, params=None, headers=None):
948963
"""
949964
Returns a document.
965+
950966
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_
951967
952968
:arg index: The name of the index
@@ -982,6 +998,7 @@ async def get(self, index, id, params=None, headers=None):
982998
async def get_script(self, id, params=None, headers=None):
983999
"""
9841000
Returns a script.
1001+
9851002
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
9861003
9871004
:arg id: Script ID
@@ -1008,6 +1025,7 @@ async def get_script(self, id, params=None, headers=None):
10081025
async def get_source(self, index, id, params=None, headers=None):
10091026
"""
10101027
Returns the source of a document.
1028+
10111029
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_
10121030
10131031
:arg index: The name of the index
@@ -1050,6 +1068,7 @@ async def get_source(self, index, id, params=None, headers=None):
10501068
async def mget(self, body, index=None, params=None, headers=None):
10511069
"""
10521070
Allows to get multiple documents in one request.
1071+
10531072
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html>`_
10541073
10551074
:arg body: Document identifiers; can be either `docs`
@@ -1095,6 +1114,7 @@ async def mget(self, body, index=None, params=None, headers=None):
10951114
async def msearch(self, body, index=None, params=None, headers=None):
10961115
"""
10971116
Allows to execute several search operations in one request.
1117+
10981118
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html>`_
10991119
11001120
:arg body: The request definitions (metadata-search request
@@ -1141,6 +1161,7 @@ async def msearch(self, body, index=None, params=None, headers=None):
11411161
async def put_script(self, id, body, context=None, params=None, headers=None):
11421162
"""
11431163
Creates or updates a script.
1164+
11441165
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
11451166
11461167
:arg id: Script ID
@@ -1168,6 +1189,7 @@ async def rank_eval(self, body, index=None, params=None, headers=None):
11681189
"""
11691190
Allows to evaluate the quality of ranked search results over a set of typical
11701191
search queries
1192+
11711193
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html>`_
11721194
11731195
:arg body: The ranking evaluation search definition, including
@@ -1211,6 +1233,7 @@ async def reindex(self, body, params=None, headers=None):
12111233
Allows to copy documents from one index to another, optionally filtering the
12121234
source documents by a query, changing the destination index settings, or
12131235
fetching the documents from a remote cluster.
1236+
12141237
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html>`_
12151238
12161239
:arg body: The search definition using the Query DSL and the
@@ -1246,6 +1269,7 @@ async def reindex(self, body, params=None, headers=None):
12461269
async def reindex_rethrottle(self, task_id, params=None, headers=None):
12471270
"""
12481271
Changes the number of requests per second for a particular Reindex operation.
1272+
12491273
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html>`_
12501274
12511275
:arg task_id: The task id to rethrottle
@@ -1268,6 +1292,7 @@ async def render_search_template(
12681292
):
12691293
"""
12701294
Allows to use the Mustache language to pre-render a search definition.
1295+
12711296
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html#_validating_templates>`_
12721297
12731298
:arg body: The search definition template and its params
@@ -1285,6 +1310,7 @@ async def render_search_template(
12851310
async def scripts_painless_execute(self, body=None, params=None, headers=None):
12861311
"""
12871312
Allows an arbitrary script to be executed and a result to be returned
1313+
12881314
`<https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html>`_
12891315
12901316
:arg body: The script to execute
@@ -1301,6 +1327,7 @@ async def scripts_painless_execute(self, body=None, params=None, headers=None):
13011327
async def scroll(self, body=None, scroll_id=None, params=None, headers=None):
13021328
"""
13031329
Allows to retrieve a large numbers of results from a single search request.
1330+
13041331
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll>`_
13051332
13061333
:arg body: The scroll ID if not passed by URL or query
@@ -1369,6 +1396,7 @@ async def scroll(self, body=None, scroll_id=None, params=None, headers=None):
13691396
async def search(self, body=None, index=None, params=None, headers=None):
13701397
"""
13711398
Returns results matching a query.
1399+
13721400
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html>`_
13731401
13741402
:arg body: The search definition using the Query DSL
@@ -1490,6 +1518,7 @@ async def search_shards(self, index=None, params=None, headers=None):
14901518
"""
14911519
Returns information about the indices and shards that a search request would be
14921520
executed against.
1521+
14931522
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html>`_
14941523
14951524
:arg index: A comma-separated list of index names to search; use
@@ -1529,6 +1558,7 @@ async def search_shards(self, index=None, params=None, headers=None):
15291558
async def update(self, index, id, body, doc_type=None, params=None, headers=None):
15301559
"""
15311560
Updates a document with a script or partial document.
1561+
15321562
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html>`_
15331563
15341564
:arg index: The name of the index
@@ -1583,6 +1613,7 @@ async def update_by_query_rethrottle(self, task_id, params=None, headers=None):
15831613
"""
15841614
Changes the number of requests per second for a particular Update By Query
15851615
operation.
1616+
15861617
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html>`_
15871618
15881619
:arg task_id: The task id to rethrottle
@@ -1603,6 +1634,7 @@ async def update_by_query_rethrottle(self, task_id, params=None, headers=None):
16031634
async def get_script_context(self, params=None, headers=None):
16041635
"""
16051636
Returns all script contexts.
1637+
16061638
`<https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html>`_
16071639
"""
16081640
return await self.transport.perform_request(
@@ -1613,6 +1645,7 @@ async def get_script_context(self, params=None, headers=None):
16131645
async def get_script_languages(self, params=None, headers=None):
16141646
"""
16151647
Returns available script types, languages and contexts
1648+
16161649
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
16171650
"""
16181651
return await self.transport.perform_request(
@@ -1629,6 +1662,7 @@ async def get_script_languages(self, params=None, headers=None):
16291662
async def msearch_template(self, body, index=None, params=None, headers=None):
16301663
"""
16311664
Allows to execute several search template operations in one request.
1665+
16321666
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html>`_
16331667
16341668
:arg body: The request definitions (metadata-search request
@@ -1677,6 +1711,7 @@ async def msearch_template(self, body, index=None, params=None, headers=None):
16771711
async def mtermvectors(self, body=None, index=None, params=None, headers=None):
16781712
"""
16791713
Returns multiple termvectors in one request.
1714+
16801715
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html>`_
16811716
16821717
:arg body: Define ids, documents, parameters or a list of
@@ -1741,6 +1776,7 @@ async def mtermvectors(self, body=None, index=None, params=None, headers=None):
17411776
async def search_template(self, body, index=None, params=None, headers=None):
17421777
"""
17431778
Allows to use the Mustache language to pre-render a search definition.
1779+
17441780
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html>`_
17451781
17461782
:arg body: The search definition template and its params
@@ -1803,6 +1839,7 @@ async def termvectors(self, index, body=None, id=None, params=None, headers=None
18031839
"""
18041840
Returns information and statistics about terms in the fields of a particular
18051841
document.
1842+
18061843
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html>`_
18071844
18081845
:arg index: The index in which the document resides.
@@ -1882,6 +1919,7 @@ async def update_by_query(self, index, body=None, params=None, headers=None):
18821919
"""
18831920
Performs an update on every document in the index without changing the source,
18841921
for example to pick up a mapping change.
1922+
18851923
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html>`_
18861924
18871925
:arg index: A comma-separated list of index names to search; use
@@ -1977,6 +2015,7 @@ async def update_by_query(self, index, body=None, params=None, headers=None):
19772015
async def close_point_in_time(self, body=None, params=None, headers=None):
19782016
"""
19792017
Close a point in time
2018+
19802019
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html>`_
19812020
19822021
:arg body: a point-in-time id to close
@@ -1991,6 +2030,7 @@ async def close_point_in_time(self, body=None, params=None, headers=None):
19912030
async def open_point_in_time(self, index=None, params=None, headers=None):
19922031
"""
19932032
Open a point in time that can be used in subsequent searches
2033+
19942034
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html>`_
19952035
19962036
:arg index: A comma-separated list of index names to open point

0 commit comments

Comments
 (0)