@@ -364,6 +364,16 @@ pub struct SearchQuery<'a, Http: HttpClient> {
364
364
365
365
#[ serde( skip_serializing_if = "Option::is_none" ) ]
366
366
pub ( crate ) index_uid : Option < & ' a str > ,
367
+
368
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
369
+ pub ( crate ) federation_options : Option < QueryFederationOptions > ,
370
+ }
371
+
372
+ #[ derive( Debug , Serialize , Clone ) ]
373
+ #[ serde( rename_all = "camelCase" ) ]
374
+ pub struct QueryFederationOptions {
375
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
376
+ pub weight : Option < f32 > ,
367
377
}
368
378
369
379
#[ allow( missing_docs) ]
@@ -396,6 +406,7 @@ impl<'a, Http: HttpClient> SearchQuery<'a, Http> {
396
406
distinct : None ,
397
407
ranking_score_threshold : None ,
398
408
locales : None ,
409
+ federation_options : None ,
399
410
}
400
411
}
401
412
pub fn with_query < ' b > ( & ' b mut self , query : & ' a str ) -> & ' b mut SearchQuery < ' a , Http > {
@@ -603,6 +614,14 @@ impl<'a, Http: HttpClient> SearchQuery<'a, Http> {
603
614
self . locales = Some ( locales) ;
604
615
self
605
616
}
617
+ /// Only usable in federated multi search queries.
618
+ pub fn with_federation_options < ' b > (
619
+ & ' b mut self ,
620
+ federation_options : QueryFederationOptions ,
621
+ ) -> & ' b mut SearchQuery < ' a , Http > {
622
+ self . federation_options = Some ( federation_options) ;
623
+ self
624
+ }
606
625
pub fn build ( & mut self ) -> SearchQuery < ' a , Http > {
607
626
self . clone ( )
608
627
}
0 commit comments