From a95a18afe4a9e766ac43315af6102f3cc17a1a98 Mon Sep 17 00:00:00 2001 From: mpostma Date: Wed, 3 Feb 2021 11:59:29 +0100 Subject: [PATCH] ignore primary key if it is already set --- meilisearch-http/src/routes/document.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meilisearch-http/src/routes/document.rs b/meilisearch-http/src/routes/document.rs index 943351bd7..202575cc3 100644 --- a/meilisearch-http/src/routes/document.rs +++ b/meilisearch-http/src/routes/document.rs @@ -175,7 +175,6 @@ async fn update_multiple_documents( .ok_or(meilisearch_core::Error::SchemaMissing)?; match (params.into_inner().primary_key, schema.primary_key()) { - (Some(_), Some(_)) => return Err(meilisearch_schema::Error::PrimaryKeyAlreadyPresent)?, (Some(key), None) => document_addition.set_primary_key(key), (None, None) => { let key = body @@ -184,7 +183,7 @@ async fn update_multiple_documents( .ok_or(meilisearch_core::Error::MissingPrimaryKey)?; document_addition.set_primary_key(key); } - (None, Some(_)) => () + _ => () } for document in body.into_inner() {