mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
Remove the serde ExtractDocumentId struct
This commit is contained in:
parent
2558ce9a00
commit
25b3c9a057
8 changed files with 47 additions and 635 deletions
|
@ -42,7 +42,7 @@ async fn get_document(
|
|||
.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 document_id = meilisearch_core::update::compute_document_id(&path.document_id);
|
||||
|
||||
let reader = data.db.main_read_txn()?;
|
||||
|
||||
|
@ -65,7 +65,7 @@ async fn delete_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 document_id = meilisearch_core::update::compute_document_id(&path.document_id);
|
||||
|
||||
let mut update_writer = data.db.update_write_txn()?;
|
||||
|
||||
|
@ -237,10 +237,9 @@ async fn delete_documents(
|
|||
let mut documents_deletion = index.documents_deletion();
|
||||
|
||||
for document_id in body.into_inner() {
|
||||
if let Some(document_id) = meilisearch_core::serde::value_to_string(&document_id) {
|
||||
documents_deletion
|
||||
.delete_document_by_id(meilisearch_core::serde::compute_document_id(document_id));
|
||||
}
|
||||
let document_id_string = meilisearch_core::update::value_to_string(&document_id);
|
||||
let document_id = meilisearch_core::update::compute_document_id(document_id_string);
|
||||
documents_deletion.delete_document_by_id(document_id);
|
||||
}
|
||||
|
||||
let update_id = documents_deletion.finalize(&mut writer)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue