update tests

This commit is contained in:
qdequele 2020-02-13 10:25:37 +01:00
parent 4986adc186
commit ce8e12c7c5
No known key found for this signature in database
GPG key ID: B3F0A000EBF11745
6 changed files with 68 additions and 32 deletions

View file

@ -93,11 +93,7 @@ impl DataInner {
let frequency: HashMap<_, _> = fields_frequency
.into_iter()
.filter_map(|(a, c)| {
if let Some(name) = schema.name(a) {
return Some((name.to_string(), c));
} else {
return None;
}
schema.name(a).map(|name| (name.to_string(), c))
})
.collect();

View file

@ -302,7 +302,7 @@ impl<'a> SearchBuilder<'a> {
Err(err) => error!("Error during criteria builder; {:?}", err),
}
}
};
}
}
builder.push(DocumentId);
return Ok(Some(builder.build()));
@ -416,7 +416,7 @@ fn calculate_matches(
if !attributes_to_retrieve.contains(attribute) {
continue;
}
};
}
if !schema.displayed_name().contains(attribute) {
continue;
}

View file

@ -25,7 +25,7 @@ pub fn main() -> Result<(), MainError> {
let data = Data::new(opt.clone());
if env::var("MEILI_NO_ANALYTICS") == Err(NotPresent) {
thread::spawn(|| analytics::analytics_sender());
thread::spawn(analytics::analytics_sender);
}
let data_cloned = data.clone();

View file

@ -82,8 +82,8 @@ pub async fn get_all(ctx: Request<Data>) -> SResult<Response> {
let settings = Settings {
ranking_rules: Some(ranking_rules),
ranking_distinct: Some(ranking_distinct),
searchable_attributes: searchable_attributes,
displayed_attributes: displayed_attributes,
searchable_attributes,
displayed_attributes,
stop_words: Some(stop_words),
synonyms: Some(synonyms),
index_new_fields: Some(index_new_fields),