Struct meilisearch_sdk::settings::Settings
source · pub struct Settings {Show 13 fields
pub synonyms: Option<HashMap<String, Vec<String>>>,
pub stop_words: Option<Vec<String>>,
pub ranking_rules: Option<Vec<String>>,
pub filterable_attributes: Option<Vec<String>>,
pub sortable_attributes: Option<Vec<String>>,
pub distinct_attribute: Option<String>,
pub searchable_attributes: Option<Vec<String>>,
pub displayed_attributes: Option<Vec<String>>,
pub pagination: Option<PaginationSetting>,
pub faceting: Option<FacetingSettings>,
pub typo_tolerance: Option<TypoToleranceSettings>,
pub dictionary: Option<Vec<String>>,
pub proximity_precision: Option<String>,
}
Expand description
Struct reprensenting a set of settings.
You can build this struct using the builder syntax.
§Example
let settings = Settings::new()
.with_stop_words(["a", "the", "of"]);
// OR
let stop_words: Vec<String> = vec!["a".to_string(), "the".to_string(), "of".to_string()];
let mut settings = Settings::new();
settings.stop_words = Some(stop_words);
// OR
let stop_words: Vec<String> = vec!["a".to_string(), "the".to_string(), "of".to_string()];
let settings = Settings {
stop_words: Some(stop_words),
..Settings::new()
};
Fields§
§synonyms: Option<HashMap<String, Vec<String>>>
List of associated words treated similarly.
stop_words: Option<Vec<String>>
List of words ignored by Meilisearch when present in search queries.
ranking_rules: Option<Vec<String>>
List of ranking rules sorted by order of importance.
filterable_attributes: Option<Vec<String>>
Attributes to use for filtering.
sortable_attributes: Option<Vec<String>>
Attributes to sort.
distinct_attribute: Option<String>
Search returns documents with distinct (different) values of the given field.
searchable_attributes: Option<Vec<String>>
Fields in which to search for matching query words sorted by order of importance.
displayed_attributes: Option<Vec<String>>
Fields displayed in the returned documents.
pagination: Option<PaginationSetting>
Pagination settings.
faceting: Option<FacetingSettings>
Faceting settings.
typo_tolerance: Option<TypoToleranceSettings>
TypoTolerance settings
dictionary: Option<Vec<String>>
Dictionary settings.
proximity_precision: Option<String>
Proximity precision settings.
Implementations§
source§impl Settings
impl Settings
pub fn with_synonyms<S, U, V>(self, synonyms: HashMap<S, U>) -> Settings
pub fn with_stop_words( self, stop_words: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings
pub fn with_pagination(self, pagination_settings: PaginationSetting) -> Settings
pub fn with_typo_tolerance( self, typo_tolerance_settings: TypoToleranceSettings ) -> Settings
pub fn with_ranking_rules( self, ranking_rules: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings
pub fn with_filterable_attributes( self, filterable_attributes: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings
pub fn with_sortable_attributes( self, sortable_attributes: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings
pub fn with_distinct_attribute( self, distinct_attribute: impl AsRef<str> ) -> Settings
pub fn with_searchable_attributes( self, searchable_attributes: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings
pub fn with_displayed_attributes( self, displayed_attributes: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings
pub fn with_faceting(self, faceting: &FacetingSettings) -> Settings
pub fn with_dictionary( self, dictionary: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings
pub fn with_proximity_precision( self, proximity_precision: impl AsRef<str> ) -> Settings
Trait Implementations§
source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more