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

source

pub fn new() -> Settings

Create undefined settings.

source

pub fn with_synonyms<S, U, V>(self, synonyms: HashMap<S, U>) -> Settings
where S: AsRef<str>, V: AsRef<str>, U: IntoIterator<Item = V>,

source

pub fn with_stop_words( self, stop_words: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings

source

pub fn with_pagination(self, pagination_settings: PaginationSetting) -> Settings

source

pub fn with_typo_tolerance( self, typo_tolerance_settings: TypoToleranceSettings ) -> Settings

source

pub fn with_ranking_rules( self, ranking_rules: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings

source

pub fn with_filterable_attributes( self, filterable_attributes: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings

source

pub fn with_sortable_attributes( self, sortable_attributes: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings

source

pub fn with_distinct_attribute( self, distinct_attribute: impl AsRef<str> ) -> Settings

source

pub fn with_searchable_attributes( self, searchable_attributes: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings

source

pub fn with_displayed_attributes( self, displayed_attributes: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings

source

pub fn with_faceting(self, faceting: &FacetingSettings) -> Settings

source

pub fn with_dictionary( self, dictionary: impl IntoIterator<Item = impl AsRef<str>> ) -> Settings

source

pub fn with_proximity_precision( self, proximity_precision: impl AsRef<str> ) -> Settings

Trait Implementations§

source§

impl Clone for Settings

source§

fn clone(&self) -> Settings

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Settings

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Settings

source§

fn default() -> Settings

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Settings

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Settings

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,