Struct meilisearch_sdk::settings::Settings
source · pub struct Settings {
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>,
}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 and faceted search
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
Implementations§
source§impl Settings
impl Settings
pub fn with_synonyms<S, U, V>(self, synonyms: HashMap<S, U>) -> Settingswhere
S: AsRef<str>,
V: AsRef<str>,
U: IntoIterator<Item = V>,
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_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
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