-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathSubmitAsyncSearchRequest.g.cs
3390 lines (3017 loc) · 122 KB
/
SubmitAsyncSearchRequest.g.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------
#nullable restore
using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Requests;
using Elastic.Clients.Elasticsearch.Serialization;
using Elastic.Transport;
using Elastic.Transport.Extensions;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.AsyncSearch;
public sealed partial class SubmitAsyncSearchRequestParameters : RequestParameters
{
/// <summary>
/// <para>
/// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes <c>_all</c> string or when no indices have been specified)
/// </para>
/// </summary>
public bool? AllowNoIndices { get => Q<bool?>("allow_no_indices"); set => Q("allow_no_indices", value); }
/// <summary>
/// <para>
/// Indicate if an error should be returned if there is a partial search failure or timeout
/// </para>
/// </summary>
public bool? AllowPartialSearchResults { get => Q<bool?>("allow_partial_search_results"); set => Q("allow_partial_search_results", value); }
/// <summary>
/// <para>
/// The analyzer to use for the query string
/// </para>
/// </summary>
public string? Analyzer { get => Q<string?>("analyzer"); set => Q("analyzer", value); }
/// <summary>
/// <para>
/// Specify whether wildcard and prefix queries should be analyzed (default: false)
/// </para>
/// </summary>
public bool? AnalyzeWildcard { get => Q<bool?>("analyze_wildcard"); set => Q("analyze_wildcard", value); }
/// <summary>
/// <para>
/// Affects how often partial results become available, which happens whenever shard results are reduced.
/// A partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).
/// </para>
/// </summary>
public long? BatchedReduceSize { get => Q<long?>("batched_reduce_size"); set => Q("batched_reduce_size", value); }
/// <summary>
/// <para>
/// The default value is the only supported value.
/// </para>
/// </summary>
public bool? CcsMinimizeRoundtrips { get => Q<bool?>("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); }
/// <summary>
/// <para>
/// The default operator for query string query (AND or OR)
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.QueryDsl.Operator? DefaultOperator { get => Q<Elastic.Clients.Elasticsearch.QueryDsl.Operator?>("default_operator"); set => Q("default_operator", value); }
/// <summary>
/// <para>
/// The field to use as default where no field prefix is given in the query string
/// </para>
/// </summary>
public string? Df { get => Q<string?>("df"); set => Q("df", value); }
/// <summary>
/// <para>
/// Whether to expand wildcard expression to concrete indices that are open, closed or both.
/// </para>
/// </summary>
public ICollection<Elastic.Clients.Elasticsearch.ExpandWildcard>? ExpandWildcards { get => Q<ICollection<Elastic.Clients.Elasticsearch.ExpandWildcard>?>("expand_wildcards"); set => Q("expand_wildcards", value); }
/// <summary>
/// <para>
/// Whether specified concrete, expanded or aliased indices should be ignored when throttled
/// </para>
/// </summary>
public bool? IgnoreThrottled { get => Q<bool?>("ignore_throttled"); set => Q("ignore_throttled", value); }
/// <summary>
/// <para>
/// Whether specified concrete indices should be ignored when unavailable (missing or closed)
/// </para>
/// </summary>
public bool? IgnoreUnavailable { get => Q<bool?>("ignore_unavailable"); set => Q("ignore_unavailable", value); }
/// <summary>
/// <para>
/// Specifies how long the async search needs to be available.
/// Ongoing async searches and any saved search results are deleted after this period.
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.Duration? KeepAlive { get => Q<Elastic.Clients.Elasticsearch.Duration?>("keep_alive"); set => Q("keep_alive", value); }
/// <summary>
/// <para>
/// If <c>true</c>, results are stored for later retrieval when the search completes within the <c>wait_for_completion_timeout</c>.
/// </para>
/// </summary>
public bool? KeepOnCompletion { get => Q<bool?>("keep_on_completion"); set => Q("keep_on_completion", value); }
/// <summary>
/// <para>
/// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
/// </para>
/// </summary>
public bool? Lenient { get => Q<bool?>("lenient"); set => Q("lenient", value); }
/// <summary>
/// <para>
/// The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
/// </para>
/// </summary>
public long? MaxConcurrentShardRequests { get => Q<long?>("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", value); }
public string? MinCompatibleShardNode { get => Q<string?>("min_compatible_shard_node"); set => Q("min_compatible_shard_node", value); }
/// <summary>
/// <para>
/// Specify the node or shard the operation should be performed on (default: random)
/// </para>
/// </summary>
public string? Preference { get => Q<string?>("preference"); set => Q("preference", value); }
/// <summary>
/// <para>
/// Query in the Lucene query string syntax
/// </para>
/// </summary>
public string? QueryLuceneSyntax { get => Q<string?>("q"); set => Q("q", value); }
/// <summary>
/// <para>
/// Specify if request cache should be used for this request or not, defaults to true
/// </para>
/// </summary>
public bool? RequestCache { get => Q<bool?>("request_cache"); set => Q("request_cache", value); }
/// <summary>
/// <para>
/// Indicates whether hits.total should be rendered as an integer or an object in the rest search response
/// </para>
/// </summary>
public bool? RestTotalHitsAsInt { get => Q<bool?>("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); }
/// <summary>
/// <para>
/// A comma-separated list of specific routing values
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.Routing? Routing { get => Q<Elastic.Clients.Elasticsearch.Routing?>("routing"); set => Q("routing", value); }
/// <summary>
/// <para>
/// Search operation type
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.SearchType? SearchType { get => Q<Elastic.Clients.Elasticsearch.SearchType?>("search_type"); set => Q("search_type", value); }
/// <summary>
/// <para>
/// A list of fields to exclude from the returned _source field
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.Fields? SourceExcludes { get => Q<Elastic.Clients.Elasticsearch.Fields?>("_source_excludes"); set => Q("_source_excludes", value); }
/// <summary>
/// <para>
/// A list of fields to extract and return from the _source field
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.Fields? SourceIncludes { get => Q<Elastic.Clients.Elasticsearch.Fields?>("_source_includes"); set => Q("_source_includes", value); }
/// <summary>
/// <para>
/// Specifies which field to use for suggestions.
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.Field? SuggestField { get => Q<Elastic.Clients.Elasticsearch.Field?>("suggest_field"); set => Q("suggest_field", value); }
/// <summary>
/// <para>
/// Specify suggest mode
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.SuggestMode? SuggestMode { get => Q<Elastic.Clients.Elasticsearch.SuggestMode?>("suggest_mode"); set => Q("suggest_mode", value); }
/// <summary>
/// <para>
/// How many suggestions to return in response
/// </para>
/// </summary>
public long? SuggestSize { get => Q<long?>("suggest_size"); set => Q("suggest_size", value); }
/// <summary>
/// <para>
/// The source text for which the suggestions should be returned.
/// </para>
/// </summary>
public string? SuggestText { get => Q<string?>("suggest_text"); set => Q("suggest_text", value); }
/// <summary>
/// <para>
/// Specify whether aggregation and suggester names should be prefixed by their respective types in the response
/// </para>
/// </summary>
public bool? TypedKeys { get => Q<bool?>("typed_keys"); set => Q("typed_keys", value); }
/// <summary>
/// <para>
/// Blocks and waits until the search is completed up to a certain timeout.
/// When the async search completes within the timeout, the response won’t include the ID as the results are not stored in the cluster.
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q<Elastic.Clients.Elasticsearch.Duration?>("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
}
internal sealed partial class SubmitAsyncSearchRequestConverter : JsonConverter<SubmitAsyncSearchRequest>
{
public override SubmitAsyncSearchRequest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.StartObject)
throw new JsonException("Unexpected JSON detected.");
var variant = new SubmitAsyncSearchRequest();
while (reader.Read() && reader.TokenType != JsonTokenType.EndObject)
{
if (reader.TokenType == JsonTokenType.PropertyName)
{
var property = reader.GetString();
if (property == "aggregations" || property == "aggs")
{
variant.Aggregations = JsonSerializer.Deserialize<IDictionary<string, Elastic.Clients.Elasticsearch.Aggregations.Aggregation>?>(ref reader, options);
continue;
}
if (property == "collapse")
{
variant.Collapse = JsonSerializer.Deserialize<Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse?>(ref reader, options);
continue;
}
if (property == "docvalue_fields")
{
variant.DocvalueFields = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat>?>(ref reader, options);
continue;
}
if (property == "explain")
{
variant.Explain = JsonSerializer.Deserialize<bool?>(ref reader, options);
continue;
}
if (property == "ext")
{
variant.Ext = JsonSerializer.Deserialize<IDictionary<string, object>?>(ref reader, options);
continue;
}
if (property == "fields")
{
variant.Fields = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat>?>(ref reader, options);
continue;
}
if (property == "from")
{
variant.From = JsonSerializer.Deserialize<int?>(ref reader, options);
continue;
}
if (property == "highlight")
{
variant.Highlight = JsonSerializer.Deserialize<Elastic.Clients.Elasticsearch.Core.Search.Highlight?>(ref reader, options);
continue;
}
if (property == "indices_boost")
{
variant.IndicesBoost = JsonSerializer.Deserialize<ICollection<IDictionary<Elastic.Clients.Elasticsearch.IndexName, double>>?>(ref reader, options);
continue;
}
if (property == "knn")
{
variant.Knn = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.KnnSearch>?>(ref reader, options);
continue;
}
if (property == "min_score")
{
variant.MinScore = JsonSerializer.Deserialize<double?>(ref reader, options);
continue;
}
if (property == "pit")
{
variant.Pit = JsonSerializer.Deserialize<Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference?>(ref reader, options);
continue;
}
if (property == "post_filter")
{
variant.PostFilter = JsonSerializer.Deserialize<Elastic.Clients.Elasticsearch.QueryDsl.Query?>(ref reader, options);
continue;
}
if (property == "profile")
{
variant.Profile = JsonSerializer.Deserialize<bool?>(ref reader, options);
continue;
}
if (property == "query")
{
variant.Query = JsonSerializer.Deserialize<Elastic.Clients.Elasticsearch.QueryDsl.Query?>(ref reader, options);
continue;
}
if (property == "rescore")
{
variant.Rescore = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.Core.Search.Rescore>?>(ref reader, options);
continue;
}
if (property == "runtime_mappings")
{
variant.RuntimeMappings = JsonSerializer.Deserialize<IDictionary<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.Mapping.RuntimeField>?>(ref reader, options);
continue;
}
if (property == "script_fields")
{
variant.ScriptFields = JsonSerializer.Deserialize<IDictionary<string, Elastic.Clients.Elasticsearch.ScriptField>?>(ref reader, options);
continue;
}
if (property == "search_after")
{
variant.SearchAfter = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.FieldValue>?>(ref reader, options);
continue;
}
if (property == "seq_no_primary_term")
{
variant.SeqNoPrimaryTerm = JsonSerializer.Deserialize<bool?>(ref reader, options);
continue;
}
if (property == "size")
{
variant.Size = JsonSerializer.Deserialize<int?>(ref reader, options);
continue;
}
if (property == "slice")
{
variant.Slice = JsonSerializer.Deserialize<Elastic.Clients.Elasticsearch.SlicedScroll?>(ref reader, options);
continue;
}
if (property == "sort")
{
variant.Sort = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.SortOptions>?>(ref reader, options);
continue;
}
if (property == "_source")
{
variant.Source = JsonSerializer.Deserialize<Elastic.Clients.Elasticsearch.Core.Search.SourceConfig?>(ref reader, options);
continue;
}
if (property == "stats")
{
variant.Stats = JsonSerializer.Deserialize<ICollection<string>?>(ref reader, options);
continue;
}
if (property == "stored_fields")
{
variant.StoredFields = JsonSerializer.Deserialize<Elastic.Clients.Elasticsearch.Fields?>(ref reader, options);
continue;
}
if (property == "suggest")
{
variant.Suggest = JsonSerializer.Deserialize<Elastic.Clients.Elasticsearch.Core.Search.Suggester?>(ref reader, options);
continue;
}
if (property == "terminate_after")
{
variant.TerminateAfter = JsonSerializer.Deserialize<long?>(ref reader, options);
continue;
}
if (property == "timeout")
{
variant.Timeout = JsonSerializer.Deserialize<string?>(ref reader, options);
continue;
}
if (property == "track_scores")
{
variant.TrackScores = JsonSerializer.Deserialize<bool?>(ref reader, options);
continue;
}
if (property == "track_total_hits")
{
variant.TrackTotalHits = JsonSerializer.Deserialize<Elastic.Clients.Elasticsearch.Core.Search.TrackHits?>(ref reader, options);
continue;
}
if (property == "version")
{
variant.Version = JsonSerializer.Deserialize<bool?>(ref reader, options);
continue;
}
}
}
return variant;
}
public override void Write(Utf8JsonWriter writer, SubmitAsyncSearchRequest value, JsonSerializerOptions options)
{
writer.WriteStartObject();
if (value.Aggregations is not null)
{
writer.WritePropertyName("aggregations");
JsonSerializer.Serialize(writer, value.Aggregations, options);
}
if (value.Collapse is not null)
{
writer.WritePropertyName("collapse");
JsonSerializer.Serialize(writer, value.Collapse, options);
}
if (value.DocvalueFields is not null)
{
writer.WritePropertyName("docvalue_fields");
JsonSerializer.Serialize(writer, value.DocvalueFields, options);
}
if (value.Explain.HasValue)
{
writer.WritePropertyName("explain");
writer.WriteBooleanValue(value.Explain.Value);
}
if (value.Ext is not null)
{
writer.WritePropertyName("ext");
JsonSerializer.Serialize(writer, value.Ext, options);
}
if (value.Fields is not null)
{
writer.WritePropertyName("fields");
JsonSerializer.Serialize(writer, value.Fields, options);
}
if (value.From.HasValue)
{
writer.WritePropertyName("from");
writer.WriteNumberValue(value.From.Value);
}
if (value.Highlight is not null)
{
writer.WritePropertyName("highlight");
JsonSerializer.Serialize(writer, value.Highlight, options);
}
if (value.IndicesBoost is not null)
{
writer.WritePropertyName("indices_boost");
JsonSerializer.Serialize(writer, value.IndicesBoost, options);
}
if (value.Knn is not null)
{
writer.WritePropertyName("knn");
JsonSerializer.Serialize(writer, value.Knn, options);
}
if (value.MinScore.HasValue)
{
writer.WritePropertyName("min_score");
writer.WriteNumberValue(value.MinScore.Value);
}
if (value.Pit is not null)
{
writer.WritePropertyName("pit");
JsonSerializer.Serialize(writer, value.Pit, options);
}
if (value.PostFilter is not null)
{
writer.WritePropertyName("post_filter");
JsonSerializer.Serialize(writer, value.PostFilter, options);
}
if (value.Profile.HasValue)
{
writer.WritePropertyName("profile");
writer.WriteBooleanValue(value.Profile.Value);
}
if (value.Query is not null)
{
writer.WritePropertyName("query");
JsonSerializer.Serialize(writer, value.Query, options);
}
if (value.Rescore is not null)
{
writer.WritePropertyName("rescore");
JsonSerializer.Serialize(writer, value.Rescore, options);
}
if (value.RuntimeMappings is not null)
{
writer.WritePropertyName("runtime_mappings");
JsonSerializer.Serialize(writer, value.RuntimeMappings, options);
}
if (value.ScriptFields is not null)
{
writer.WritePropertyName("script_fields");
JsonSerializer.Serialize(writer, value.ScriptFields, options);
}
if (value.SearchAfter is not null)
{
writer.WritePropertyName("search_after");
JsonSerializer.Serialize(writer, value.SearchAfter, options);
}
if (value.SeqNoPrimaryTerm.HasValue)
{
writer.WritePropertyName("seq_no_primary_term");
writer.WriteBooleanValue(value.SeqNoPrimaryTerm.Value);
}
if (value.Size.HasValue)
{
writer.WritePropertyName("size");
writer.WriteNumberValue(value.Size.Value);
}
if (value.Slice is not null)
{
writer.WritePropertyName("slice");
JsonSerializer.Serialize(writer, value.Slice, options);
}
if (value.Sort is not null)
{
writer.WritePropertyName("sort");
JsonSerializer.Serialize(writer, value.Sort, options);
}
if (value.Source is not null)
{
writer.WritePropertyName("_source");
JsonSerializer.Serialize(writer, value.Source, options);
}
if (value.Stats is not null)
{
writer.WritePropertyName("stats");
JsonSerializer.Serialize(writer, value.Stats, options);
}
if (value.StoredFields is not null)
{
writer.WritePropertyName("stored_fields");
new FieldsConverter().Write(writer, value.StoredFields, options);
}
if (value.Suggest is not null)
{
writer.WritePropertyName("suggest");
JsonSerializer.Serialize(writer, value.Suggest, options);
}
if (value.TerminateAfter.HasValue)
{
writer.WritePropertyName("terminate_after");
writer.WriteNumberValue(value.TerminateAfter.Value);
}
if (!string.IsNullOrEmpty(value.Timeout))
{
writer.WritePropertyName("timeout");
writer.WriteStringValue(value.Timeout);
}
if (value.TrackScores.HasValue)
{
writer.WritePropertyName("track_scores");
writer.WriteBooleanValue(value.TrackScores.Value);
}
if (value.TrackTotalHits is not null)
{
writer.WritePropertyName("track_total_hits");
JsonSerializer.Serialize(writer, value.TrackTotalHits, options);
}
if (value.Version.HasValue)
{
writer.WritePropertyName("version");
writer.WriteBooleanValue(value.Version.Value);
}
writer.WriteEndObject();
}
}
/// <summary>
/// <para>
/// Run an async search.
/// </para>
/// <para>
/// When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field. Partial results become available following the sort criteria that was requested.
/// </para>
/// <para>
/// Warning: Asynchronous search does not support scroll or search requests that include only the suggest section.
/// </para>
/// <para>
/// By default, Elasticsearch does not allow you to store an async search response larger than 10Mb and an attempt to do this results in an error.
/// The maximum allowed size for a stored async search response can be set by changing the <c>search.max_async_search_response_size</c> cluster level setting.
/// </para>
/// </summary>
[JsonConverter(typeof(SubmitAsyncSearchRequestConverter))]
public sealed partial class SubmitAsyncSearchRequest : PlainRequest<SubmitAsyncSearchRequestParameters>
{
public SubmitAsyncSearchRequest()
{
}
public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices))
{
}
internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchSubmit;
protected override HttpMethod StaticHttpMethod => HttpMethod.POST;
internal override bool SupportsBody => true;
internal override string OperationName => "async_search.submit";
/// <summary>
/// <para>
/// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes <c>_all</c> string or when no indices have been specified)
/// </para>
/// </summary>
[JsonIgnore]
public bool? AllowNoIndices { get => Q<bool?>("allow_no_indices"); set => Q("allow_no_indices", value); }
/// <summary>
/// <para>
/// Indicate if an error should be returned if there is a partial search failure or timeout
/// </para>
/// </summary>
[JsonIgnore]
public bool? AllowPartialSearchResults { get => Q<bool?>("allow_partial_search_results"); set => Q("allow_partial_search_results", value); }
/// <summary>
/// <para>
/// The analyzer to use for the query string
/// </para>
/// </summary>
[JsonIgnore]
public string? Analyzer { get => Q<string?>("analyzer"); set => Q("analyzer", value); }
/// <summary>
/// <para>
/// Specify whether wildcard and prefix queries should be analyzed (default: false)
/// </para>
/// </summary>
[JsonIgnore]
public bool? AnalyzeWildcard { get => Q<bool?>("analyze_wildcard"); set => Q("analyze_wildcard", value); }
/// <summary>
/// <para>
/// Affects how often partial results become available, which happens whenever shard results are reduced.
/// A partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).
/// </para>
/// </summary>
[JsonIgnore]
public long? BatchedReduceSize { get => Q<long?>("batched_reduce_size"); set => Q("batched_reduce_size", value); }
/// <summary>
/// <para>
/// The default value is the only supported value.
/// </para>
/// </summary>
[JsonIgnore]
public bool? CcsMinimizeRoundtrips { get => Q<bool?>("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); }
/// <summary>
/// <para>
/// The default operator for query string query (AND or OR)
/// </para>
/// </summary>
[JsonIgnore]
public Elastic.Clients.Elasticsearch.QueryDsl.Operator? DefaultOperator { get => Q<Elastic.Clients.Elasticsearch.QueryDsl.Operator?>("default_operator"); set => Q("default_operator", value); }
/// <summary>
/// <para>
/// The field to use as default where no field prefix is given in the query string
/// </para>
/// </summary>
[JsonIgnore]
public string? Df { get => Q<string?>("df"); set => Q("df", value); }
/// <summary>
/// <para>
/// Whether to expand wildcard expression to concrete indices that are open, closed or both.
/// </para>
/// </summary>
[JsonIgnore]
public ICollection<Elastic.Clients.Elasticsearch.ExpandWildcard>? ExpandWildcards { get => Q<ICollection<Elastic.Clients.Elasticsearch.ExpandWildcard>?>("expand_wildcards"); set => Q("expand_wildcards", value); }
/// <summary>
/// <para>
/// Whether specified concrete, expanded or aliased indices should be ignored when throttled
/// </para>
/// </summary>
[JsonIgnore]
public bool? IgnoreThrottled { get => Q<bool?>("ignore_throttled"); set => Q("ignore_throttled", value); }
/// <summary>
/// <para>
/// Whether specified concrete indices should be ignored when unavailable (missing or closed)
/// </para>
/// </summary>
[JsonIgnore]
public bool? IgnoreUnavailable { get => Q<bool?>("ignore_unavailable"); set => Q("ignore_unavailable", value); }
/// <summary>
/// <para>
/// Specifies how long the async search needs to be available.
/// Ongoing async searches and any saved search results are deleted after this period.
/// </para>
/// </summary>
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Duration? KeepAlive { get => Q<Elastic.Clients.Elasticsearch.Duration?>("keep_alive"); set => Q("keep_alive", value); }
/// <summary>
/// <para>
/// If <c>true</c>, results are stored for later retrieval when the search completes within the <c>wait_for_completion_timeout</c>.
/// </para>
/// </summary>
[JsonIgnore]
public bool? KeepOnCompletion { get => Q<bool?>("keep_on_completion"); set => Q("keep_on_completion", value); }
/// <summary>
/// <para>
/// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
/// </para>
/// </summary>
[JsonIgnore]
public bool? Lenient { get => Q<bool?>("lenient"); set => Q("lenient", value); }
/// <summary>
/// <para>
/// The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
/// </para>
/// </summary>
[JsonIgnore]
public long? MaxConcurrentShardRequests { get => Q<long?>("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", value); }
[JsonIgnore]
public string? MinCompatibleShardNode { get => Q<string?>("min_compatible_shard_node"); set => Q("min_compatible_shard_node", value); }
/// <summary>
/// <para>
/// Specify the node or shard the operation should be performed on (default: random)
/// </para>
/// </summary>
[JsonIgnore]
public string? Preference { get => Q<string?>("preference"); set => Q("preference", value); }
/// <summary>
/// <para>
/// Query in the Lucene query string syntax
/// </para>
/// </summary>
[JsonIgnore]
public string? QueryLuceneSyntax { get => Q<string?>("q"); set => Q("q", value); }
/// <summary>
/// <para>
/// Specify if request cache should be used for this request or not, defaults to true
/// </para>
/// </summary>
[JsonIgnore]
public bool? RequestCache { get => Q<bool?>("request_cache"); set => Q("request_cache", value); }
/// <summary>
/// <para>
/// Indicates whether hits.total should be rendered as an integer or an object in the rest search response
/// </para>
/// </summary>
[JsonIgnore]
public bool? RestTotalHitsAsInt { get => Q<bool?>("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); }
/// <summary>
/// <para>
/// A comma-separated list of specific routing values
/// </para>
/// </summary>
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Routing? Routing { get => Q<Elastic.Clients.Elasticsearch.Routing?>("routing"); set => Q("routing", value); }
/// <summary>
/// <para>
/// Search operation type
/// </para>
/// </summary>
[JsonIgnore]
public Elastic.Clients.Elasticsearch.SearchType? SearchType { get => Q<Elastic.Clients.Elasticsearch.SearchType?>("search_type"); set => Q("search_type", value); }
/// <summary>
/// <para>
/// A list of fields to exclude from the returned _source field
/// </para>
/// </summary>
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Fields? SourceExcludes { get => Q<Elastic.Clients.Elasticsearch.Fields?>("_source_excludes"); set => Q("_source_excludes", value); }
/// <summary>
/// <para>
/// A list of fields to extract and return from the _source field
/// </para>
/// </summary>
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Fields? SourceIncludes { get => Q<Elastic.Clients.Elasticsearch.Fields?>("_source_includes"); set => Q("_source_includes", value); }
/// <summary>
/// <para>
/// Specifies which field to use for suggestions.
/// </para>
/// </summary>
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Field? SuggestField { get => Q<Elastic.Clients.Elasticsearch.Field?>("suggest_field"); set => Q("suggest_field", value); }
/// <summary>
/// <para>
/// Specify suggest mode
/// </para>
/// </summary>
[JsonIgnore]
public Elastic.Clients.Elasticsearch.SuggestMode? SuggestMode { get => Q<Elastic.Clients.Elasticsearch.SuggestMode?>("suggest_mode"); set => Q("suggest_mode", value); }
/// <summary>
/// <para>
/// How many suggestions to return in response
/// </para>
/// </summary>
[JsonIgnore]
public long? SuggestSize { get => Q<long?>("suggest_size"); set => Q("suggest_size", value); }
/// <summary>
/// <para>
/// The source text for which the suggestions should be returned.
/// </para>
/// </summary>
[JsonIgnore]
public string? SuggestText { get => Q<string?>("suggest_text"); set => Q("suggest_text", value); }
/// <summary>
/// <para>
/// Specify whether aggregation and suggester names should be prefixed by their respective types in the response
/// </para>
/// </summary>
[JsonIgnore]
public bool? TypedKeys { get => Q<bool?>("typed_keys"); set => Q("typed_keys", value); }
/// <summary>
/// <para>
/// Blocks and waits until the search is completed up to a certain timeout.
/// When the async search completes within the timeout, the response won’t include the ID as the results are not stored in the cluster.
/// </para>
/// </summary>
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q<Elastic.Clients.Elasticsearch.Duration?>("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
[JsonInclude, JsonPropertyName("aggregations")]
public IDictionary<string, Elastic.Clients.Elasticsearch.Aggregations.Aggregation>? Aggregations { get; set; }
[JsonInclude, JsonPropertyName("collapse")]
public Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? Collapse { get; set; }
/// <summary>
/// <para>
/// Array of wildcard (*) patterns. The request returns doc values for field
/// names matching these patterns in the hits.fields property of the response.
/// </para>
/// </summary>
[JsonInclude, JsonPropertyName("docvalue_fields")]
public ICollection<Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat>? DocvalueFields { get; set; }
/// <summary>
/// <para>
/// If true, returns detailed information about score computation as part of a hit.
/// </para>
/// </summary>
[JsonInclude, JsonPropertyName("explain")]
public bool? Explain { get; set; }
/// <summary>
/// <para>
/// Configuration of search extensions defined by Elasticsearch plugins.
/// </para>
/// </summary>
[JsonInclude, JsonPropertyName("ext")]
public IDictionary<string, object>? Ext { get; set; }
/// <summary>
/// <para>
/// Array of wildcard (*) patterns. The request returns values for field names
/// matching these patterns in the hits.fields property of the response.
/// </para>
/// </summary>
[JsonInclude, JsonPropertyName("fields")]
public ICollection<Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat>? Fields { get; set; }
/// <summary>
/// <para>
/// Starting document offset. By default, you cannot page through more than 10,000
/// hits using the from and size parameters. To page through more hits, use the
/// search_after parameter.
/// </para>
/// </summary>
[JsonInclude, JsonPropertyName("from")]
public int? From { get; set; }
[JsonInclude, JsonPropertyName("highlight")]
public Elastic.Clients.Elasticsearch.Core.Search.Highlight? Highlight { get; set; }
/// <summary>
/// <para>
/// Boosts the _score of documents from specified indices.
/// </para>
/// </summary>
[JsonInclude, JsonPropertyName("indices_boost")]
public ICollection<IDictionary<Elastic.Clients.Elasticsearch.IndexName, double>>? IndicesBoost { get; set; }
/// <summary>
/// <para>
/// Defines the approximate kNN search to run.
/// </para>
/// </summary>
[JsonInclude, JsonPropertyName("knn")]
[SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.KnnSearch))]
public ICollection<Elastic.Clients.Elasticsearch.KnnSearch>? Knn { get; set; }
/// <summary>
/// <para>
/// Minimum _score for matching documents. Documents with a lower _score are
/// not included in the search results.
/// </para>
/// </summary>
[JsonInclude, JsonPropertyName("min_score")]
public double? MinScore { get; set; }
/// <summary>
/// <para>
/// Limits the search to a point in time (PIT). If you provide a PIT, you