@@ -353,6 +353,16 @@ pub struct SearchQuery<'a, Http: HttpClient> {
353
353
354
354
#[ serde( skip_serializing_if = "Option::is_none" ) ]
355
355
pub ( crate ) index_uid : Option < & ' a str > ,
356
+
357
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
358
+ pub ( crate ) federation_options : Option < QueryFederationOptions > ,
359
+ }
360
+
361
+ #[ derive( Debug , Serialize , Clone ) ]
362
+ #[ serde( rename_all = "camelCase" ) ]
363
+ pub struct QueryFederationOptions {
364
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
365
+ pub weight : Option < f32 > ,
356
366
}
357
367
358
368
#[ allow( missing_docs) ]
@@ -385,6 +395,7 @@ impl<'a, Http: HttpClient> SearchQuery<'a, Http> {
385
395
distinct : None ,
386
396
ranking_score_threshold : None ,
387
397
locales : None ,
398
+ federation_options : None ,
388
399
}
389
400
}
390
401
pub fn with_query < ' b > ( & ' b mut self , query : & ' a str ) -> & ' b mut SearchQuery < ' a , Http > {
@@ -592,6 +603,14 @@ impl<'a, Http: HttpClient> SearchQuery<'a, Http> {
592
603
self . locales = Some ( locales) ;
593
604
self
594
605
}
606
+ /// Only usable in federated multi search queries.
607
+ pub fn with_federation_options < ' b > (
608
+ & ' b mut self ,
609
+ federation_options : QueryFederationOptions ,
610
+ ) -> & ' b mut SearchQuery < ' a , Http > {
611
+ self . federation_options = Some ( federation_options) ;
612
+ self
613
+ }
595
614
pub fn build ( & mut self ) -> SearchQuery < ' a , Http > {
596
615
self . clone ( )
597
616
}
0 commit comments