Skip to content

Commit f74e472

Browse files
committed
Added localized_attributes parameter and builder method to Settings
1 parent 710f5f3 commit f74e472

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/settings.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ pub struct Settings {
119119
/// Remove tokens from Meilisearch's default [list of word separators](https://www.meilisearch.com/docs/learn/engine/datatypes#string).
120120
#[serde(skip_serializing_if = "Option::is_none")]
121121
pub non_separator_tokens: Option<Vec<String>>,
122+
/// LocalizedAttributes settings.
123+
#[serde(skip_serializing_if = "Option::is_none")]
124+
pub localized_attributes: Option<Vec<LocalizedAttributes>>,
122125
}
123126

124127
#[allow(missing_docs)]
@@ -343,6 +346,17 @@ impl Settings {
343346
..self
344347
}
345348
}
349+
350+
#[must_use]
351+
pub fn with_localized_attributes(
352+
self,
353+
localized_attributes: impl IntoIterator<Item = LocalizedAttributes>,
354+
) -> Settings {
355+
Settings {
356+
localized_attributes: Some(localized_attributes.into_iter().collect()),
357+
..self
358+
}
359+
}
346360
}
347361

348362
impl<Http: HttpClient> Index<Http> {

0 commit comments

Comments
 (0)