@@ -2714,6 +2714,7 @@ async def msearch(
2714
2714
human : t .Optional [bool ] = None ,
2715
2715
ignore_throttled : t .Optional [bool ] = None ,
2716
2716
ignore_unavailable : t .Optional [bool ] = None ,
2717
+ include_named_queries_score : t .Optional [bool ] = None ,
2717
2718
max_concurrent_searches : t .Optional [int ] = None ,
2718
2719
max_concurrent_shard_requests : t .Optional [int ] = None ,
2719
2720
pre_filter_shard_size : t .Optional [int ] = None ,
@@ -2747,6 +2748,13 @@ async def msearch(
2747
2748
when frozen.
2748
2749
:param ignore_unavailable: If true, missing or closed indices are not included
2749
2750
in the response.
2751
+ :param include_named_queries_score: Indicates whether hit.matched_queries should
2752
+ be rendered as a map that includes the name of the matched query associated
2753
+ with its score (true) or as an array containing the name of the matched queries
2754
+ (false) This functionality reruns each named query on every hit in a search
2755
+ response. Typically, this adds a small overhead to a request. However, using
2756
+ computationally expensive named queries on a large number of hits may add
2757
+ significant overhead.
2750
2758
:param max_concurrent_searches: Maximum number of concurrent searches the multi
2751
2759
search API can execute.
2752
2760
:param max_concurrent_shard_requests: Maximum number of concurrent shard requests
@@ -2796,6 +2804,8 @@ async def msearch(
2796
2804
__query ["ignore_throttled" ] = ignore_throttled
2797
2805
if ignore_unavailable is not None :
2798
2806
__query ["ignore_unavailable" ] = ignore_unavailable
2807
+ if include_named_queries_score is not None :
2808
+ __query ["include_named_queries_score" ] = include_named_queries_score
2799
2809
if max_concurrent_searches is not None :
2800
2810
__query ["max_concurrent_searches" ] = max_concurrent_searches
2801
2811
if max_concurrent_shard_requests is not None :
@@ -3028,7 +3038,9 @@ async def mtermvectors(
3028
3038
path_parts = __path_parts ,
3029
3039
)
3030
3040
3031
- @_rewrite_parameters ()
3041
+ @_rewrite_parameters (
3042
+ body_fields = ("index_filter" ,),
3043
+ )
3032
3044
async def open_point_in_time (
3033
3045
self ,
3034
3046
* ,
@@ -3046,9 +3058,11 @@ async def open_point_in_time(
3046
3058
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
3047
3059
human : t .Optional [bool ] = None ,
3048
3060
ignore_unavailable : t .Optional [bool ] = None ,
3061
+ index_filter : t .Optional [t .Mapping [str , t .Any ]] = None ,
3049
3062
preference : t .Optional [str ] = None ,
3050
3063
pretty : t .Optional [bool ] = None ,
3051
3064
routing : t .Optional [str ] = None ,
3065
+ body : t .Optional [t .Dict [str , t .Any ]] = None ,
3052
3066
) -> ObjectApiResponse [t .Any ]:
3053
3067
"""
3054
3068
A search request by default executes against the most recent visible data of
@@ -3070,17 +3084,20 @@ async def open_point_in_time(
3070
3084
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
3071
3085
:param ignore_unavailable: If `false`, the request returns an error if it targets
3072
3086
a missing or closed index.
3087
+ :param index_filter: Allows to filter indices if the provided query rewrites
3088
+ to `match_none` on every shard.
3073
3089
:param preference: Specifies the node or shard the operation should be performed
3074
3090
on. Random by default.
3075
3091
:param routing: Custom value used to route operations to a specific shard.
3076
3092
"""
3077
3093
if index in SKIP_IN_PATH :
3078
3094
raise ValueError ("Empty value passed for parameter 'index'" )
3079
- if keep_alive is None :
3095
+ if keep_alive is None and body is None :
3080
3096
raise ValueError ("Empty value passed for parameter 'keep_alive'" )
3081
3097
__path_parts : t .Dict [str , str ] = {"index" : _quote (index )}
3082
3098
__path = f'/{ __path_parts ["index" ]} /_pit'
3083
3099
__query : t .Dict [str , t .Any ] = {}
3100
+ __body : t .Dict [str , t .Any ] = body if body is not None else {}
3084
3101
if keep_alive is not None :
3085
3102
__query ["keep_alive" ] = keep_alive
3086
3103
if error_trace is not None :
@@ -3099,12 +3116,20 @@ async def open_point_in_time(
3099
3116
__query ["pretty" ] = pretty
3100
3117
if routing is not None :
3101
3118
__query ["routing" ] = routing
3119
+ if not __body :
3120
+ if index_filter is not None :
3121
+ __body ["index_filter" ] = index_filter
3122
+ if not __body :
3123
+ __body = None # type: ignore[assignment]
3102
3124
__headers = {"accept" : "application/json" }
3125
+ if __body is not None :
3126
+ __headers ["content-type" ] = "application/json"
3103
3127
return await self .perform_request ( # type: ignore[return-value]
3104
3128
"POST" ,
3105
3129
__path ,
3106
3130
params = __query ,
3107
3131
headers = __headers ,
3132
+ body = __body ,
3108
3133
endpoint_id = "open_point_in_time" ,
3109
3134
path_parts = __path_parts ,
3110
3135
)
@@ -3709,6 +3734,7 @@ async def search(
3709
3734
human : t .Optional [bool ] = None ,
3710
3735
ignore_throttled : t .Optional [bool ] = None ,
3711
3736
ignore_unavailable : t .Optional [bool ] = None ,
3737
+ include_named_queries_score : t .Optional [bool ] = None ,
3712
3738
indices_boost : t .Optional [t .Sequence [t .Mapping [str , float ]]] = None ,
3713
3739
knn : t .Optional [
3714
3740
t .Union [t .Mapping [str , t .Any ], t .Sequence [t .Mapping [str , t .Any ]]]
@@ -3836,6 +3862,13 @@ async def search(
3836
3862
be ignored when frozen.
3837
3863
:param ignore_unavailable: If `false`, the request returns an error if it targets
3838
3864
a missing or closed index.
3865
+ :param include_named_queries_score: Indicates whether hit.matched_queries should
3866
+ be rendered as a map that includes the name of the matched query associated
3867
+ with its score (true) or as an array containing the name of the matched queries
3868
+ (false) This functionality reruns each named query on every hit in a search
3869
+ response. Typically, this adds a small overhead to a request. However, using
3870
+ computationally expensive named queries on a large number of hits may add
3871
+ significant overhead.
3839
3872
:param indices_boost: Boosts the _score of documents from specified indices.
3840
3873
:param knn: Defines the approximate kNN search to run.
3841
3874
:param lenient: If `true`, format-based query failures (such as providing text
@@ -4017,6 +4050,8 @@ async def search(
4017
4050
__query ["ignore_throttled" ] = ignore_throttled
4018
4051
if ignore_unavailable is not None :
4019
4052
__query ["ignore_unavailable" ] = ignore_unavailable
4053
+ if include_named_queries_score is not None :
4054
+ __query ["include_named_queries_score" ] = include_named_queries_score
4020
4055
if lenient is not None :
4021
4056
__query ["lenient" ] = lenient
4022
4057
if max_concurrent_shard_requests is not None :
@@ -4963,6 +4998,7 @@ async def update_by_query(
4963
4998
pipeline : t .Optional [str ] = None ,
4964
4999
preference : t .Optional [str ] = None ,
4965
5000
pretty : t .Optional [bool ] = None ,
5001
+ q : t .Optional [str ] = None ,
4966
5002
query : t .Optional [t .Mapping [str , t .Any ]] = None ,
4967
5003
refresh : t .Optional [bool ] = None ,
4968
5004
request_cache : t .Optional [bool ] = None ,
@@ -5029,6 +5065,7 @@ async def update_by_query(
5029
5065
parameter.
5030
5066
:param preference: Specifies the node or shard the operation should be performed
5031
5067
on. Random by default.
5068
+ :param q: Query in the Lucene query string syntax.
5032
5069
:param query: Specifies the documents to update using the Query DSL.
5033
5070
:param refresh: If `true`, Elasticsearch refreshes affected shards to make the
5034
5071
operation visible to search.
@@ -5113,6 +5150,8 @@ async def update_by_query(
5113
5150
__query ["preference" ] = preference
5114
5151
if pretty is not None :
5115
5152
__query ["pretty" ] = pretty
5153
+ if q is not None :
5154
+ __query ["q" ] = q
5116
5155
if refresh is not None :
5117
5156
__query ["refresh" ] = refresh
5118
5157
if request_cache is not None :
0 commit comments