Struct meilisearch_sdk::settings::Settings
source · pub struct Settings {Show 16 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<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>,
pub search_cutoff_ms: Option<u64>,
pub separator_tokens: Option<Vec<String>>,
pub non_separator_tokens: 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.
sortable_attributes: Option<Vec<String>>
Attributes to sort.
distinct_attribute: Option<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.
search_cutoff_ms: Option<u64>
SearchCutoffMs settings.
separator_tokens: Option<Vec<String>>
Configure strings as custom separator tokens indicating where a word ends and begins.
non_separator_tokens: Option<Vec<String>>
Remove tokens from Meilisearch’s default list of word separators.
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: Option<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
pub fn with_search_cutoff(self, search_cutoff_ms: u64) -> Settings
pub fn with_separation_tokens( self, separator_tokens: impl IntoIterator<Item = impl AsRef<str>>, ) -> Settings
pub fn with_non_separation_tokens( self, non_separator_tokens: impl IntoIterator<Item = 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>,
Auto Trait Implementations§
impl Freeze for Settings
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more