@@ -466,7 +466,8 @@ async def bulk(
466
466
] = None ,
467
467
) -> ObjectApiResponse [t .Any ]:
468
468
"""
469
- Allows to perform multiple index/update/delete operations in a single request.
469
+ Performs multiple indexing or delete operations in a single API call. This reduces
470
+ overhead and can greatly increase indexing speed.
470
471
471
472
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html>`_
472
473
@@ -556,7 +557,7 @@ async def clear_scroll(
556
557
body : t .Optional [t .Dict [str , t .Any ]] = None ,
557
558
) -> ObjectApiResponse [t .Any ]:
558
559
"""
559
- Explicitly clears the search context for a scroll .
560
+ Clears the search context and results for a scrolling search .
560
561
561
562
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-scroll-api.html>`_
562
563
@@ -599,7 +600,7 @@ async def close_point_in_time(
599
600
body : t .Optional [t .Dict [str , t .Any ]] = None ,
600
601
) -> ObjectApiResponse [t .Any ]:
601
602
"""
602
- Close a point in time
603
+ Closes a point-in- time.
603
604
604
605
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html>`_
605
606
@@ -790,8 +791,9 @@ async def create(
790
791
] = None ,
791
792
) -> ObjectApiResponse [t .Any ]:
792
793
"""
793
- Creates a new document in the index. Returns a 409 response when a document with
794
- a same ID already exists in the index.
794
+ Adds a JSON document to the specified data stream or index and makes it searchable.
795
+ If the target is an index and the document already exists, the request updates
796
+ the document and increments its version.
795
797
796
798
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html>`_
797
799
@@ -888,7 +890,7 @@ async def delete(
888
890
] = None ,
889
891
) -> ObjectApiResponse [t .Any ]:
890
892
"""
891
- Removes a document from the index.
893
+ Removes a JSON document from the specified index.
892
894
893
895
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html>`_
894
896
@@ -1006,7 +1008,7 @@ async def delete_by_query(
1006
1008
body : t .Optional [t .Dict [str , t .Any ]] = None ,
1007
1009
) -> ObjectApiResponse [t .Any ]:
1008
1010
"""
1009
- Deletes documents matching the provided query.
1011
+ Deletes documents that match the specified query.
1010
1012
1011
1013
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html>`_
1012
1014
@@ -1180,7 +1182,7 @@ async def delete_script(
1180
1182
timeout : t .Optional [t .Union ["t.Literal[-1]" , "t.Literal[0]" , str ]] = None ,
1181
1183
) -> ObjectApiResponse [t .Any ]:
1182
1184
"""
1183
- Deletes a script.
1185
+ Deletes a stored script or search template .
1184
1186
1185
1187
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
1186
1188
@@ -1242,7 +1244,7 @@ async def exists(
1242
1244
] = None ,
1243
1245
) -> HeadApiResponse :
1244
1246
"""
1245
- Returns information about whether a document exists in an index.
1247
+ Checks if a document in an index exists .
1246
1248
1247
1249
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_
1248
1250
@@ -1337,7 +1339,7 @@ async def exists_source(
1337
1339
] = None ,
1338
1340
) -> HeadApiResponse :
1339
1341
"""
1340
- Returns information about whether a document source exists in an index .
1342
+ Checks if a document's `_source` is stored .
1341
1343
1342
1344
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_
1343
1345
@@ -1431,7 +1433,8 @@ async def explain(
1431
1433
body : t .Optional [t .Dict [str , t .Any ]] = None ,
1432
1434
) -> ObjectApiResponse [t .Any ]:
1433
1435
"""
1434
- Returns information about why a specific matches (or doesn't match) a query.
1436
+ Returns information about why a specific document matches (or doesn’t match)
1437
+ a query.
1435
1438
1436
1439
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html>`_
1437
1440
@@ -1543,7 +1546,10 @@ async def field_caps(
1543
1546
body : t .Optional [t .Dict [str , t .Any ]] = None ,
1544
1547
) -> ObjectApiResponse [t .Any ]:
1545
1548
"""
1546
- Returns the information about the capabilities of fields among multiple indices.
1549
+ The field capabilities API returns the information about the capabilities of
1550
+ fields among multiple indices. The field capabilities API returns runtime fields
1551
+ like any other field. For example, a runtime field with a type of keyword is
1552
+ returned as any other field that belongs to the `keyword` family.
1547
1553
1548
1554
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html>`_
1549
1555
@@ -1735,7 +1741,7 @@ async def get_script(
1735
1741
pretty : t .Optional [bool ] = None ,
1736
1742
) -> ObjectApiResponse [t .Any ]:
1737
1743
"""
1738
- Returns a script.
1744
+ Retrieves a stored script or search template .
1739
1745
1740
1746
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
1741
1747
@@ -1887,7 +1893,9 @@ async def index(
1887
1893
] = None ,
1888
1894
) -> ObjectApiResponse [t .Any ]:
1889
1895
"""
1890
- Creates or updates a document in an index.
1896
+ Adds a JSON document to the specified data stream or index and makes it searchable.
1897
+ If the target is an index and the document already exists, the request updates
1898
+ the document and increments its version.
1891
1899
1892
1900
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html>`_
1893
1901
@@ -2261,7 +2269,7 @@ async def msearch_template(
2261
2269
typed_keys : t .Optional [bool ] = None ,
2262
2270
) -> ObjectApiResponse [t .Any ]:
2263
2271
"""
2264
- Allows to execute several search template operations in one request.
2272
+ Runs multiple templated searches with a single request.
2265
2273
2266
2274
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html>`_
2267
2275
@@ -2445,7 +2453,13 @@ async def open_point_in_time(
2445
2453
routing : t .Optional [str ] = None ,
2446
2454
) -> ObjectApiResponse [t .Any ]:
2447
2455
"""
2448
- Open a point in time that can be used in subsequent searches
2456
+ A search request by default executes against the most recent visible data of
2457
+ the target indices, which is called point in time. Elasticsearch pit (point in
2458
+ time) is a lightweight view into the state of the data as it existed when initiated.
2459
+ In some cases, it’s preferred to perform multiple search requests using the same
2460
+ point in time. For example, if refreshes happen between `search_after` requests,
2461
+ then the results of those requests might not be consistent as changes happening
2462
+ between searches are only visible to the more recent point in time.
2449
2463
2450
2464
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html>`_
2451
2465
@@ -2511,7 +2525,7 @@ async def put_script(
2511
2525
body : t .Optional [t .Dict [str , t .Any ]] = None ,
2512
2526
) -> ObjectApiResponse [t .Any ]:
2513
2527
"""
2514
- Creates or updates a script.
2528
+ Creates or updates a stored script or search template .
2515
2529
2516
2530
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
2517
2531
@@ -2587,8 +2601,8 @@ async def rank_eval(
2587
2601
body : t .Optional [t .Dict [str , t .Any ]] = None ,
2588
2602
) -> ObjectApiResponse [t .Any ]:
2589
2603
"""
2590
- Allows to evaluate the quality of ranked search results over a set of typical
2591
- search queries
2604
+ Enables you to evaluate the quality of ranked search results over a set of typical
2605
+ search queries.
2592
2606
2593
2607
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html>`_
2594
2608
@@ -2770,7 +2784,7 @@ async def render_search_template(
2770
2784
body : t .Optional [t .Dict [str , t .Any ]] = None ,
2771
2785
) -> ObjectApiResponse [t .Any ]:
2772
2786
"""
2773
- Allows to use the Mustache language to pre-render a search definition .
2787
+ Renders a search template as a search request body .
2774
2788
2775
2789
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/render-search-template-api.html>`_
2776
2790
@@ -2829,7 +2843,7 @@ async def scripts_painless_execute(
2829
2843
body : t .Optional [t .Dict [str , t .Any ]] = None ,
2830
2844
) -> ObjectApiResponse [t .Any ]:
2831
2845
"""
2832
- Allows an arbitrary script to be executed and a result to be returned
2846
+ Runs a script and returns a result.
2833
2847
2834
2848
`<https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html>`_
2835
2849
@@ -2939,6 +2953,7 @@ async def scroll(
2939
2953
"query" ,
2940
2954
"rank" ,
2941
2955
"rescore" ,
2956
+ "retriever" ,
2942
2957
"runtime_mappings" ,
2943
2958
"script_fields" ,
2944
2959
"search_after" ,
@@ -3020,6 +3035,7 @@ async def search(
3020
3035
t .Union [t .Mapping [str , t .Any ], t .Sequence [t .Mapping [str , t .Any ]]]
3021
3036
] = None ,
3022
3037
rest_total_hits_as_int : t .Optional [bool ] = None ,
3038
+ retriever : t .Optional [t .Mapping [str , t .Any ]] = None ,
3023
3039
routing : t .Optional [str ] = None ,
3024
3040
runtime_mappings : t .Optional [t .Mapping [str , t .Mapping [str , t .Any ]]] = None ,
3025
3041
script_fields : t .Optional [t .Mapping [str , t .Mapping [str , t .Any ]]] = None ,
@@ -3060,7 +3076,9 @@ async def search(
3060
3076
body : t .Optional [t .Dict [str , t .Any ]] = None ,
3061
3077
) -> ObjectApiResponse [t .Any ]:
3062
3078
"""
3063
- Returns results matching a query.
3079
+ Returns search hits that match the query defined in the request. You can provide
3080
+ search queries using the `q` query string parameter or the request body. If both
3081
+ are specified, only the query parameter is used.
3064
3082
3065
3083
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html>`_
3066
3084
@@ -3179,6 +3197,9 @@ async def search(
3179
3197
example 100 - 500) documents returned by the `query` and `post_filter` phases.
3180
3198
:param rest_total_hits_as_int: Indicates whether `hits.total` should be rendered
3181
3199
as an integer or an object in the rest search response.
3200
+ :param retriever: A retriever is a specification to describe top documents returned
3201
+ from a search. A retriever replaces other elements of the search API that
3202
+ also return top documents such as query and knn.
3182
3203
:param routing: Custom value used to route operations to a specific shard.
3183
3204
:param runtime_mappings: Defines one or more runtime fields in the search request.
3184
3205
These fields take precedence over mapped fields with the same name.
@@ -3372,6 +3393,8 @@ async def search(
3372
3393
__body ["rank" ] = rank
3373
3394
if rescore is not None :
3374
3395
__body ["rescore" ] = rescore
3396
+ if retriever is not None :
3397
+ __body ["retriever" ] = retriever
3375
3398
if runtime_mappings is not None :
3376
3399
__body ["runtime_mappings" ] = runtime_mappings
3377
3400
if script_fields is not None :
@@ -3625,7 +3648,7 @@ async def search_template(
3625
3648
body : t .Optional [t .Dict [str , t .Any ]] = None ,
3626
3649
) -> ObjectApiResponse [t .Any ]:
3627
3650
"""
3628
- Allows to use the Mustache language to pre-render a search definition .
3651
+ Runs a search with a search template .
3629
3652
3630
3653
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html>`_
3631
3654
@@ -4134,8 +4157,8 @@ async def update_by_query(
4134
4157
) -> ObjectApiResponse [t .Any ]:
4135
4158
"""
4136
4159
Updates documents that match the specified query. If no query is specified, performs
4137
- an update on every document in the index without changing the source, for example
4138
- to pick up a mapping change .
4160
+ an update on every document in the data stream or index without modifying the
4161
+ source, which is useful for picking up mapping changes .
4139
4162
4140
4163
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html>`_
4141
4164
0 commit comments