mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
Handle star in attributes_to_retrieve
This commit is contained in:
parent
7ce74f95a2
commit
8eceba98d3
2 changed files with 63 additions and 3 deletions
|
@ -108,9 +108,18 @@ async fn get_all_documents(
|
|||
params: web::Query<BrowseQuery>,
|
||||
) -> Result<HttpResponse, ResponseError> {
|
||||
let attributes_to_retrieve = params
|
||||
.attributes_to_retrieve
|
||||
.as_ref()
|
||||
.map(|attrs| attrs.split(',').map(String::from).collect::<Vec<_>>());
|
||||
.attributes_to_retrieve
|
||||
.as_ref()
|
||||
.and_then(|attrs| {
|
||||
let mut names = Vec::new();
|
||||
for name in attrs.split(',').map(String::from) {
|
||||
if name == "*" {
|
||||
return None
|
||||
}
|
||||
names.push(name);
|
||||
}
|
||||
Some(names)
|
||||
});
|
||||
|
||||
match data
|
||||
.retrieve_documents(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue