mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
fix test after rebase
This commit is contained in:
parent
36c7fd0cf1
commit
99866ba484
5 changed files with 92 additions and 44 deletions
|
@ -172,15 +172,9 @@ impl<'a> SearchBuilder<'a> {
|
|||
|
||||
let mut hits = Vec::with_capacity(self.limit);
|
||||
for doc in docs {
|
||||
// retrieve the content of document in kv store
|
||||
let attributes: Option<HashSet<&str>> = self
|
||||
.attributes_to_retrieve
|
||||
.as_ref()
|
||||
.map(|a| a.iter().map(|a| a.as_str()).collect());
|
||||
|
||||
let mut document: IndexMap<String, Value> = self
|
||||
.index
|
||||
.document(reader, attributes.as_ref(), doc.id)
|
||||
.document(reader, Some(&all_attributes), doc.id)
|
||||
.map_err(|e| ResponseError::retrieve_document(doc.id.0, e))?
|
||||
.ok_or(ResponseError::internal(
|
||||
"Impossible to retrieve the document; Corrupted data",
|
||||
|
|
|
@ -41,11 +41,12 @@ async fn get_document(
|
|||
.db
|
||||
.open_index(&path.index_uid)
|
||||
.ok_or(ResponseError::index_not_found(&path.index_uid))?;
|
||||
|
||||
let document_id = meilisearch_core::serde::compute_document_id(&path.document_id);
|
||||
|
||||
let reader = data.db.main_read_txn()?;
|
||||
|
||||
let response = index
|
||||
let response: Document = index
|
||||
.document(&reader, None, document_id)?
|
||||
.ok_or(ResponseError::document_not_found(&path.document_id))?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue