@@ -1121,12 +1121,17 @@ async def create(
11211121 error_trace : t .Optional [bool ] = None ,
11221122 filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
11231123 human : t .Optional [bool ] = None ,
1124+ if_primary_term : t .Optional [int ] = None ,
1125+ if_seq_no : t .Optional [int ] = None ,
11241126 include_source_on_error : t .Optional [bool ] = None ,
1127+ op_type : t .Optional [t .Union [str , t .Literal ["create" , "index" ]]] = None ,
11251128 pipeline : t .Optional [str ] = None ,
11261129 pretty : t .Optional [bool ] = None ,
11271130 refresh : t .Optional [
11281131 t .Union [bool , str , t .Literal ["false" , "true" , "wait_for" ]]
11291132 ] = None ,
1133+ require_alias : t .Optional [bool ] = None ,
1134+ require_data_stream : t .Optional [bool ] = None ,
11301135 routing : t .Optional [str ] = None ,
11311136 timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
11321137 version : t .Optional [int ] = None ,
@@ -1204,8 +1209,18 @@ async def create(
12041209 :param id: A unique identifier for the document. To automatically generate a
12051210 document ID, use the `POST /<target>/_doc/` request format.
12061211 :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.
12071216 :param include_source_on_error: True or false if to include the document source
12081217 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.
12091224 :param pipeline: The ID of the pipeline to use to preprocess incoming documents.
12101225 If the index has a default ingest pipeline specified, setting the value to
12111226 `_none` turns off the default ingest pipeline for this request. If a final
@@ -1214,6 +1229,9 @@ async def create(
12141229 :param refresh: If `true`, Elasticsearch refreshes the affected shards to make
12151230 this operation visible to search. If `wait_for`, it waits for a refresh to
12161231 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).
12171235 :param routing: A custom value that is used to route operations to a specific
12181236 shard.
12191237 :param timeout: The period the request waits for the following operations: automatic
@@ -1254,14 +1272,24 @@ async def create(
12541272 __query ["filter_path" ] = filter_path
12551273 if human is not None :
12561274 __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
12571279 if include_source_on_error is not None :
12581280 __query ["include_source_on_error" ] = include_source_on_error
1281+ if op_type is not None :
1282+ __query ["op_type" ] = op_type
12591283 if pipeline is not None :
12601284 __query ["pipeline" ] = pipeline
12611285 if pretty is not None :
12621286 __query ["pretty" ] = pretty
12631287 if refresh is not None :
12641288 __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
12651293 if routing is not None :
12661294 __query ["routing" ] = routing
12671295 if timeout is not None :
@@ -5969,7 +5997,20 @@ async def terms_enum(
59695997 )
59705998
59715999 @_rewrite_parameters (
5972- body_fields = ("doc" , "filter" , "per_field_analyzer" ),
6000+ body_fields = (
6001+ "doc" ,
6002+ "field_statistics" ,
6003+ "fields" ,
6004+ "filter" ,
6005+ "offsets" ,
6006+ "payloads" ,
6007+ "per_field_analyzer" ,
6008+ "positions" ,
6009+ "routing" ,
6010+ "term_statistics" ,
6011+ "version" ,
6012+ "version_type" ,
6013+ ),
59736014 )
59746015 async def termvectors (
59756016 self ,
@@ -6046,9 +6087,9 @@ async def termvectors(
60466087 (the sum of document frequencies for all terms in this field). * The sum
60476088 of total term frequencies (the sum of total term frequencies of each term
60486089 in this field).
6049- :param fields: A comma-separated list or wildcard expressions of fields to include
6050- in the statistics. It is used as the default list unless a specific field
6051- list is provided in the `completion_fields` or `fielddata_fields` parameters.
6090+ :param fields: A list of fields to include in the statistics. It is used as the
6091+ default list unless a specific field list is provided in the `completion_fields`
6092+ or `fielddata_fields` parameters.
60526093 :param filter: Filter terms based on their tf-idf scores. This could be useful
60536094 in order find out a good characteristic vector of a document. This feature
60546095 works in a similar manner to the second phase of the More Like This Query.
@@ -6086,41 +6127,41 @@ async def termvectors(
60866127 __body : t .Dict [str , t .Any ] = body if body is not None else {}
60876128 if error_trace is not None :
60886129 __query ["error_trace" ] = error_trace
6089- if field_statistics is not None :
6090- __query ["field_statistics" ] = field_statistics
6091- if fields is not None :
6092- __query ["fields" ] = fields
60936130 if filter_path is not None :
60946131 __query ["filter_path" ] = filter_path
60956132 if human is not None :
60966133 __query ["human" ] = human
6097- if offsets is not None :
6098- __query ["offsets" ] = offsets
6099- if payloads is not None :
6100- __query ["payloads" ] = payloads
6101- if positions is not None :
6102- __query ["positions" ] = positions
61036134 if preference is not None :
61046135 __query ["preference" ] = preference
61056136 if pretty is not None :
61066137 __query ["pretty" ] = pretty
61076138 if realtime is not None :
61086139 __query ["realtime" ] = realtime
6109- if routing is not None :
6110- __query ["routing" ] = routing
6111- if term_statistics is not None :
6112- __query ["term_statistics" ] = term_statistics
6113- if version is not None :
6114- __query ["version" ] = version
6115- if version_type is not None :
6116- __query ["version_type" ] = version_type
61176140 if not __body :
61186141 if doc is not None :
61196142 __body ["doc" ] = doc
6143+ if field_statistics is not None :
6144+ __body ["field_statistics" ] = field_statistics
6145+ if fields is not None :
6146+ __body ["fields" ] = fields
61206147 if filter is not None :
61216148 __body ["filter" ] = filter
6149+ if offsets is not None :
6150+ __body ["offsets" ] = offsets
6151+ if payloads is not None :
6152+ __body ["payloads" ] = payloads
61226153 if per_field_analyzer is not None :
61236154 __body ["per_field_analyzer" ] = per_field_analyzer
6155+ if positions is not None :
6156+ __body ["positions" ] = positions
6157+ if routing is not None :
6158+ __body ["routing" ] = routing
6159+ if term_statistics is not None :
6160+ __body ["term_statistics" ] = term_statistics
6161+ if version is not None :
6162+ __body ["version" ] = version
6163+ if version_type is not None :
6164+ __body ["version_type" ] = version_type
61246165 if not __body :
61256166 __body = None # type: ignore[assignment]
61266167 __headers = {"accept" : "application/json" }
0 commit comments