Skip to content

Commit 098b030

Browse files
saimedhigithub-actions[bot]
authored andcommitted
Updated opensearch-py to reflect the latest OpenSearch API spec (2025-01-03)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 4cdf81e commit 098b030

21 files changed

+1639
-616
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66
- Added option to pass custom headers to 'AWSV4SignerAsyncAuth' ([863](https://github.com/opensearch-project/opensearch-py/pull/863))
77
- Added sync and async sample that uses `search_after` parameter ([859](https://github.com/opensearch-project/opensearch-py/pull/859))
88
### Updated APIs
9+
- Updated opensearch-py APIs to reflect [opensearch-api-specification@3d88921](https://github.com/opensearch-project/opensearch-api-specification/commit/3d88921265d1dfeacc64e4bd05c8b3837bc0e0aa)
910
### Changed
1011
- Small refactor of AWS Signer classes for both sync and async clients ([866](https://github.com/opensearch-project/opensearch-py/pull/866))
1112
- Small refactor to fix overwriting the module files when generating apis ([874](https://github.com/opensearch-project/opensearch-py/pull/874))

opensearchpy/_async/client/__init__.py

+15-9
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ async def count(
667667
specified.
668668
:arg default_operator: The default operator for query string
669669
query: `AND` or `OR`. This parameter can only be used when the `q` query
670-
string parameter is specified. Valid choices are and, or.
670+
string parameter is specified. Valid choices are and, AND, or, OR.
671671
:arg df: Field to use as default where no field prefix is given
672672
in the query string. This parameter can only be used when the `q` query
673673
string parameter is specified.
@@ -855,7 +855,7 @@ async def delete_by_query(
855855
:arg conflicts: What to do if delete by query hits version
856856
conflicts: `abort` or `proceed`. Valid choices are abort, proceed.
857857
:arg default_operator: The default operator for query string
858-
query: `AND` or `OR`. Valid choices are and, or.
858+
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
859859
:arg df: Field to use as default where no field prefix is given
860860
in the query string.
861861
:arg error_trace: Whether to include the stack trace of returned
@@ -1225,7 +1225,7 @@ async def explain(
12251225
parameter can only be used when the `q` query string parameter is
12261226
specified.
12271227
:arg default_operator: The default operator for query string
1228-
query: `AND` or `OR`. Valid choices are and, or.
1228+
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
12291229
:arg df: Field to use as default where no field prefix is given
12301230
in the query string. Default is _all.
12311231
:arg error_trace: Whether to include the stack trace of returned
@@ -2020,7 +2020,7 @@ async def reindex_rethrottle(
20202020
headers: Any = None,
20212021
) -> Any:
20222022
"""
2023-
Changes the number of requests per second for a particular Reindex operation.
2023+
Changes the number of requests per second for a particular reindex operation.
20242024
20252025
20262026
:arg task_id: Identifier for the task.
@@ -2138,8 +2138,6 @@ async def scroll(
21382138
Allows to retrieve a large numbers of results from a single search request.
21392139
21402140
2141-
:arg body: The scroll ID if not passed by URL or query
2142-
parameter.
21432141
:arg scroll_id: The scroll ID for scrolled search
21442142
:arg error_trace: Whether to include the stack trace of returned
21452143
errors. Default is false.
@@ -2281,7 +2279,7 @@ async def search(
22812279
executing cross-cluster search (CCS) requests. Default is True.
22822280
:arg default_operator: The default operator for query string
22832281
query: AND or OR. This parameter can only be used when the `q` query
2284-
string parameter is specified. Valid choices are and, or.
2282+
string parameter is specified. Valid choices are and, AND, or, OR.
22852283
:arg df: Field to use as default where no field prefix is given
22862284
in the query string. This parameter can only be used when the q query
22872285
string parameter is specified.
@@ -2451,6 +2449,7 @@ async def search(
24512449
)
24522450
async def search_shards(
24532451
self,
2452+
body: Any = None,
24542453
index: Any = None,
24552454
params: Any = None,
24562455
headers: Any = None,
@@ -2460,6 +2459,9 @@ async def search_shards(
24602459
executed against.
24612460
24622461
2462+
:arg body: Defines the parameters that can be used in the
2463+
`search_shards` endpoint request. See documentation for supported query
2464+
syntax.
24632465
:arg index: Returns the indexes and shards that a search request
24642466
would be executed against.
24652467
:arg allow_no_indices: If `false`, the request returns an error
@@ -2495,7 +2497,11 @@ async def search_shards(
24952497
libraries that do not accept a request body for non-POST requests.
24962498
"""
24972499
return await self.transport.perform_request(
2498-
"GET", _make_path(index, "_search_shards"), params=params, headers=headers
2500+
"POST",
2501+
_make_path(index, "_search_shards"),
2502+
params=params,
2503+
headers=headers,
2504+
body=body,
24992505
)
25002506

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

0 commit comments

Comments
 (0)