@@ -396,8 +396,8 @@ async def submit(
396
396
__path = f"/{ _quote (index )} /_async_search"
397
397
else :
398
398
__path = "/_async_search"
399
- __body : t .Dict [str , t .Any ] = {}
400
399
__query : t .Dict [str , t .Any ] = {}
400
+ __body : t .Dict [str , t .Any ] = {}
401
401
# The 'sort' parameter with a colon can't be encoded to the body.
402
402
if sort is not None and (
403
403
(isinstance (sort , str ) and ":" in sort )
@@ -409,10 +409,6 @@ async def submit(
409
409
):
410
410
__query ["sort" ] = sort
411
411
sort = None
412
- if aggregations is not None :
413
- __body ["aggregations" ] = aggregations
414
- if aggs is not None :
415
- __body ["aggs" ] = aggs
416
412
if allow_no_indices is not None :
417
413
__query ["allow_no_indices" ] = allow_no_indices
418
414
if allow_partial_search_results is not None :
@@ -425,86 +421,106 @@ async def submit(
425
421
__query ["batched_reduce_size" ] = batched_reduce_size
426
422
if ccs_minimize_roundtrips is not None :
427
423
__query ["ccs_minimize_roundtrips" ] = ccs_minimize_roundtrips
428
- if collapse is not None :
429
- __body ["collapse" ] = collapse
430
424
if default_operator is not None :
431
425
__query ["default_operator" ] = default_operator
432
426
if df is not None :
433
427
__query ["df" ] = df
434
- if docvalue_fields is not None :
435
- __body ["docvalue_fields" ] = docvalue_fields
436
428
if error_trace is not None :
437
429
__query ["error_trace" ] = error_trace
438
430
if expand_wildcards is not None :
439
431
__query ["expand_wildcards" ] = expand_wildcards
440
- if explain is not None :
441
- __body ["explain" ] = explain
442
- if ext is not None :
443
- __body ["ext" ] = ext
444
- if fields is not None :
445
- __body ["fields" ] = fields
446
432
if filter_path is not None :
447
433
__query ["filter_path" ] = filter_path
448
- if from_ is not None :
449
- __body ["from" ] = from_
450
- if highlight is not None :
451
- __body ["highlight" ] = highlight
452
434
if human is not None :
453
435
__query ["human" ] = human
454
436
if ignore_throttled is not None :
455
437
__query ["ignore_throttled" ] = ignore_throttled
456
438
if ignore_unavailable is not None :
457
439
__query ["ignore_unavailable" ] = ignore_unavailable
458
- if indices_boost is not None :
459
- __body ["indices_boost" ] = indices_boost
460
440
if keep_alive is not None :
461
441
__query ["keep_alive" ] = keep_alive
462
442
if keep_on_completion is not None :
463
443
__query ["keep_on_completion" ] = keep_on_completion
464
- if knn is not None :
465
- __body ["knn" ] = knn
466
444
if lenient is not None :
467
445
__query ["lenient" ] = lenient
468
446
if max_concurrent_shard_requests is not None :
469
447
__query ["max_concurrent_shard_requests" ] = max_concurrent_shard_requests
470
448
if min_compatible_shard_node is not None :
471
449
__query ["min_compatible_shard_node" ] = min_compatible_shard_node
472
- if min_score is not None :
473
- __body ["min_score" ] = min_score
474
- if pit is not None :
475
- __body ["pit" ] = pit
476
- if post_filter is not None :
477
- __body ["post_filter" ] = post_filter
478
450
if pre_filter_shard_size is not None :
479
451
__query ["pre_filter_shard_size" ] = pre_filter_shard_size
480
452
if preference is not None :
481
453
__query ["preference" ] = preference
482
454
if pretty is not None :
483
455
__query ["pretty" ] = pretty
484
- if profile is not None :
485
- __body ["profile" ] = profile
486
456
if q is not None :
487
457
__query ["q" ] = q
488
- if query is not None :
489
- __body ["query" ] = query
490
458
if request_cache is not None :
491
459
__query ["request_cache" ] = request_cache
492
- if rescore is not None :
493
- __body ["rescore" ] = rescore
494
460
if rest_total_hits_as_int is not None :
495
461
__query ["rest_total_hits_as_int" ] = rest_total_hits_as_int
496
462
if routing is not None :
497
463
__query ["routing" ] = routing
464
+ if scroll is not None :
465
+ __query ["scroll" ] = scroll
466
+ if search_type is not None :
467
+ __query ["search_type" ] = search_type
468
+ if source_excludes is not None :
469
+ __query ["_source_excludes" ] = source_excludes
470
+ if source_includes is not None :
471
+ __query ["_source_includes" ] = source_includes
472
+ if suggest_field is not None :
473
+ __query ["suggest_field" ] = suggest_field
474
+ if suggest_mode is not None :
475
+ __query ["suggest_mode" ] = suggest_mode
476
+ if suggest_size is not None :
477
+ __query ["suggest_size" ] = suggest_size
478
+ if suggest_text is not None :
479
+ __query ["suggest_text" ] = suggest_text
480
+ if typed_keys is not None :
481
+ __query ["typed_keys" ] = typed_keys
482
+ if wait_for_completion_timeout is not None :
483
+ __query ["wait_for_completion_timeout" ] = wait_for_completion_timeout
484
+ if aggregations is not None :
485
+ __body ["aggregations" ] = aggregations
486
+ if aggs is not None :
487
+ __body ["aggs" ] = aggs
488
+ if collapse is not None :
489
+ __body ["collapse" ] = collapse
490
+ if docvalue_fields is not None :
491
+ __body ["docvalue_fields" ] = docvalue_fields
492
+ if explain is not None :
493
+ __body ["explain" ] = explain
494
+ if ext is not None :
495
+ __body ["ext" ] = ext
496
+ if fields is not None :
497
+ __body ["fields" ] = fields
498
+ if from_ is not None :
499
+ __body ["from" ] = from_
500
+ if highlight is not None :
501
+ __body ["highlight" ] = highlight
502
+ if indices_boost is not None :
503
+ __body ["indices_boost" ] = indices_boost
504
+ if knn is not None :
505
+ __body ["knn" ] = knn
506
+ if min_score is not None :
507
+ __body ["min_score" ] = min_score
508
+ if pit is not None :
509
+ __body ["pit" ] = pit
510
+ if post_filter is not None :
511
+ __body ["post_filter" ] = post_filter
512
+ if profile is not None :
513
+ __body ["profile" ] = profile
514
+ if query is not None :
515
+ __body ["query" ] = query
516
+ if rescore is not None :
517
+ __body ["rescore" ] = rescore
498
518
if runtime_mappings is not None :
499
519
__body ["runtime_mappings" ] = runtime_mappings
500
520
if script_fields is not None :
501
521
__body ["script_fields" ] = script_fields
502
- if scroll is not None :
503
- __query ["scroll" ] = scroll
504
522
if search_after is not None :
505
523
__body ["search_after" ] = search_after
506
- if search_type is not None :
507
- __query ["search_type" ] = search_type
508
524
if seq_no_primary_term is not None :
509
525
__body ["seq_no_primary_term" ] = seq_no_primary_term
510
526
if size is not None :
@@ -515,24 +531,12 @@ async def submit(
515
531
__body ["sort" ] = sort
516
532
if source is not None :
517
533
__body ["_source" ] = source
518
- if source_excludes is not None :
519
- __query ["_source_excludes" ] = source_excludes
520
- if source_includes is not None :
521
- __query ["_source_includes" ] = source_includes
522
534
if stats is not None :
523
535
__body ["stats" ] = stats
524
536
if stored_fields is not None :
525
537
__body ["stored_fields" ] = stored_fields
526
538
if suggest is not None :
527
539
__body ["suggest" ] = suggest
528
- if suggest_field is not None :
529
- __query ["suggest_field" ] = suggest_field
530
- if suggest_mode is not None :
531
- __query ["suggest_mode" ] = suggest_mode
532
- if suggest_size is not None :
533
- __query ["suggest_size" ] = suggest_size
534
- if suggest_text is not None :
535
- __query ["suggest_text" ] = suggest_text
536
540
if terminate_after is not None :
537
541
__body ["terminate_after" ] = terminate_after
538
542
if timeout is not None :
@@ -541,12 +545,8 @@ async def submit(
541
545
__body ["track_scores" ] = track_scores
542
546
if track_total_hits is not None :
543
547
__body ["track_total_hits" ] = track_total_hits
544
- if typed_keys is not None :
545
- __query ["typed_keys" ] = typed_keys
546
548
if version is not None :
547
549
__body ["version" ] = version
548
- if wait_for_completion_timeout is not None :
549
- __query ["wait_for_completion_timeout" ] = wait_for_completion_timeout
550
550
if not __body :
551
551
__body = None # type: ignore[assignment]
552
552
__headers = {"accept" : "application/json" }
0 commit comments