Struct meilisearch_sdk::settings::Settings [−][src]
pub struct Settings {
pub synonyms: Option<HashMap<String, Vec<String>>>,
pub stop_words: Option<Vec<String>>,
pub ranking_rules: Option<Vec<String>>,
pub attributes_for_faceting: Option<Vec<String>>,
pub distinct_attribute: Option<String>,
pub searchable_attributes: Option<Vec<String>>,
pub displayed_attributes: Option<Vec<String>>,
}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
attributes_for_faceting: Option<Vec<String>>Attributes to use as facets
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
Implementations
impl Settings[src]
impl Settings[src]pub fn new() -> Settings[src]
Create undefined settings
pub fn with_synonyms<T: Into<String>, U: IntoVecString>(
self,
synonyms: HashMap<T, U>
) -> Settings[src]
self,
synonyms: HashMap<T, U>
) -> Settings
pub fn with_stop_words(self, stop_words: impl IntoVecString) -> Settings[src]
pub fn with_ranking_rules<T: IntoVecString>(self, ranking_rules: T) -> Settings[src]
pub fn with_attributes_for_faceting<T: IntoVecString>(
self,
attributes_for_faceting: T
) -> Settings[src]
self,
attributes_for_faceting: T
) -> Settings
pub fn with_distinct_attribute<T: Into<String>>(
self,
distinct_attribute: T
) -> Settings[src]
self,
distinct_attribute: T
) -> Settings
pub fn with_searchable_attributes<T: IntoVecString>(
self,
searchable_attributes: T
) -> Settings[src]
self,
searchable_attributes: T
) -> Settings
pub fn with_displayed_attributes<T: IntoVecString>(
self,
displayed_attributes: T
) -> Settings[src]
self,
displayed_attributes: T
) -> Settings
Trait Implementations
impl<'de> Deserialize<'de> for Settings[src]
impl<'de> Deserialize<'de> for Settings[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for Settings
impl RefUnwindSafe for Settingsimpl UnwindSafe for Settings
impl UnwindSafe for SettingsBlanket Implementations
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]impl<T> Instrument for T[src]
impl<T> Instrument for T[src]pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> WithSubscriber for T[src]
impl<T> WithSubscriber for T[src]pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>, [src]
S: Into<Dispatch>,