@@ -2271,6 +2271,7 @@ async def msearch(
2271
2271
human : t .Optional [bool ] = None ,
2272
2272
ignore_throttled : t .Optional [bool ] = None ,
2273
2273
ignore_unavailable : t .Optional [bool ] = None ,
2274
+ include_named_queries_score : t .Optional [bool ] = None ,
2274
2275
max_concurrent_searches : t .Optional [int ] = None ,
2275
2276
max_concurrent_shard_requests : t .Optional [int ] = None ,
2276
2277
pre_filter_shard_size : t .Optional [int ] = None ,
@@ -2304,6 +2305,13 @@ async def msearch(
2304
2305
when frozen.
2305
2306
:param ignore_unavailable: If true, missing or closed indices are not included
2306
2307
in the response.
2308
+ :param include_named_queries_score: Indicates whether hit.matched_queries should
2309
+ be rendered as a map that includes the name of the matched query associated
2310
+ with its score (true) or as an array containing the name of the matched queries
2311
+ (false) This functionality reruns each named query on every hit in a search
2312
+ response. Typically, this adds a small overhead to a request. However, using
2313
+ computationally expensive named queries on a large number of hits may add
2314
+ significant overhead.
2307
2315
:param max_concurrent_searches: Maximum number of concurrent searches the multi
2308
2316
search API can execute.
2309
2317
:param max_concurrent_shard_requests: Maximum number of concurrent shard requests
@@ -2353,6 +2361,8 @@ async def msearch(
2353
2361
__query ["ignore_throttled" ] = ignore_throttled
2354
2362
if ignore_unavailable is not None :
2355
2363
__query ["ignore_unavailable" ] = ignore_unavailable
2364
+ if include_named_queries_score is not None :
2365
+ __query ["include_named_queries_score" ] = include_named_queries_score
2356
2366
if max_concurrent_searches is not None :
2357
2367
__query ["max_concurrent_searches" ] = max_concurrent_searches
2358
2368
if max_concurrent_shard_requests is not None :
@@ -2585,7 +2595,9 @@ async def mtermvectors(
2585
2595
path_parts = __path_parts ,
2586
2596
)
2587
2597
2588
- @_rewrite_parameters ()
2598
+ @_rewrite_parameters (
2599
+ body_fields = ("index_filter" ,),
2600
+ )
2589
2601
async def open_point_in_time (
2590
2602
self ,
2591
2603
* ,
@@ -2603,9 +2615,11 @@ async def open_point_in_time(
2603
2615
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
2604
2616
human : t .Optional [bool ] = None ,
2605
2617
ignore_unavailable : t .Optional [bool ] = None ,
2618
+ index_filter : t .Optional [t .Mapping [str , t .Any ]] = None ,
2606
2619
preference : t .Optional [str ] = None ,
2607
2620
pretty : t .Optional [bool ] = None ,
2608
2621
routing : t .Optional [str ] = None ,
2622
+ body : t .Optional [t .Dict [str , t .Any ]] = None ,
2609
2623
) -> ObjectApiResponse [t .Any ]:
2610
2624
"""
2611
2625
A search request by default executes against the most recent visible data of
@@ -2627,17 +2641,20 @@ async def open_point_in_time(
2627
2641
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
2628
2642
:param ignore_unavailable: If `false`, the request returns an error if it targets
2629
2643
a missing or closed index.
2644
+ :param index_filter: Allows to filter indices if the provided query rewrites
2645
+ to `match_none` on every shard.
2630
2646
:param preference: Specifies the node or shard the operation should be performed
2631
2647
on. Random by default.
2632
2648
:param routing: Custom value used to route operations to a specific shard.
2633
2649
"""
2634
2650
if index in SKIP_IN_PATH :
2635
2651
raise ValueError ("Empty value passed for parameter 'index'" )
2636
- if keep_alive is None :
2652
+ if keep_alive is None and body is None :
2637
2653
raise ValueError ("Empty value passed for parameter 'keep_alive'" )
2638
2654
__path_parts : t .Dict [str , str ] = {"index" : _quote (index )}
2639
2655
__path = f'/{ __path_parts ["index" ]} /_pit'
2640
2656
__query : t .Dict [str , t .Any ] = {}
2657
+ __body : t .Dict [str , t .Any ] = body if body is not None else {}
2641
2658
if keep_alive is not None :
2642
2659
__query ["keep_alive" ] = keep_alive
2643
2660
if error_trace is not None :
@@ -2656,12 +2673,20 @@ async def open_point_in_time(
2656
2673
__query ["pretty" ] = pretty
2657
2674
if routing is not None :
2658
2675
__query ["routing" ] = routing
2676
+ if not __body :
2677
+ if index_filter is not None :
2678
+ __body ["index_filter" ] = index_filter
2679
+ if not __body :
2680
+ __body = None # type: ignore[assignment]
2659
2681
__headers = {"accept" : "application/json" }
2682
+ if __body is not None :
2683
+ __headers ["content-type" ] = "application/json"
2660
2684
return await self .perform_request ( # type: ignore[return-value]
2661
2685
"POST" ,
2662
2686
__path ,
2663
2687
params = __query ,
2664
2688
headers = __headers ,
2689
+ body = __body ,
2665
2690
endpoint_id = "open_point_in_time" ,
2666
2691
path_parts = __path_parts ,
2667
2692
)
@@ -3221,6 +3246,7 @@ async def search(
3221
3246
human : t .Optional [bool ] = None ,
3222
3247
ignore_throttled : t .Optional [bool ] = None ,
3223
3248
ignore_unavailable : t .Optional [bool ] = None ,
3249
+ include_named_queries_score : t .Optional [bool ] = None ,
3224
3250
indices_boost : t .Optional [t .Sequence [t .Mapping [str , float ]]] = None ,
3225
3251
knn : t .Optional [
3226
3252
t .Union [t .Mapping [str , t .Any ], t .Sequence [t .Mapping [str , t .Any ]]]
@@ -3348,6 +3374,13 @@ async def search(
3348
3374
be ignored when frozen.
3349
3375
:param ignore_unavailable: If `false`, the request returns an error if it targets
3350
3376
a missing or closed index.
3377
+ :param include_named_queries_score: Indicates whether hit.matched_queries should
3378
+ be rendered as a map that includes the name of the matched query associated
3379
+ with its score (true) or as an array containing the name of the matched queries
3380
+ (false) This functionality reruns each named query on every hit in a search
3381
+ response. Typically, this adds a small overhead to a request. However, using
3382
+ computationally expensive named queries on a large number of hits may add
3383
+ significant overhead.
3351
3384
:param indices_boost: Boosts the _score of documents from specified indices.
3352
3385
:param knn: Defines the approximate kNN search to run.
3353
3386
:param lenient: If `true`, format-based query failures (such as providing text
@@ -3529,6 +3562,8 @@ async def search(
3529
3562
__query ["ignore_throttled" ] = ignore_throttled
3530
3563
if ignore_unavailable is not None :
3531
3564
__query ["ignore_unavailable" ] = ignore_unavailable
3565
+ if include_named_queries_score is not None :
3566
+ __query ["include_named_queries_score" ] = include_named_queries_score
3532
3567
if lenient is not None :
3533
3568
__query ["lenient" ] = lenient
3534
3569
if max_concurrent_shard_requests is not None :
@@ -4389,6 +4424,7 @@ async def update_by_query(
4389
4424
pipeline : t .Optional [str ] = None ,
4390
4425
preference : t .Optional [str ] = None ,
4391
4426
pretty : t .Optional [bool ] = None ,
4427
+ q : t .Optional [str ] = None ,
4392
4428
query : t .Optional [t .Mapping [str , t .Any ]] = None ,
4393
4429
refresh : t .Optional [bool ] = None ,
4394
4430
request_cache : t .Optional [bool ] = None ,
@@ -4455,6 +4491,7 @@ async def update_by_query(
4455
4491
parameter.
4456
4492
:param preference: Specifies the node or shard the operation should be performed
4457
4493
on. Random by default.
4494
+ :param q: Query in the Lucene query string syntax.
4458
4495
:param query: Specifies the documents to update using the Query DSL.
4459
4496
:param refresh: If `true`, Elasticsearch refreshes affected shards to make the
4460
4497
operation visible to search.
@@ -4539,6 +4576,8 @@ async def update_by_query(
4539
4576
__query ["preference" ] = preference
4540
4577
if pretty is not None :
4541
4578
__query ["pretty" ] = pretty
4579
+ if q is not None :
4580
+ __query ["q" ] = q
4542
4581
if refresh is not None :
4543
4582
__query ["refresh" ] = refresh
4544
4583
if request_cache is not None :
0 commit comments