add search endpoint; warn unwrap

This commit is contained in:
Quentin de Quelen 2020-04-07 19:34:57 +02:00 committed by qdequele
parent 0aa16dd3b1
commit 73b5c87cbb
No known key found for this signature in database
GPG key ID: B3F0A000EBF11745
5 changed files with 58 additions and 60 deletions

View file

@ -75,7 +75,7 @@ impl From<meilisearch_core::Error> for Error {
};
let message = format!("parsing error on line {} at column {}: {}", line, column, e.variant.message());
Error::FilterParsing(message)
Error::FilterParsing(message)
},
_ => Error::Internal(error.to_string()),
}
@ -257,7 +257,7 @@ impl<'a> SearchBuilder<'a> {
for doc in docs {
let mut document: IndexMap<String, Value> = self
.index
.document(reader, Some(&all_attributes), doc.id)
.document(reader, Some(all_attributes.clone()), doc.id)
.map_err(|e| Error::RetrieveDocument(doc.id.0, e.to_string()))?
.ok_or(Error::DocumentNotFound(doc.id.0))?;

View file

@ -1,2 +1,2 @@
// pub mod meilisearch;
pub mod meilisearch;
// pub mod tide;