@@ -1121,12 +1121,17 @@ async def create(
1121
1121
error_trace : t .Optional [bool ] = None ,
1122
1122
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
1123
1123
human : t .Optional [bool ] = None ,
1124
+ if_primary_term : t .Optional [int ] = None ,
1125
+ if_seq_no : t .Optional [int ] = None ,
1124
1126
include_source_on_error : t .Optional [bool ] = None ,
1127
+ op_type : t .Optional [t .Union [str , t .Literal ["create" , "index" ]]] = None ,
1125
1128
pipeline : t .Optional [str ] = None ,
1126
1129
pretty : t .Optional [bool ] = None ,
1127
1130
refresh : t .Optional [
1128
1131
t .Union [bool , str , t .Literal ["false" , "true" , "wait_for" ]]
1129
1132
] = None ,
1133
+ require_alias : t .Optional [bool ] = None ,
1134
+ require_data_stream : t .Optional [bool ] = None ,
1130
1135
routing : t .Optional [str ] = None ,
1131
1136
timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
1132
1137
version : t .Optional [int ] = None ,
@@ -1204,8 +1209,18 @@ async def create(
1204
1209
:param id: A unique identifier for the document. To automatically generate a
1205
1210
document ID, use the `POST /<target>/_doc/` request format.
1206
1211
:param document:
1212
+ :param if_primary_term: Only perform the operation if the document has this primary
1213
+ term.
1214
+ :param if_seq_no: Only perform the operation if the document has this sequence
1215
+ number.
1207
1216
:param include_source_on_error: True or false if to include the document source
1208
1217
in the error message in case of parsing errors.
1218
+ :param op_type: Set to `create` to only index the document if it does not already
1219
+ exist (put if absent). If a document with the specified `_id` already exists,
1220
+ the indexing operation will fail. The behavior is the same as using the `<index>/_create`
1221
+ endpoint. If a document ID is specified, this paramater defaults to `index`.
1222
+ Otherwise, it defaults to `create`. If the request targets a data stream,
1223
+ an `op_type` of `create` is required.
1209
1224
:param pipeline: The ID of the pipeline to use to preprocess incoming documents.
1210
1225
If the index has a default ingest pipeline specified, setting the value to
1211
1226
`_none` turns off the default ingest pipeline for this request. If a final
@@ -1214,6 +1229,9 @@ async def create(
1214
1229
:param refresh: If `true`, Elasticsearch refreshes the affected shards to make
1215
1230
this operation visible to search. If `wait_for`, it waits for a refresh to
1216
1231
make this operation visible to search. If `false`, it does nothing with refreshes.
1232
+ :param require_alias: If `true`, the destination must be an index alias.
1233
+ :param require_data_stream: If `true`, the request's actions must target a data
1234
+ stream (existing or to be created).
1217
1235
:param routing: A custom value that is used to route operations to a specific
1218
1236
shard.
1219
1237
:param timeout: The period the request waits for the following operations: automatic
@@ -1254,14 +1272,24 @@ async def create(
1254
1272
__query ["filter_path" ] = filter_path
1255
1273
if human is not None :
1256
1274
__query ["human" ] = human
1275
+ if if_primary_term is not None :
1276
+ __query ["if_primary_term" ] = if_primary_term
1277
+ if if_seq_no is not None :
1278
+ __query ["if_seq_no" ] = if_seq_no
1257
1279
if include_source_on_error is not None :
1258
1280
__query ["include_source_on_error" ] = include_source_on_error
1281
+ if op_type is not None :
1282
+ __query ["op_type" ] = op_type
1259
1283
if pipeline is not None :
1260
1284
__query ["pipeline" ] = pipeline
1261
1285
if pretty is not None :
1262
1286
__query ["pretty" ] = pretty
1263
1287
if refresh is not None :
1264
1288
__query ["refresh" ] = refresh
1289
+ if require_alias is not None :
1290
+ __query ["require_alias" ] = require_alias
1291
+ if require_data_stream is not None :
1292
+ __query ["require_data_stream" ] = require_data_stream
1265
1293
if routing is not None :
1266
1294
__query ["routing" ] = routing
1267
1295
if timeout is not None :
@@ -1553,7 +1581,7 @@ async def delete_by_query(
1553
1581
If the request can target data streams, this argument determines whether
1554
1582
wildcard expressions match hidden data streams. It supports comma-separated
1555
1583
values, such as `open,hidden`.
1556
- :param from_: Starting offset (default: 0)
1584
+ :param from_: Skips the specified number of documents.
1557
1585
:param ignore_unavailable: If `false`, the request returns an error if it targets
1558
1586
a missing or closed index.
1559
1587
:param lenient: If `true`, format-based query failures (such as providing text
@@ -3720,6 +3748,7 @@ async def open_point_in_time(
3720
3748
human : t .Optional [bool ] = None ,
3721
3749
ignore_unavailable : t .Optional [bool ] = None ,
3722
3750
index_filter : t .Optional [t .Mapping [str , t .Any ]] = None ,
3751
+ max_concurrent_shard_requests : t .Optional [int ] = None ,
3723
3752
preference : t .Optional [str ] = None ,
3724
3753
pretty : t .Optional [bool ] = None ,
3725
3754
routing : t .Optional [str ] = None ,
@@ -3775,6 +3804,8 @@ async def open_point_in_time(
3775
3804
a missing or closed index.
3776
3805
:param index_filter: Filter indices if the provided query rewrites to `match_none`
3777
3806
on every shard.
3807
+ :param max_concurrent_shard_requests: Maximum number of concurrent shard requests
3808
+ that each sub-search request executes per node.
3778
3809
:param preference: The node or shard the operation should be performed on. By
3779
3810
default, it is random.
3780
3811
:param routing: A custom value that is used to route operations to a specific
@@ -3802,6 +3833,8 @@ async def open_point_in_time(
3802
3833
__query ["human" ] = human
3803
3834
if ignore_unavailable is not None :
3804
3835
__query ["ignore_unavailable" ] = ignore_unavailable
3836
+ if max_concurrent_shard_requests is not None :
3837
+ __query ["max_concurrent_shard_requests" ] = max_concurrent_shard_requests
3805
3838
if preference is not None :
3806
3839
__query ["preference" ] = preference
3807
3840
if pretty is not None :
@@ -5973,7 +6006,20 @@ async def terms_enum(
5973
6006
)
5974
6007
5975
6008
@_rewrite_parameters (
5976
- body_fields = ("doc" , "filter" , "per_field_analyzer" ),
6009
+ body_fields = (
6010
+ "doc" ,
6011
+ "field_statistics" ,
6012
+ "fields" ,
6013
+ "filter" ,
6014
+ "offsets" ,
6015
+ "payloads" ,
6016
+ "per_field_analyzer" ,
6017
+ "positions" ,
6018
+ "routing" ,
6019
+ "term_statistics" ,
6020
+ "version" ,
6021
+ "version_type" ,
6022
+ ),
5977
6023
)
5978
6024
async def termvectors (
5979
6025
self ,
@@ -6050,9 +6096,9 @@ async def termvectors(
6050
6096
(the sum of document frequencies for all terms in this field). * The sum
6051
6097
of total term frequencies (the sum of total term frequencies of each term
6052
6098
in this field).
6053
- :param fields: A comma-separated list or wildcard expressions of fields to include
6054
- in the statistics. It is used as the default list unless a specific field
6055
- list is provided in the `completion_fields` or `fielddata_fields` parameters.
6099
+ :param fields: A list of fields to include in the statistics. It is used as the
6100
+ default list unless a specific field list is provided in the `completion_fields`
6101
+ or `fielddata_fields` parameters.
6056
6102
:param filter: Filter terms based on their tf-idf scores. This could be useful
6057
6103
in order find out a good characteristic vector of a document. This feature
6058
6104
works in a similar manner to the second phase of the More Like This Query.
@@ -6090,41 +6136,41 @@ async def termvectors(
6090
6136
__body : t .Dict [str , t .Any ] = body if body is not None else {}
6091
6137
if error_trace is not None :
6092
6138
__query ["error_trace" ] = error_trace
6093
- if field_statistics is not None :
6094
- __query ["field_statistics" ] = field_statistics
6095
- if fields is not None :
6096
- __query ["fields" ] = fields
6097
6139
if filter_path is not None :
6098
6140
__query ["filter_path" ] = filter_path
6099
6141
if human is not None :
6100
6142
__query ["human" ] = human
6101
- if offsets is not None :
6102
- __query ["offsets" ] = offsets
6103
- if payloads is not None :
6104
- __query ["payloads" ] = payloads
6105
- if positions is not None :
6106
- __query ["positions" ] = positions
6107
6143
if preference is not None :
6108
6144
__query ["preference" ] = preference
6109
6145
if pretty is not None :
6110
6146
__query ["pretty" ] = pretty
6111
6147
if realtime is not None :
6112
6148
__query ["realtime" ] = realtime
6113
- if routing is not None :
6114
- __query ["routing" ] = routing
6115
- if term_statistics is not None :
6116
- __query ["term_statistics" ] = term_statistics
6117
- if version is not None :
6118
- __query ["version" ] = version
6119
- if version_type is not None :
6120
- __query ["version_type" ] = version_type
6121
6149
if not __body :
6122
6150
if doc is not None :
6123
6151
__body ["doc" ] = doc
6152
+ if field_statistics is not None :
6153
+ __body ["field_statistics" ] = field_statistics
6154
+ if fields is not None :
6155
+ __body ["fields" ] = fields
6124
6156
if filter is not None :
6125
6157
__body ["filter" ] = filter
6158
+ if offsets is not None :
6159
+ __body ["offsets" ] = offsets
6160
+ if payloads is not None :
6161
+ __body ["payloads" ] = payloads
6126
6162
if per_field_analyzer is not None :
6127
6163
__body ["per_field_analyzer" ] = per_field_analyzer
6164
+ if positions is not None :
6165
+ __body ["positions" ] = positions
6166
+ if routing is not None :
6167
+ __body ["routing" ] = routing
6168
+ if term_statistics is not None :
6169
+ __body ["term_statistics" ] = term_statistics
6170
+ if version is not None :
6171
+ __body ["version" ] = version
6172
+ if version_type is not None :
6173
+ __body ["version_type" ] = version_type
6128
6174
if not __body :
6129
6175
__body = None # type: ignore[assignment]
6130
6176
__headers = {"accept" : "application/json" }
@@ -6475,7 +6521,7 @@ async def update_by_query(
6475
6521
wildcard expressions match hidden data streams. It supports comma-separated
6476
6522
values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`,
6477
6523
`hidden`, `none`.
6478
- :param from_: Starting offset (default: 0)
6524
+ :param from_: Skips the specified number of documents.
6479
6525
:param ignore_unavailable: If `false`, the request returns an error if it targets
6480
6526
a missing or closed index.
6481
6527
:param lenient: If `true`, format-based query failures (such as providing text
0 commit comments