fix for review

This commit is contained in:
qdequele
2020-01-29 18:30:21 +01:00
parent 14b5fc4d6c
commit a5b0e468ee
48 changed files with 558 additions and 1216 deletions

View File

@ -62,7 +62,7 @@ pub async fn search_with_url_query(ctx: Request<Data>) -> SResult<Response> {
let crop_length = query.crop_length.unwrap_or(200);
if attributes_to_crop == "*" {
let attributes_to_crop = schema
.get_displayed_name()
.displayed_name()
.iter()
.map(|attr| (attr.to_string(), crop_length))
.collect();
@ -78,11 +78,15 @@ pub async fn search_with_url_query(ctx: Request<Data>) -> SResult<Response> {
if let Some(attributes_to_highlight) = query.attributes_to_highlight {
let attributes_to_highlight = if attributes_to_highlight == "*" {
schema.get_displayed_name()
schema
.displayed_name()
.iter()
.map(|s| s.to_string())
.collect()
} else {
attributes_to_highlight
.split(',')
.map(ToString::to_string)
.map(|s| s.to_string())
.collect()
};