fix the way we return the settings

This commit is contained in:
tamo 2021-05-11 11:47:04 +02:00
parent 92a7c8cd17
commit 384afb3455
No known key found for this signature in database
GPG Key ID: 20CD8020AFA88D69

View File

@ -41,13 +41,11 @@ impl Index {
let displayed_attributes = self let displayed_attributes = self
.displayed_fields(&txn)? .displayed_fields(&txn)?
.map(|fields| fields.into_iter().map(String::from).collect()) .map(|fields| fields.into_iter().map(String::from).collect());
.unwrap_or_else(|| vec!["*".to_string()]);
let searchable_attributes = self let searchable_attributes = self
.searchable_fields(&txn)? .searchable_fields(&txn)?
.map(|fields| fields.into_iter().map(String::from).collect()) .map(|fields| fields.into_iter().map(String::from).collect());
.unwrap_or_else(|| vec!["*".to_string()]);
let faceted_attributes = self let faceted_attributes = self
.faceted_fields(&txn)? .faceted_fields(&txn)?
@ -71,8 +69,8 @@ impl Index {
let distinct_attribute = self.distinct_attribute(&txn)?.map(String::from); let distinct_attribute = self.distinct_attribute(&txn)?.map(String::from);
Ok(Settings { Ok(Settings {
displayed_attributes: Some(Some(displayed_attributes)), displayed_attributes: Some(displayed_attributes),
searchable_attributes: Some(Some(searchable_attributes)), searchable_attributes: Some(searchable_attributes),
attributes_for_faceting: Some(Some(faceted_attributes)), attributes_for_faceting: Some(Some(faceted_attributes)),
ranking_rules: Some(Some(criteria)), ranking_rules: Some(Some(criteria)),
stop_words: Some(Some(stop_words)), stop_words: Some(Some(stop_words)),