Skip to content

Commit 48cce99

Browse files
committed
Add aliased parameters
1 parent 7c9ca83 commit 48cce99

File tree

17 files changed

+118
-38
lines changed

17 files changed

+118
-38
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3069,6 +3069,7 @@ async def search(
30693069
*,
30703070
index: Optional[Any] = None,
30713071
aggregations: Optional[Dict[str, Any]] = None,
3072+
aggs: Optional[Dict[str, Any]] = None,
30723073
allow_no_indices: Optional[bool] = None,
30733074
allow_partial_search_results: Optional[bool] = None,
30743075
analyze_wildcard: Optional[bool] = None,
@@ -3140,6 +3141,7 @@ async def search(
31403141
:param index: A comma-separated list of index names to search; use `_all` or
31413142
empty string to perform the operation on all indices
31423143
:param aggregations:
3144+
:param aggs:
31433145
:param allow_no_indices: Whether to ignore if a wildcard indices expression resolves
31443146
into no concrete indices. (This includes `_all` string or when no indices
31453147
have been specified)
@@ -3266,6 +3268,8 @@ async def search(
32663268
__query: Dict[str, Any] = {}
32673269
if aggregations is not None:
32683270
__body["aggregations"] = aggregations
3271+
if aggs is not None:
3272+
__body["aggs"] = aggs
32693273
if allow_no_indices is not None:
32703274
__query["allow_no_indices"] = allow_no_indices
32713275
if allow_partial_search_results is not None:

elasticsearch/_async/client/async_search.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ async def submit(
162162
*,
163163
index: Optional[Any] = None,
164164
aggregations: Optional[Dict[str, Any]] = None,
165+
aggs: Optional[Dict[str, Any]] = None,
165166
allow_no_indices: Optional[bool] = None,
166167
allow_partial_search_results: Optional[bool] = None,
167168
analyze_wildcard: Optional[bool] = None,
@@ -236,6 +237,7 @@ async def submit(
236237
:param index: A comma-separated list of index names to search; use `_all` or
237238
empty string to perform the operation on all indices
238239
:param aggregations:
240+
:param aggs:
239241
:param allow_no_indices: Whether to ignore if a wildcard indices expression resolves
240242
into no concrete indices. (This includes `_all` string or when no indices
241243
have been specified)
@@ -359,6 +361,8 @@ async def submit(
359361
__query: Dict[str, Any] = {}
360362
if aggregations is not None:
361363
__body["aggregations"] = aggregations
364+
if aggs is not None:
365+
__body["aggs"] = aggs
362366
if allow_no_indices is not None:
363367
__query["allow_no_indices"] = allow_no_indices
364368
if allow_partial_search_results is not None:

elasticsearch/_async/client/ml.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,6 +2614,7 @@ async def put_datafeed(
26142614
human: Optional[bool] = None,
26152615
ignore_throttled: Optional[bool] = None,
26162616
ignore_unavailable: Optional[bool] = None,
2617+
indexes: Optional[List[str]] = None,
26172618
indices: Optional[List[str]] = None,
26182619
indices_options: Optional[Any] = None,
26192620
job_id: Optional[Any] = None,
@@ -2663,6 +2664,9 @@ async def put_datafeed(
26632664
:param ignore_throttled: Ignore indices that are marked as throttled (default:
26642665
true)
26652666
:param ignore_unavailable: Ignore unavailable indexes (default: false)
2667+
:param indexes: An array of index names. Wildcards are supported. If any of the
2668+
indices are in remote clusters, the machine learning nodes must have the
2669+
`remote_cluster_client` role.
26662670
:param indices: An array of index names. Wildcards are supported. If any of the
26672671
indices are in remote clusters, the machine learning nodes must have the
26682672
`remote_cluster_client` role.
@@ -2719,6 +2723,8 @@ async def put_datafeed(
27192723
__query["ignore_throttled"] = ignore_throttled
27202724
if ignore_unavailable is not None:
27212725
__query["ignore_unavailable"] = ignore_unavailable
2726+
if indexes is not None:
2727+
__body["indexes"] = indexes
27222728
if indices is not None:
27232729
__body["indices"] = indices
27242730
if indices_options is not None:

elasticsearch/_async/client/rollup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ async def rollup_search(
296296
index: Any,
297297
type: Optional[Any] = None,
298298
aggregations: Optional[Dict[str, Any]] = None,
299+
aggs: Optional[Dict[str, Any]] = None,
299300
error_trace: Optional[bool] = None,
300301
filter_path: Optional[Union[List[str], str]] = None,
301302
human: Optional[bool] = None,
@@ -314,6 +315,7 @@ async def rollup_search(
314315
that should be searched
315316
:param type: The doc type inside the index
316317
:param aggregations:
318+
:param aggs:
317319
:param query:
318320
:param rest_total_hits_as_int: Indicates whether hits.total should be rendered
319321
as an integer or an object in the rest search response
@@ -333,6 +335,8 @@ async def rollup_search(
333335
__query: Dict[str, Any] = {}
334336
if aggregations is not None:
335337
__body["aggregations"] = aggregations
338+
if aggs is not None:
339+
__body["aggs"] = aggs
336340
if error_trace is not None:
337341
__query["error_trace"] = error_trace
338342
if filter_path is not None:

elasticsearch/_async/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async def _process_bulk_chunk(
6666

6767
try:
6868
# send the actual request
69-
resp = await client.bulk(*args, body=bulk_actions, **kwargs)
69+
resp = await client.bulk(*args, operations=bulk_actions, **kwargs)
7070
except TransportError as e:
7171
gen = _process_bulk_chunk_error(
7272
error=e,

elasticsearch/_sync/client/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3029,6 +3029,7 @@ def search(
30293029
*,
30303030
index: Optional[Any] = None,
30313031
aggregations: Optional[Dict[str, Any]] = None,
3032+
aggs: Optional[Dict[str, Any]] = None,
30323033
allow_no_indices: Optional[bool] = None,
30333034
allow_partial_search_results: Optional[bool] = None,
30343035
analyze_wildcard: Optional[bool] = None,
@@ -3100,6 +3101,7 @@ def search(
31003101
:param index: A comma-separated list of index names to search; use `_all` or
31013102
empty string to perform the operation on all indices
31023103
:param aggregations:
3104+
:param aggs:
31033105
:param allow_no_indices: Whether to ignore if a wildcard indices expression resolves
31043106
into no concrete indices. (This includes `_all` string or when no indices
31053107
have been specified)
@@ -3226,6 +3228,8 @@ def search(
32263228
__query: Dict[str, Any] = {}
32273229
if aggregations is not None:
32283230
__body["aggregations"] = aggregations
3231+
if aggs is not None:
3232+
__body["aggs"] = aggs
32293233
if allow_no_indices is not None:
32303234
__query["allow_no_indices"] = allow_no_indices
32313235
if allow_partial_search_results is not None:

elasticsearch/_sync/client/async_search.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def submit(
162162
*,
163163
index: Optional[Any] = None,
164164
aggregations: Optional[Dict[str, Any]] = None,
165+
aggs: Optional[Dict[str, Any]] = None,
165166
allow_no_indices: Optional[bool] = None,
166167
allow_partial_search_results: Optional[bool] = None,
167168
analyze_wildcard: Optional[bool] = None,
@@ -236,6 +237,7 @@ def submit(
236237
:param index: A comma-separated list of index names to search; use `_all` or
237238
empty string to perform the operation on all indices
238239
:param aggregations:
240+
:param aggs:
239241
:param allow_no_indices: Whether to ignore if a wildcard indices expression resolves
240242
into no concrete indices. (This includes `_all` string or when no indices
241243
have been specified)
@@ -359,6 +361,8 @@ def submit(
359361
__query: Dict[str, Any] = {}
360362
if aggregations is not None:
361363
__body["aggregations"] = aggregations
364+
if aggs is not None:
365+
__body["aggs"] = aggs
362366
if allow_no_indices is not None:
363367
__query["allow_no_indices"] = allow_no_indices
364368
if allow_partial_search_results is not None:

elasticsearch/_sync/client/ml.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2576,6 +2576,7 @@ def put_datafeed(
25762576
human: Optional[bool] = None,
25772577
ignore_throttled: Optional[bool] = None,
25782578
ignore_unavailable: Optional[bool] = None,
2579+
indexes: Optional[List[str]] = None,
25792580
indices: Optional[List[str]] = None,
25802581
indices_options: Optional[Any] = None,
25812582
job_id: Optional[Any] = None,
@@ -2625,6 +2626,9 @@ def put_datafeed(
26252626
:param ignore_throttled: Ignore indices that are marked as throttled (default:
26262627
true)
26272628
:param ignore_unavailable: Ignore unavailable indexes (default: false)
2629+
:param indexes: An array of index names. Wildcards are supported. If any of the
2630+
indices are in remote clusters, the machine learning nodes must have the
2631+
`remote_cluster_client` role.
26282632
:param indices: An array of index names. Wildcards are supported. If any of the
26292633
indices are in remote clusters, the machine learning nodes must have the
26302634
`remote_cluster_client` role.
@@ -2681,6 +2685,8 @@ def put_datafeed(
26812685
__query["ignore_throttled"] = ignore_throttled
26822686
if ignore_unavailable is not None:
26832687
__query["ignore_unavailable"] = ignore_unavailable
2688+
if indexes is not None:
2689+
__body["indexes"] = indexes
26842690
if indices is not None:
26852691
__body["indices"] = indices
26862692
if indices_options is not None:

elasticsearch/_sync/client/rollup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ def rollup_search(
292292
index: Any,
293293
type: Optional[Any] = None,
294294
aggregations: Optional[Dict[str, Any]] = None,
295+
aggs: Optional[Dict[str, Any]] = None,
295296
error_trace: Optional[bool] = None,
296297
filter_path: Optional[Union[List[str], str]] = None,
297298
human: Optional[bool] = None,
@@ -310,6 +311,7 @@ def rollup_search(
310311
that should be searched
311312
:param type: The doc type inside the index
312313
:param aggregations:
314+
:param aggs:
313315
:param query:
314316
:param rest_total_hits_as_int: Indicates whether hits.total should be rendered
315317
as an integer or an object in the rest search response
@@ -329,6 +331,8 @@ def rollup_search(
329331
__query: Dict[str, Any] = {}
330332
if aggregations is not None:
331333
__body["aggregations"] = aggregations
334+
if aggs is not None:
335+
__body["aggs"] = aggs
332336
if error_trace is not None:
333337
__query["error_trace"] = error_trace
334338
if filter_path is not None:

elasticsearch/_sync/client/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def _quote(value: Any) -> str:
237237

238238

239239
def _quote_query(query: Dict[str, Any]) -> str:
240-
return "&".join([f"{k}={percent_encode(_escape(v), ',*')}" for k, v in query.items()])
240+
return "&".join([f"{k}={_quote(v)}" for k, v in query.items()])
241241

242242

243243
def _merge_kwargs_no_duplicates(kwargs: Dict[str, Any], values: Dict[str, Any]) -> None:

0 commit comments

Comments
 (0)