fix attributes to retrieve bug

This commit is contained in:
mpostma
2020-12-10 15:57:19 +01:00
parent 7a27f9b610
commit 2bd5d2474e
2 changed files with 3 additions and 4 deletions

View File

@ -130,12 +130,13 @@ impl SearchQuery {
restricted_attributes = available_attributes.clone();
} else {
restricted_attributes = HashSet::new();
search_builder.attributes_to_retrieve(HashSet::new());
for attr in attributes_to_retrieve {
if available_attributes.contains(attr) {
restricted_attributes.insert(attr);
search_builder.add_retrievable_field(attr.to_string());
} else {
warn!("The attributes {:?} present in attributesToCrop parameter doesn't exist", attr);
warn!("The attributes {:?} present in attributesToRetrieve parameter doesn't exist", attr);
}
}
}