Skip to content

Commit d205454

Browse files
fixed fmt and updated yaml file
1 parent 751f665 commit d205454

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.code-samples.meilisearch.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,3 +1730,12 @@ distinct_attribute_guide_distinct_parameter_1: |-
17301730
.execute()
17311731
.await
17321732
.unwrap();
1733+
search_parameter_reference_ranking_score_threshold_1: |-
1734+
let res = client
1735+
.index("INDEX_NAME")
1736+
.search()
1737+
.with_query("badman")
1738+
.with_ranking_score_threshold(0.2)
1739+
.execute()
1740+
.await
1741+
.unwrap();

src/search.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ pub struct SearchQuery<'a, Http: HttpClient> {
336336
#[serde(skip_serializing_if = "Option::is_none")]
337337
pub matching_strategy: Option<MatchingStrategies>,
338338

339-
340339
///Defines one attribute in the filterableAttributes list as a distinct attribute.
341340
#[serde(skip_serializing_if = "Option::is_none")]
342341
pub distinct: Option<&'a str>,
@@ -346,7 +345,6 @@ pub struct SearchQuery<'a, Http: HttpClient> {
346345

347346
#[serde(skip_serializing_if = "Option::is_none")]
348347
pub(crate) index_uid: Option<&'a str>,
349-
350348
}
351349

352350
#[allow(missing_docs)]
@@ -573,8 +571,11 @@ impl<'a, Http: HttpClient> SearchQuery<'a, Http> {
573571
pub fn with_distinct<'b>(&'b mut self, distinct: &'a str) -> &'b mut SearchQuery<'a, Http> {
574572
self.distinct = Some(distinct);
575573
self
576-
}
577-
pub fn with_ranking_score_threshold<'b>(&'b mut self, ranking_score_threshold: f64) -> &'b mut SearchQuery<'a, Http> {
574+
}
575+
pub fn with_ranking_score_threshold<'b>(
576+
&'b mut self,
577+
ranking_score_threshold: f64,
578+
) -> &'b mut SearchQuery<'a, Http> {
578579
self.ranking_score_threshold = Some(ranking_score_threshold);
579580
self
580581
}

0 commit comments

Comments
 (0)