get rids of meilisearch-lib

This commit is contained in:
Tamo
2022-09-27 16:33:37 +02:00
committed by Clément Renault
parent 0ba1c46e19
commit 2c8f1a43e9
38 changed files with 398 additions and 1620 deletions

View File

@ -268,7 +268,7 @@ impl Index {
pub fn retrieve_document<S: AsRef<str>>(
&self,
doc_id: String,
doc_id: &str,
attributes_to_retrieve: Option<Vec<S>>,
) -> Result<Document> {
let txn = self.read_txn()?;
@ -279,14 +279,14 @@ impl Index {
let internal_id = self
.external_documents_ids(&txn)?
.get(doc_id.as_bytes())
.ok_or_else(|| IndexError::DocumentNotFound(doc_id.clone()))?;
.ok_or_else(|| IndexError::DocumentNotFound(doc_id.to_string()))?;
let document = self
.documents(&txn, std::iter::once(internal_id))?
.into_iter()
.next()
.map(|(_, d)| d)
.ok_or(IndexError::DocumentNotFound(doc_id))?;
.ok_or_else(|| IndexError::DocumentNotFound(doc_id.to_string()))?;
let document = obkv_to_json(&all_fields, &fields_ids_map, document)?;
let document = match &attributes_to_retrieve {

View File

@ -107,7 +107,7 @@ pub mod test {
pub fn retrieve_document<S: AsRef<str>>(
&self,
doc_id: String,
doc_id: &str,
attributes_to_retrieve: Option<Vec<S>>,
) -> Result<Document> {
match self {