@@ -291,6 +291,12 @@ public override SearchRequest Read(ref Utf8JsonReader reader, Type typeToConvert
291
291
continue ;
292
292
}
293
293
294
+ if ( property == "retriever" )
295
+ {
296
+ variant . Retriever = JsonSerializer . Deserialize < Elastic . Clients . Elasticsearch . Serverless . Retriever ? > ( ref reader , options ) ;
297
+ continue ;
298
+ }
299
+
294
300
if ( property == "runtime_mappings" )
295
301
{
296
302
variant . RuntimeMappings = JsonSerializer . Deserialize < IDictionary < Elastic . Clients . Elasticsearch . Serverless . Field , Elastic . Clients . Elasticsearch . Serverless . Mapping . RuntimeField > ? > ( ref reader , options ) ;
@@ -497,6 +503,12 @@ public override void Write(Utf8JsonWriter writer, SearchRequest value, JsonSeria
497
503
JsonSerializer . Serialize ( writer , value . Rescore , options ) ;
498
504
}
499
505
506
+ if ( value . Retriever is not null )
507
+ {
508
+ writer . WritePropertyName ( "retriever" ) ;
509
+ JsonSerializer . Serialize ( writer , value . Retriever , options ) ;
510
+ }
511
+
500
512
if ( value . RuntimeMappings is not null )
501
513
{
502
514
writer . WritePropertyName ( "runtime_mappings" ) ;
@@ -897,6 +909,12 @@ public SearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices)
897
909
[ SingleOrManyCollectionConverter ( typeof ( Elastic . Clients . Elasticsearch . Serverless . Core . Search . Rescore ) ) ]
898
910
public ICollection < Elastic . Clients . Elasticsearch . Serverless . Core . Search . Rescore > ? Rescore { get ; set ; }
899
911
912
+ /// <summary>
913
+ /// <para>A retriever is a specification to describe top documents returned from a search. A retriever replaces other elements of the search API that also return top documents such as query and knn.</para>
914
+ /// </summary>
915
+ [ JsonInclude , JsonPropertyName ( "retriever" ) ]
916
+ public Elastic . Clients . Elasticsearch . Serverless . Retriever ? Retriever { get ; set ; }
917
+
900
918
/// <summary>
901
919
/// <para>Defines one or more runtime fields in the search request.<br/>These fields take precedence over mapped fields with the same name.</para>
902
920
/// </summary>
@@ -1096,6 +1114,9 @@ public SearchRequestDescriptor<TDocument> Indices(Elastic.Clients.Elasticsearch.
1096
1114
private Elastic . Clients . Elasticsearch . Serverless . Core . Search . RescoreDescriptor < TDocument > RescoreDescriptor { get ; set ; }
1097
1115
private Action < Elastic . Clients . Elasticsearch . Serverless . Core . Search . RescoreDescriptor < TDocument > > RescoreDescriptorAction { get ; set ; }
1098
1116
private Action < Elastic . Clients . Elasticsearch . Serverless . Core . Search . RescoreDescriptor < TDocument > > [ ] RescoreDescriptorActions { get ; set ; }
1117
+ private Elastic . Clients . Elasticsearch . Serverless . Retriever ? RetrieverValue { get ; set ; }
1118
+ private Elastic . Clients . Elasticsearch . Serverless . RetrieverDescriptor < TDocument > RetrieverDescriptor { get ; set ; }
1119
+ private Action < Elastic . Clients . Elasticsearch . Serverless . RetrieverDescriptor < TDocument > > RetrieverDescriptorAction { get ; set ; }
1099
1120
private IDictionary < Elastic . Clients . Elasticsearch . Serverless . Field , Elastic . Clients . Elasticsearch . Serverless . Mapping . RuntimeFieldDescriptor < TDocument > > RuntimeMappingsValue { get ; set ; }
1100
1121
private IDictionary < string , Elastic . Clients . Elasticsearch . Serverless . ScriptFieldDescriptor > ScriptFieldsValue { get ; set ; }
1101
1122
private ICollection < Elastic . Clients . Elasticsearch . Serverless . FieldValue > ? SearchAfterValue { get ; set ; }
@@ -1501,6 +1522,33 @@ public SearchRequestDescriptor<TDocument> Rescore(params Action<Elastic.Clients.
1501
1522
return Self ;
1502
1523
}
1503
1524
1525
+ /// <summary>
1526
+ /// <para>A retriever is a specification to describe top documents returned from a search. A retriever replaces other elements of the search API that also return top documents such as query and knn.</para>
1527
+ /// </summary>
1528
+ public SearchRequestDescriptor < TDocument > Retriever ( Elastic . Clients . Elasticsearch . Serverless . Retriever ? retriever )
1529
+ {
1530
+ RetrieverDescriptor = null ;
1531
+ RetrieverDescriptorAction = null ;
1532
+ RetrieverValue = retriever ;
1533
+ return Self ;
1534
+ }
1535
+
1536
+ public SearchRequestDescriptor < TDocument > Retriever ( Elastic . Clients . Elasticsearch . Serverless . RetrieverDescriptor < TDocument > descriptor )
1537
+ {
1538
+ RetrieverValue = null ;
1539
+ RetrieverDescriptorAction = null ;
1540
+ RetrieverDescriptor = descriptor ;
1541
+ return Self ;
1542
+ }
1543
+
1544
+ public SearchRequestDescriptor < TDocument > Retriever ( Action < Elastic . Clients . Elasticsearch . Serverless . RetrieverDescriptor < TDocument > > configure )
1545
+ {
1546
+ RetrieverValue = null ;
1547
+ RetrieverDescriptor = null ;
1548
+ RetrieverDescriptorAction = configure ;
1549
+ return Self ;
1550
+ }
1551
+
1504
1552
/// <summary>
1505
1553
/// <para>Defines one or more runtime fields in the search request.<br/>These fields take precedence over mapped fields with the same name.</para>
1506
1554
/// </summary>
@@ -1972,6 +2020,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
1972
2020
SingleOrManySerializationHelper . Serialize < Elastic . Clients . Elasticsearch . Serverless . Core . Search . Rescore > ( RescoreValue , writer , options ) ;
1973
2021
}
1974
2022
2023
+ if ( RetrieverDescriptor is not null )
2024
+ {
2025
+ writer . WritePropertyName ( "retriever" ) ;
2026
+ JsonSerializer . Serialize ( writer , RetrieverDescriptor , options ) ;
2027
+ }
2028
+ else if ( RetrieverDescriptorAction is not null )
2029
+ {
2030
+ writer . WritePropertyName ( "retriever" ) ;
2031
+ JsonSerializer . Serialize ( writer , new Elastic . Clients . Elasticsearch . Serverless . RetrieverDescriptor < TDocument > ( RetrieverDescriptorAction ) , options ) ;
2032
+ }
2033
+ else if ( RetrieverValue is not null )
2034
+ {
2035
+ writer . WritePropertyName ( "retriever" ) ;
2036
+ JsonSerializer . Serialize ( writer , RetrieverValue , options ) ;
2037
+ }
2038
+
1975
2039
if ( RuntimeMappingsValue is not null )
1976
2040
{
1977
2041
writer . WritePropertyName ( "runtime_mappings" ) ;
@@ -2215,6 +2279,9 @@ public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.
2215
2279
private Elastic . Clients . Elasticsearch . Serverless . Core . Search . RescoreDescriptor RescoreDescriptor { get ; set ; }
2216
2280
private Action < Elastic . Clients . Elasticsearch . Serverless . Core . Search . RescoreDescriptor > RescoreDescriptorAction { get ; set ; }
2217
2281
private Action < Elastic . Clients . Elasticsearch . Serverless . Core . Search . RescoreDescriptor > [ ] RescoreDescriptorActions { get ; set ; }
2282
+ private Elastic . Clients . Elasticsearch . Serverless . Retriever ? RetrieverValue { get ; set ; }
2283
+ private Elastic . Clients . Elasticsearch . Serverless . RetrieverDescriptor RetrieverDescriptor { get ; set ; }
2284
+ private Action < Elastic . Clients . Elasticsearch . Serverless . RetrieverDescriptor > RetrieverDescriptorAction { get ; set ; }
2218
2285
private IDictionary < Elastic . Clients . Elasticsearch . Serverless . Field , Elastic . Clients . Elasticsearch . Serverless . Mapping . RuntimeFieldDescriptor > RuntimeMappingsValue { get ; set ; }
2219
2286
private IDictionary < string , Elastic . Clients . Elasticsearch . Serverless . ScriptFieldDescriptor > ScriptFieldsValue { get ; set ; }
2220
2287
private ICollection < Elastic . Clients . Elasticsearch . Serverless . FieldValue > ? SearchAfterValue { get ; set ; }
@@ -2620,6 +2687,33 @@ public SearchRequestDescriptor Rescore(params Action<Elastic.Clients.Elasticsear
2620
2687
return Self ;
2621
2688
}
2622
2689
2690
+ /// <summary>
2691
+ /// <para>A retriever is a specification to describe top documents returned from a search. A retriever replaces other elements of the search API that also return top documents such as query and knn.</para>
2692
+ /// </summary>
2693
+ public SearchRequestDescriptor Retriever ( Elastic . Clients . Elasticsearch . Serverless . Retriever ? retriever )
2694
+ {
2695
+ RetrieverDescriptor = null ;
2696
+ RetrieverDescriptorAction = null ;
2697
+ RetrieverValue = retriever ;
2698
+ return Self ;
2699
+ }
2700
+
2701
+ public SearchRequestDescriptor Retriever ( Elastic . Clients . Elasticsearch . Serverless . RetrieverDescriptor descriptor )
2702
+ {
2703
+ RetrieverValue = null ;
2704
+ RetrieverDescriptorAction = null ;
2705
+ RetrieverDescriptor = descriptor ;
2706
+ return Self ;
2707
+ }
2708
+
2709
+ public SearchRequestDescriptor Retriever ( Action < Elastic . Clients . Elasticsearch . Serverless . RetrieverDescriptor > configure )
2710
+ {
2711
+ RetrieverValue = null ;
2712
+ RetrieverDescriptor = null ;
2713
+ RetrieverDescriptorAction = configure ;
2714
+ return Self ;
2715
+ }
2716
+
2623
2717
/// <summary>
2624
2718
/// <para>Defines one or more runtime fields in the search request.<br/>These fields take precedence over mapped fields with the same name.</para>
2625
2719
/// </summary>
@@ -3091,6 +3185,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
3091
3185
SingleOrManySerializationHelper . Serialize < Elastic . Clients . Elasticsearch . Serverless . Core . Search . Rescore > ( RescoreValue , writer , options ) ;
3092
3186
}
3093
3187
3188
+ if ( RetrieverDescriptor is not null )
3189
+ {
3190
+ writer . WritePropertyName ( "retriever" ) ;
3191
+ JsonSerializer . Serialize ( writer , RetrieverDescriptor , options ) ;
3192
+ }
3193
+ else if ( RetrieverDescriptorAction is not null )
3194
+ {
3195
+ writer . WritePropertyName ( "retriever" ) ;
3196
+ JsonSerializer . Serialize ( writer , new Elastic . Clients . Elasticsearch . Serverless . RetrieverDescriptor ( RetrieverDescriptorAction ) , options ) ;
3197
+ }
3198
+ else if ( RetrieverValue is not null )
3199
+ {
3200
+ writer . WritePropertyName ( "retriever" ) ;
3201
+ JsonSerializer . Serialize ( writer , RetrieverValue , options ) ;
3202
+ }
3203
+
3094
3204
if ( RuntimeMappingsValue is not null )
3095
3205
{
3096
3206
writer . WritePropertyName ( "runtime_mappings" ) ;
0 commit comments