@@ -2271,6 +2271,7 @@ async def msearch(
22712271 human : t .Optional [bool ] = None ,
22722272 ignore_throttled : t .Optional [bool ] = None ,
22732273 ignore_unavailable : t .Optional [bool ] = None ,
2274+ include_named_queries_score : t .Optional [bool ] = None ,
22742275 max_concurrent_searches : t .Optional [int ] = None ,
22752276 max_concurrent_shard_requests : t .Optional [int ] = None ,
22762277 pre_filter_shard_size : t .Optional [int ] = None ,
@@ -2304,6 +2305,13 @@ async def msearch(
23042305 when frozen.
23052306 :param ignore_unavailable: If true, missing or closed indices are not included
23062307 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.
23072315 :param max_concurrent_searches: Maximum number of concurrent searches the multi
23082316 search API can execute.
23092317 :param max_concurrent_shard_requests: Maximum number of concurrent shard requests
@@ -2353,6 +2361,8 @@ async def msearch(
23532361 __query ["ignore_throttled" ] = ignore_throttled
23542362 if ignore_unavailable is not None :
23552363 __query ["ignore_unavailable" ] = ignore_unavailable
2364+ if include_named_queries_score is not None :
2365+ __query ["include_named_queries_score" ] = include_named_queries_score
23562366 if max_concurrent_searches is not None :
23572367 __query ["max_concurrent_searches" ] = max_concurrent_searches
23582368 if max_concurrent_shard_requests is not None :
@@ -2585,7 +2595,9 @@ async def mtermvectors(
25852595 path_parts = __path_parts ,
25862596 )
25872597
2588- @_rewrite_parameters ()
2598+ @_rewrite_parameters (
2599+ body_fields = ("index_filter" ,),
2600+ )
25892601 async def open_point_in_time (
25902602 self ,
25912603 * ,
@@ -2603,9 +2615,11 @@ async def open_point_in_time(
26032615 filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
26042616 human : t .Optional [bool ] = None ,
26052617 ignore_unavailable : t .Optional [bool ] = None ,
2618+ index_filter : t .Optional [t .Mapping [str , t .Any ]] = None ,
26062619 preference : t .Optional [str ] = None ,
26072620 pretty : t .Optional [bool ] = None ,
26082621 routing : t .Optional [str ] = None ,
2622+ body : t .Optional [t .Dict [str , t .Any ]] = None ,
26092623 ) -> ObjectApiResponse [t .Any ]:
26102624 """
26112625 A search request by default executes against the most recent visible data of
@@ -2627,17 +2641,20 @@ async def open_point_in_time(
26272641 as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
26282642 :param ignore_unavailable: If `false`, the request returns an error if it targets
26292643 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.
26302646 :param preference: Specifies the node or shard the operation should be performed
26312647 on. Random by default.
26322648 :param routing: Custom value used to route operations to a specific shard.
26332649 """
26342650 if index in SKIP_IN_PATH :
26352651 raise ValueError ("Empty value passed for parameter 'index'" )
2636- if keep_alive is None :
2652+ if keep_alive is None and body is None :
26372653 raise ValueError ("Empty value passed for parameter 'keep_alive'" )
26382654 __path_parts : t .Dict [str , str ] = {"index" : _quote (index )}
26392655 __path = f'/{ __path_parts ["index" ]} /_pit'
26402656 __query : t .Dict [str , t .Any ] = {}
2657+ __body : t .Dict [str , t .Any ] = body if body is not None else {}
26412658 if keep_alive is not None :
26422659 __query ["keep_alive" ] = keep_alive
26432660 if error_trace is not None :
@@ -2656,12 +2673,20 @@ async def open_point_in_time(
26562673 __query ["pretty" ] = pretty
26572674 if routing is not None :
26582675 __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]
26592681 __headers = {"accept" : "application/json" }
2682+ if __body is not None :
2683+ __headers ["content-type" ] = "application/json"
26602684 return await self .perform_request ( # type: ignore[return-value]
26612685 "POST" ,
26622686 __path ,
26632687 params = __query ,
26642688 headers = __headers ,
2689+ body = __body ,
26652690 endpoint_id = "open_point_in_time" ,
26662691 path_parts = __path_parts ,
26672692 )
@@ -3221,6 +3246,7 @@ async def search(
32213246 human : t .Optional [bool ] = None ,
32223247 ignore_throttled : t .Optional [bool ] = None ,
32233248 ignore_unavailable : t .Optional [bool ] = None ,
3249+ include_named_queries_score : t .Optional [bool ] = None ,
32243250 indices_boost : t .Optional [t .Sequence [t .Mapping [str , float ]]] = None ,
32253251 knn : t .Optional [
32263252 t .Union [t .Mapping [str , t .Any ], t .Sequence [t .Mapping [str , t .Any ]]]
@@ -3348,6 +3374,13 @@ async def search(
33483374 be ignored when frozen.
33493375 :param ignore_unavailable: If `false`, the request returns an error if it targets
33503376 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.
33513384 :param indices_boost: Boosts the _score of documents from specified indices.
33523385 :param knn: Defines the approximate kNN search to run.
33533386 :param lenient: If `true`, format-based query failures (such as providing text
@@ -3529,6 +3562,8 @@ async def search(
35293562 __query ["ignore_throttled" ] = ignore_throttled
35303563 if ignore_unavailable is not None :
35313564 __query ["ignore_unavailable" ] = ignore_unavailable
3565+ if include_named_queries_score is not None :
3566+ __query ["include_named_queries_score" ] = include_named_queries_score
35323567 if lenient is not None :
35333568 __query ["lenient" ] = lenient
35343569 if max_concurrent_shard_requests is not None :
@@ -4389,6 +4424,7 @@ async def update_by_query(
43894424 pipeline : t .Optional [str ] = None ,
43904425 preference : t .Optional [str ] = None ,
43914426 pretty : t .Optional [bool ] = None ,
4427+ q : t .Optional [str ] = None ,
43924428 query : t .Optional [t .Mapping [str , t .Any ]] = None ,
43934429 refresh : t .Optional [bool ] = None ,
43944430 request_cache : t .Optional [bool ] = None ,
@@ -4455,6 +4491,7 @@ async def update_by_query(
44554491 parameter.
44564492 :param preference: Specifies the node or shard the operation should be performed
44574493 on. Random by default.
4494+ :param q: Query in the Lucene query string syntax.
44584495 :param query: Specifies the documents to update using the Query DSL.
44594496 :param refresh: If `true`, Elasticsearch refreshes affected shards to make the
44604497 operation visible to search.
@@ -4539,6 +4576,8 @@ async def update_by_query(
45394576 __query ["preference" ] = preference
45404577 if pretty is not None :
45414578 __query ["pretty" ] = pretty
4579+ if q is not None :
4580+ __query ["q" ] = q
45424581 if refresh is not None :
45434582 __query ["refresh" ] = refresh
45444583 if request_cache is not None :
0 commit comments