This commit is contained in:
2023-09-14 21:53:42 +02:00
parent 079f675402
commit dde74e8d27
5 changed files with 56 additions and 50 deletions

View File

@@ -5,7 +5,7 @@ pub trait UpdateModel {
fn get_index() -> String;
fn get_query() -> String;
fn from_row(row: Row) -> Self;
fn get_searchanble_attributes() -> Vec<String>;
fn get_searchable_attributes() -> Vec<String>;
fn get_filterable_attributes() -> Vec<String>;
fn get_ranking_rules() -> Vec<String>;
}
@@ -36,7 +36,7 @@ impl UpdateModel for Book {
}
}
fn get_searchanble_attributes() -> Vec<String> {
fn get_searchable_attributes() -> Vec<String> {
vec!["title".to_string()]
}
@@ -114,7 +114,7 @@ impl UpdateModel for Author {
}
}
fn get_searchanble_attributes() -> Vec<String> {
fn get_searchable_attributes() -> Vec<String> {
vec![
"first_name".to_string(),
"last_name".to_string(),
@@ -179,7 +179,7 @@ impl UpdateModel for Sequence {
}
}
fn get_searchanble_attributes() -> Vec<String> {
fn get_searchable_attributes() -> Vec<String> {
vec!["name".to_string()]
}
@@ -244,7 +244,7 @@ impl UpdateModel for Genre {
}
}
fn get_searchanble_attributes() -> Vec<String> {
fn get_searchable_attributes() -> Vec<String> {
vec!["description".to_string()]
}

View File

@@ -68,7 +68,7 @@ where
};
}
if let Err(err) = index.set_searchable_attributes(T::get_searchanble_attributes()).await {
if let Err(err) = index.set_searchable_attributes(T::get_searchable_attributes()).await {
return Err(Box::new(err));
};