mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
Searching for a document that does not exist no longer raises an error
This commit is contained in:
parent
7df5e3f059
commit
60ff1b19a8
3 changed files with 17 additions and 10 deletions
|
@ -1513,11 +1513,9 @@ fn retrieve_documents<S: AsRef<str>>(
|
|||
let mut candidates = if let Some(ids) = ids {
|
||||
let external_document_ids = index.external_documents_ids();
|
||||
let mut candidates = RoaringBitmap::new();
|
||||
for (index, id) in ids.iter().enumerate() {
|
||||
for id in ids.iter() {
|
||||
let Some(docid) = external_document_ids.get(&rtxn, id)? else {
|
||||
let error = MeilisearchHttpError::DocumentNotFound(id.clone().into_inner());
|
||||
let msg = format!("In `.ids[{index}]`: {error}");
|
||||
return Err(ResponseError::from_msg(msg, Code::NotFoundDocumentId));
|
||||
continue;
|
||||
};
|
||||
candidates.insert(docid);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue