Skip to content

Commit

Permalink
Updated opensearch-py to reflect the latest OpenSearch API spec (2025…
Browse files Browse the repository at this point in the history
…-01-05)

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
saimedhi authored and github-actions[bot] committed Jan 5, 2025
1 parent 4cdf81e commit b8e6196
Show file tree
Hide file tree
Showing 21 changed files with 1,991 additions and 616 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added option to pass custom headers to 'AWSV4SignerAsyncAuth' ([863](https://github.com/opensearch-project/opensearch-py/pull/863))
- Added sync and async sample that uses `search_after` parameter ([859](https://github.com/opensearch-project/opensearch-py/pull/859))
### Updated APIs
- Updated opensearch-py APIs to reflect [opensearch-api-specification@db45550](https://github.com/opensearch-project/opensearch-api-specification/commit/db455506197c1b54aa3a4e02f8fa07c370243fdf)
### Changed
- Small refactor of AWS Signer classes for both sync and async clients ([866](https://github.com/opensearch-project/opensearch-py/pull/866))
- Small refactor to fix overwriting the module files when generating apis ([874](https://github.com/opensearch-project/opensearch-py/pull/874))
Expand Down
24 changes: 15 additions & 9 deletions opensearchpy/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ async def count(
specified.
:arg default_operator: The default operator for query string
query: `AND` or `OR`. This parameter can only be used when the `q` query
string parameter is specified. Valid choices are and, or.
string parameter is specified. Valid choices are and, AND, or, OR.
:arg df: Field to use as default where no field prefix is given
in the query string. This parameter can only be used when the `q` query
string parameter is specified.
Expand Down Expand Up @@ -855,7 +855,7 @@ async def delete_by_query(
:arg conflicts: What to do if delete by query hits version
conflicts: `abort` or `proceed`. Valid choices are abort, proceed.
:arg default_operator: The default operator for query string
query: `AND` or `OR`. Valid choices are and, or.
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
:arg df: Field to use as default where no field prefix is given
in the query string.
:arg error_trace: Whether to include the stack trace of returned
Expand Down Expand Up @@ -1225,7 +1225,7 @@ async def explain(
parameter can only be used when the `q` query string parameter is
specified.
:arg default_operator: The default operator for query string
query: `AND` or `OR`. Valid choices are and, or.
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
:arg df: Field to use as default where no field prefix is given
in the query string. Default is _all.
:arg error_trace: Whether to include the stack trace of returned
Expand Down Expand Up @@ -2020,7 +2020,7 @@ async def reindex_rethrottle(
headers: Any = None,
) -> Any:
"""
Changes the number of requests per second for a particular Reindex operation.
Changes the number of requests per second for a particular reindex operation.
:arg task_id: Identifier for the task.
Expand Down Expand Up @@ -2138,8 +2138,6 @@ async def scroll(
Allows to retrieve a large numbers of results from a single search request.
:arg body: The scroll ID if not passed by URL or query
parameter.
:arg scroll_id: The scroll ID for scrolled search
:arg error_trace: Whether to include the stack trace of returned
errors. Default is false.
Expand Down Expand Up @@ -2281,7 +2279,7 @@ async def search(
executing cross-cluster search (CCS) requests. Default is True.
:arg default_operator: The default operator for query string
query: AND or OR. This parameter can only be used when the `q` query
string parameter is specified. Valid choices are and, or.
string parameter is specified. Valid choices are and, AND, or, OR.
:arg df: Field to use as default where no field prefix is given
in the query string. This parameter can only be used when the q query
string parameter is specified.
Expand Down Expand Up @@ -2451,6 +2449,7 @@ async def search(
)
async def search_shards(
self,
body: Any = None,
index: Any = None,
params: Any = None,
headers: Any = None,
Expand All @@ -2460,6 +2459,9 @@ async def search_shards(
executed against.
:arg body: Defines the parameters that can be used in the
`search_shards` endpoint request. See documentation for supported query
syntax.
:arg index: Returns the indexes and shards that a search request
would be executed against.
:arg allow_no_indices: If `false`, the request returns an error
Expand Down Expand Up @@ -2495,7 +2497,11 @@ async def search_shards(
libraries that do not accept a request body for non-POST requests.
"""
return await self.transport.perform_request(
"GET", _make_path(index, "_search_shards"), params=params, headers=headers
"POST",
_make_path(index, "_search_shards"),
params=params,
headers=headers,
body=body,
)

@query_params(
Expand Down Expand Up @@ -2834,7 +2840,7 @@ async def update_by_query(
:arg conflicts: What to do if update by query hits version
conflicts: `abort` or `proceed`. Valid choices are abort, proceed.
:arg default_operator: The default operator for query string
query: `AND` or `OR`. Valid choices are and, or.
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
:arg df: Field to use as default where no field prefix is given
in the query string.
:arg error_trace: Whether to include the stack trace of returned
Expand Down
Loading

0 comments on commit b8e6196

Please sign in to comment.