From a3716c567886905acc15fe79141f6b86472165db Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 31 May 2023 14:57:46 +0200 Subject: [PATCH] add the new parameter to the search builder of milli --- milli/src/search/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/milli/src/search/mod.rs b/milli/src/search/mod.rs index 3c972d9b0..9cdada837 100644 --- a/milli/src/search/mod.rs +++ b/milli/src/search/mod.rs @@ -28,6 +28,7 @@ pub struct Search<'a> { offset: usize, limit: usize, sort_criteria: Option>, + searchable_attributes: Option>, geo_strategy: new::GeoSortStrategy, terms_matching_strategy: TermsMatchingStrategy, scoring_strategy: ScoringStrategy, @@ -45,6 +46,7 @@ impl<'a> Search<'a> { offset: 0, limit: 20, sort_criteria: None, + searchable_attributes: None, geo_strategy: new::GeoSortStrategy::default(), terms_matching_strategy: TermsMatchingStrategy::default(), scoring_strategy: Default::default(), @@ -75,6 +77,11 @@ impl<'a> Search<'a> { self } + pub fn searchable_attributes(&mut self, searchable: Vec) -> &mut Search<'a> { + self.searchable_attributes = Some(searchable); + self + } + pub fn terms_matching_strategy(&mut self, value: TermsMatchingStrategy) -> &mut Search<'a> { self.terms_matching_strategy = value; self @@ -145,6 +152,7 @@ impl fmt::Debug for Search<'_> { offset, limit, sort_criteria, + searchable_attributes, geo_strategy: _, terms_matching_strategy, scoring_strategy, @@ -159,6 +167,7 @@ impl fmt::Debug for Search<'_> { .field("offset", offset) .field("limit", limit) .field("sort_criteria", sort_criteria) + .field("searchable_attributes", searchable_attributes) .field("terms_matching_strategy", terms_matching_strategy) .field("scoring_strategy", scoring_strategy) .field("exhaustive_number_hits", exhaustive_number_hits)