@@ -1627,7 +1627,11 @@ async def delete_by_query(
16271627 __body ["slice" ] = slice
16281628 if sort is not None :
16291629 __body ["sort" ] = sort
1630- __headers = {"accept" : "application/json" , "content-type" : "application/json" }
1630+ if not __body :
1631+ __body = None # type: ignore[assignment]
1632+ __headers = {"accept" : "application/json" }
1633+ if __body is not None :
1634+ __headers ["content-type" ] = "application/json"
16311635 return await self .perform_request ( # type: ignore[return-value]
16321636 "POST" ,
16331637 __path ,
@@ -2830,13 +2834,11 @@ async def index(
28302834 "id": "elkbee"
28312835 }
28322836 }
2833-
2834- In this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1.
2835- If the document was already updated and its version was set to 2 or higher, the indexing command will fail and result in a conflict (409 HTTP status code).
2836-
2837- A nice side effect is that there is no need to maintain strict ordering of async indexing operations run as a result of changes to a source database, as long as version numbers from the source database are used.
2838- Even the simple case of updating the Elasticsearch index using data from a database is simplified if external versioning is used, as only the latest version will be used if the index operations arrive out of order.
28392837 </code></pre>
2838+ <p>In this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1.
2839+ If the document was already updated and its version was set to 2 or higher, the indexing command will fail and result in a conflict (409 HTTP status code).</p>
2840+ <p>A nice side effect is that there is no need to maintain strict ordering of async indexing operations run as a result of changes to a source database, as long as version numbers from the source database are used.
2841+ Even the simple case of updating the Elasticsearch index using data from a database is simplified if external versioning is used, as only the latest version will be used if the index operations arrive out of order.</p>
28402842
28412843
28422844 `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create>`_
@@ -3116,7 +3118,11 @@ async def mget(
31163118 __body ["docs" ] = docs
31173119 if ids is not None :
31183120 __body ["ids" ] = ids
3119- __headers = {"accept" : "application/json" , "content-type" : "application/json" }
3121+ if not __body :
3122+ __body = None # type: ignore[assignment]
3123+ __headers = {"accept" : "application/json" }
3124+ if __body is not None :
3125+ __headers ["content-type" ] = "application/json"
31203126 return await self .perform_request ( # type: ignore[return-value]
31213127 "POST" ,
31223128 __path ,
@@ -3716,7 +3722,11 @@ async def put_script(
37163722 if not __body :
37173723 if script is not None :
37183724 __body ["script" ] = script
3719- __headers = {"accept" : "application/json" , "content-type" : "application/json" }
3725+ if not __body :
3726+ __body = None # type: ignore[assignment]
3727+ __headers = {"accept" : "application/json" }
3728+ if __body is not None :
3729+ __headers ["content-type" ] = "application/json"
37203730 return await self .perform_request ( # type: ignore[return-value]
37213731 "PUT" ,
37223732 __path ,
@@ -3812,7 +3822,11 @@ async def rank_eval(
38123822 __body ["requests" ] = requests
38133823 if metric is not None :
38143824 __body ["metric" ] = metric
3815- __headers = {"accept" : "application/json" , "content-type" : "application/json" }
3825+ if not __body :
3826+ __body = None # type: ignore[assignment]
3827+ __headers = {"accept" : "application/json" }
3828+ if __body is not None :
3829+ __headers ["content-type" ] = "application/json"
38163830 return await self .perform_request ( # type: ignore[return-value]
38173831 "POST" ,
38183832 __path ,
@@ -3985,7 +3999,11 @@ async def reindex(
39853999 __body ["script" ] = script
39864000 if size is not None :
39874001 __body ["size" ] = size
3988- __headers = {"accept" : "application/json" , "content-type" : "application/json" }
4002+ if not __body :
4003+ __body = None # type: ignore[assignment]
4004+ __headers = {"accept" : "application/json" }
4005+ if __body is not None :
4006+ __headers ["content-type" ] = "application/json"
39894007 return await self .perform_request ( # type: ignore[return-value]
39904008 "POST" ,
39914009 __path ,
@@ -5156,11 +5174,19 @@ async def search_mvt(
51565174
51575175 `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-mvt>`_
51585176
5159- :param index: Comma-separated list of data streams, indices, or aliases to search
5160- :param field: Field containing geospatial data to return
5161- :param zoom: Zoom level for the vector tile to search
5162- :param x: X coordinate for the vector tile to search
5163- :param y: Y coordinate for the vector tile to search
5177+ :param index: A list of indices, data streams, or aliases to search. It supports
5178+ wildcards (`*`). To search all data streams and indices, omit this parameter
5179+ or use `*` or `_all`. To search a remote cluster, use the `<cluster>:<target>`
5180+ syntax.
5181+ :param field: A field that contains the geospatial data to return. It must be
5182+ a `geo_point` or `geo_shape` field. The field must have doc values enabled.
5183+ It cannot be a nested field. NOTE: Vector tiles do not natively support geometry
5184+ collections. For `geometrycollection` values in a `geo_shape` field, the
5185+ API returns a hits layer feature for each element of the collection. This
5186+ behavior may change in a future release.
5187+ :param zoom: The zoom level of the vector tile to search. It accepts `0` to `29`.
5188+ :param x: The X coordinate for the vector tile to search.
5189+ :param y: The Y coordinate for the vector tile to search.
51645190 :param aggs: Sub-aggregations for the geotile_grid. It supports the following
51655191 aggregation types: - `avg` - `boxplot` - `cardinality` - `extended stats`
51665192 - `max` - `median absolute deviation` - `min` - `percentile` - `percentile-rank`
@@ -5530,7 +5556,11 @@ async def search_template(
55305556 __body ["profile" ] = profile
55315557 if source is not None :
55325558 __body ["source" ] = source
5533- __headers = {"accept" : "application/json" , "content-type" : "application/json" }
5559+ if not __body :
5560+ __body = None # type: ignore[assignment]
5561+ __headers = {"accept" : "application/json" }
5562+ if __body is not None :
5563+ __headers ["content-type" ] = "application/json"
55345564 return await self .perform_request ( # type: ignore[return-value]
55355565 "POST" ,
55365566 __path ,
@@ -6001,7 +6031,11 @@ async def update(
60016031 __body ["_source" ] = source
60026032 if upsert is not None :
60036033 __body ["upsert" ] = upsert
6004- __headers = {"accept" : "application/json" , "content-type" : "application/json" }
6034+ if not __body :
6035+ __body = None # type: ignore[assignment]
6036+ __headers = {"accept" : "application/json" }
6037+ if __body is not None :
6038+ __headers ["content-type" ] = "application/json"
60056039 return await self .perform_request ( # type: ignore[return-value]
60066040 "POST" ,
60076041 __path ,
0 commit comments