mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
fix missing primary key
This commit is contained in:
parent
ac63f1cd7a
commit
99e8d4adae
5 changed files with 20 additions and 7 deletions
|
@ -156,7 +156,7 @@ async fn update_multiple_documents(
|
|||
let mut schema = index
|
||||
.main
|
||||
.schema(&reader)?
|
||||
.ok_or(Error::internal("Impossible to retrieve the schema"))?;
|
||||
.ok_or(meilisearch_core::Error::SchemaMissing)?;
|
||||
|
||||
if schema.primary_key().is_none() {
|
||||
let id = match ¶ms.primary_key {
|
||||
|
@ -164,7 +164,7 @@ async fn update_multiple_documents(
|
|||
None => body
|
||||
.first()
|
||||
.and_then(find_primary_key)
|
||||
.ok_or(Error::bad_request("Could not infer a primary key"))?,
|
||||
.ok_or(meilisearch_core::Error::MissingPrimaryKey)?
|
||||
};
|
||||
|
||||
schema
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue