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>>,
}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
Implementations
sourceimpl Settings
impl Settings
pub fn with_synonyms<S, U, V>(self, synonyms: HashMap<S, U>) -> Settings where
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_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
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
sourcefn 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more