Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 25 additions & 49 deletions elasticsearch/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,11 +935,7 @@ async def close_point_in_time(
if not __body:
if id is not None:
__body["id"] = id
if not __body:
__body = None # type: ignore[assignment]
__headers = {"accept": "application/json"}
if __body is not None:
__headers["content-type"] = "application/json"
__headers = {"accept": "application/json", "content-type": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"DELETE",
__path,
Expand Down Expand Up @@ -1012,8 +1008,8 @@ async def count(
This parameter can be used only when the `q` query string parameter is specified.
:param analyzer: The analyzer to use for the query string. This parameter can
be used only when the `q` query string parameter is specified.
:param default_operator: The default operator for query string query: `AND` or
`OR`. This parameter can be used only when the `q` query string parameter
:param default_operator: The default operator for query string query: `and` or
`or`. This parameter can be used only when the `q` query string parameter
is specified.
:param df: The field to use as a default when no field prefix is given in the
query string. This parameter can be used only when the `q` query string parameter
Expand Down Expand Up @@ -1134,7 +1130,7 @@ async def create(
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
version: t.Optional[int] = None,
version_type: t.Optional[
t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
t.Union[str, t.Literal["external", "external_gte", "internal"]]
] = None,
wait_for_active_shards: t.Optional[
t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
Expand Down Expand Up @@ -1313,7 +1309,7 @@ async def delete(
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
version: t.Optional[int] = None,
version_type: t.Optional[
t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
t.Union[str, t.Literal["external", "external_gte", "internal"]]
] = None,
wait_for_active_shards: t.Optional[
t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
Expand Down Expand Up @@ -1558,8 +1554,8 @@ async def delete_by_query(
used only when the `q` query string parameter is specified.
:param conflicts: What to do if delete by query hits version conflicts: `abort`
or `proceed`.
:param default_operator: The default operator for query string query: `AND` or
`OR`. This parameter can be used only when the `q` query string parameter
:param default_operator: The default operator for query string query: `and` or
`or`. This parameter can be used only when the `q` query string parameter
is specified.
:param df: The field to use as default where no field prefix is given in the
query string. This parameter can be used only when the `q` query string parameter
Expand Down Expand Up @@ -1853,7 +1849,7 @@ async def exists(
stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
version: t.Optional[int] = None,
version_type: t.Optional[
t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
t.Union[str, t.Literal["external", "external_gte", "internal"]]
] = None,
) -> HeadApiResponse:
"""
Expand Down Expand Up @@ -1982,7 +1978,7 @@ async def exists_source(
source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
version: t.Optional[int] = None,
version_type: t.Optional[
t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
t.Union[str, t.Literal["external", "external_gte", "internal"]]
] = None,
) -> HeadApiResponse:
"""
Expand Down Expand Up @@ -2111,8 +2107,8 @@ async def explain(
This parameter can be used only when the `q` query string parameter is specified.
:param analyzer: The analyzer to use for the query string. This parameter can
be used only when the `q` query string parameter is specified.
:param default_operator: The default operator for query string query: `AND` or
`OR`. This parameter can be used only when the `q` query string parameter
:param default_operator: The default operator for query string query: `and` or
`or`. This parameter can be used only when the `q` query string parameter
is specified.
:param df: The field to use as default where no field prefix is given in the
query string. This parameter can be used only when the `q` query string parameter
Expand Down Expand Up @@ -2354,7 +2350,7 @@ async def get(
stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
version: t.Optional[int] = None,
version_type: t.Optional[
t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
t.Union[str, t.Literal["external", "external_gte", "internal"]]
] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand Down Expand Up @@ -2641,7 +2637,7 @@ async def get_source(
source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
version: t.Optional[int] = None,
version_type: t.Optional[
t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
t.Union[str, t.Literal["external", "external_gte", "internal"]]
] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand Down Expand Up @@ -2821,7 +2817,7 @@ async def index(
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
version: t.Optional[int] = None,
version_type: t.Optional[
t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
t.Union[str, t.Literal["external", "external_gte", "internal"]]
] = None,
wait_for_active_shards: t.Optional[
t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
Expand Down Expand Up @@ -3185,11 +3181,7 @@ async def knn_search(
__body["_source"] = source
if stored_fields is not None:
__body["stored_fields"] = stored_fields
if not __body:
__body = None # type: ignore[assignment]
__headers = {"accept": "application/json"}
if __body is not None:
__headers["content-type"] = "application/json"
__headers = {"accept": "application/json", "content-type": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"POST",
__path,
Expand Down Expand Up @@ -3614,7 +3606,7 @@ async def mtermvectors(
term_statistics: t.Optional[bool] = None,
version: t.Optional[int] = None,
version_type: t.Optional[
t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
t.Union[str, t.Literal["external", "external_gte", "internal"]]
] = None,
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
Expand Down Expand Up @@ -4024,7 +4016,7 @@ async def rank_eval(
)

@_rewrite_parameters(
body_fields=("dest", "source", "conflicts", "max_docs", "script", "size"),
body_fields=("dest", "source", "conflicts", "max_docs", "script"),
)
async def reindex(
self,
Expand All @@ -4042,7 +4034,6 @@ async def reindex(
require_alias: t.Optional[bool] = None,
script: t.Optional[t.Mapping[str, t.Any]] = None,
scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
size: t.Optional[int] = None,
slices: t.Optional[t.Union[int, t.Union[str, t.Literal["auto"]]]] = None,
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
wait_for_active_shards: t.Optional[
Expand Down Expand Up @@ -4214,7 +4205,6 @@ async def reindex(
reindexing.
:param scroll: The period of time that a consistent view of the index should
be maintained for scrolled search.
:param size:
:param slices: The number of slices this task should be divided into. It defaults
to one slice, which means the task isn't sliced into subtasks. Reindex supports
sliced scroll to parallelize the reindexing process. This parallelization
Expand Down Expand Up @@ -4279,8 +4269,6 @@ async def reindex(
__body["max_docs"] = max_docs
if script is not None:
__body["script"] = script
if size is not None:
__body["size"] = size
__headers = {"accept": "application/json", "content-type": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"POST",
Expand Down Expand Up @@ -4407,11 +4395,7 @@ async def render_search_template(
__body["params"] = params
if source is not None:
__body["source"] = source
if not __body:
__body = None # type: ignore[assignment]
__headers = {"accept": "application/json"}
if __body is not None:
__headers["content-type"] = "application/json"
__headers = {"accept": "application/json", "content-type": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"POST",
__path,
Expand Down Expand Up @@ -4494,11 +4478,7 @@ async def scripts_painless_execute(
__body["context_setup"] = context_setup
if script is not None:
__body["script"] = script
if not __body:
__body = None # type: ignore[assignment]
__headers = {"accept": "application/json"}
if __body is not None:
__headers["content-type"] = "application/json"
__headers = {"accept": "application/json", "content-type": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"POST",
__path,
Expand Down Expand Up @@ -4774,8 +4754,8 @@ async def search(
node and the remote clusters are minimized when running cross-cluster search
(CCS) requests.
:param collapse: Collapses search results the values of the specified field.
:param default_operator: The default operator for the query string query: `AND`
or `OR`. This parameter can be used only when the `q` query string parameter
:param default_operator: The default operator for the query string query: `and`
or `or`. This parameter can be used only when the `q` query string parameter
is specified.
:param df: The field to use as a default when no field prefix is given in the
query string. This parameter can be used only when the `q` query string parameter
Expand Down Expand Up @@ -5977,11 +5957,7 @@ async def terms_enum(
__body["string"] = string
if timeout is not None:
__body["timeout"] = timeout
if not __body:
__body = None # type: ignore[assignment]
__headers = {"accept": "application/json"}
if __body is not None:
__headers["content-type"] = "application/json"
__headers = {"accept": "application/json", "content-type": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"POST",
__path,
Expand Down Expand Up @@ -6031,7 +6007,7 @@ async def termvectors(
term_statistics: t.Optional[bool] = None,
version: t.Optional[int] = None,
version_type: t.Optional[
t.Union[str, t.Literal["external", "external_gte", "force", "internal"]]
t.Union[str, t.Literal["external", "external_gte", "internal"]]
] = None,
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
Expand Down Expand Up @@ -6497,8 +6473,8 @@ async def update_by_query(
be used only when the `q` query string parameter is specified.
:param conflicts: The preferred behavior when update by query hits version conflicts:
`abort` or `proceed`.
:param default_operator: The default operator for query string query: `AND` or
`OR`. This parameter can be used only when the `q` query string parameter
:param default_operator: The default operator for query string query: `and` or
`or`. This parameter can be used only when the `q` query string parameter
is specified.
:param df: The field to use as default where no field prefix is given in the
query string. This parameter can be used only when the `q` query string parameter
Expand Down
Loading
Loading