@@ -291,6 +291,12 @@ public override SearchRequest Read(ref Utf8JsonReader reader, Type typeToConvert
291291 continue ;
292292 }
293293
294+ if ( property == "retriever" )
295+ {
296+ variant . Retriever = JsonSerializer . Deserialize < Elastic . Clients . Elasticsearch . Serverless . Retriever ? > ( ref reader , options ) ;
297+ continue ;
298+ }
299+
294300 if ( property == "runtime_mappings" )
295301 {
296302 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
497503 JsonSerializer . Serialize ( writer , value . Rescore , options ) ;
498504 }
499505
506+ if ( value . Retriever is not null )
507+ {
508+ writer . WritePropertyName ( "retriever" ) ;
509+ JsonSerializer . Serialize ( writer , value . Retriever , options ) ;
510+ }
511+
500512 if ( value . RuntimeMappings is not null )
501513 {
502514 writer . WritePropertyName ( "runtime_mappings" ) ;
@@ -897,6 +909,12 @@ public SearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices)
897909 [ SingleOrManyCollectionConverter ( typeof ( Elastic . Clients . Elasticsearch . Serverless . Core . Search . Rescore ) ) ]
898910 public ICollection < Elastic . Clients . Elasticsearch . Serverless . Core . Search . Rescore > ? Rescore { get ; set ; }
899911
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+
900918 /// <summary>
901919 /// <para>Defines one or more runtime fields in the search request.<br/>These fields take precedence over mapped fields with the same name.</para>
902920 /// </summary>
@@ -1096,6 +1114,9 @@ public SearchRequestDescriptor<TDocument> Indices(Elastic.Clients.Elasticsearch.
10961114 private Elastic . Clients . Elasticsearch . Serverless . Core . Search . RescoreDescriptor < TDocument > RescoreDescriptor { get ; set ; }
10971115 private Action < Elastic . Clients . Elasticsearch . Serverless . Core . Search . RescoreDescriptor < TDocument > > RescoreDescriptorAction { get ; set ; }
10981116 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 ; }
10991120 private IDictionary < Elastic . Clients . Elasticsearch . Serverless . Field , Elastic . Clients . Elasticsearch . Serverless . Mapping . RuntimeFieldDescriptor < TDocument > > RuntimeMappingsValue { get ; set ; }
11001121 private IDictionary < string , Elastic . Clients . Elasticsearch . Serverless . ScriptFieldDescriptor > ScriptFieldsValue { get ; set ; }
11011122 private ICollection < Elastic . Clients . Elasticsearch . Serverless . FieldValue > ? SearchAfterValue { get ; set ; }
@@ -1501,6 +1522,33 @@ public SearchRequestDescriptor<TDocument> Rescore(params Action<Elastic.Clients.
15011522 return Self ;
15021523 }
15031524
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+
15041552 /// <summary>
15051553 /// <para>Defines one or more runtime fields in the search request.<br/>These fields take precedence over mapped fields with the same name.</para>
15061554 /// </summary>
@@ -1972,6 +2020,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
19722020 SingleOrManySerializationHelper . Serialize < Elastic . Clients . Elasticsearch . Serverless . Core . Search . Rescore > ( RescoreValue , writer , options ) ;
19732021 }
19742022
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+
19752039 if ( RuntimeMappingsValue is not null )
19762040 {
19772041 writer . WritePropertyName ( "runtime_mappings" ) ;
@@ -2215,6 +2279,9 @@ public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.
22152279 private Elastic . Clients . Elasticsearch . Serverless . Core . Search . RescoreDescriptor RescoreDescriptor { get ; set ; }
22162280 private Action < Elastic . Clients . Elasticsearch . Serverless . Core . Search . RescoreDescriptor > RescoreDescriptorAction { get ; set ; }
22172281 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 ; }
22182285 private IDictionary < Elastic . Clients . Elasticsearch . Serverless . Field , Elastic . Clients . Elasticsearch . Serverless . Mapping . RuntimeFieldDescriptor > RuntimeMappingsValue { get ; set ; }
22192286 private IDictionary < string , Elastic . Clients . Elasticsearch . Serverless . ScriptFieldDescriptor > ScriptFieldsValue { get ; set ; }
22202287 private ICollection < Elastic . Clients . Elasticsearch . Serverless . FieldValue > ? SearchAfterValue { get ; set ; }
@@ -2620,6 +2687,33 @@ public SearchRequestDescriptor Rescore(params Action<Elastic.Clients.Elasticsear
26202687 return Self ;
26212688 }
26222689
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+
26232717 /// <summary>
26242718 /// <para>Defines one or more runtime fields in the search request.<br/>These fields take precedence over mapped fields with the same name.</para>
26252719 /// </summary>
@@ -3091,6 +3185,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
30913185 SingleOrManySerializationHelper . Serialize < Elastic . Clients . Elasticsearch . Serverless . Core . Search . Rescore > ( RescoreValue , writer , options ) ;
30923186 }
30933187
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+
30943204 if ( RuntimeMappingsValue is not null )
30953205 {
30963206 writer . WritePropertyName ( "runtime_mappings" ) ;
0 commit comments