mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 16:51:01 +00:00
review the internal schema to allow to create schema without identifier; fix #513
This commit is contained in:
@ -115,7 +115,7 @@ pub fn apply_documents_addition<'a, 'b>(
|
||||
None => return Err(Error::SchemaMissing),
|
||||
};
|
||||
|
||||
let identifier = schema.identifier();
|
||||
let identifier = schema.identifier().ok_or(Error::MissingIdentifier)?;
|
||||
|
||||
// 1. store documents ids for future deletion
|
||||
for document in addition {
|
||||
@ -184,7 +184,7 @@ pub fn apply_documents_partial_addition<'a, 'b>(
|
||||
None => return Err(Error::SchemaMissing),
|
||||
};
|
||||
|
||||
let identifier = schema.identifier();
|
||||
let identifier = schema.identifier().ok_or(Error::MissingIdentifier)?;
|
||||
|
||||
// 1. store documents ids for future deletion
|
||||
for mut document in addition {
|
||||
|
@ -40,7 +40,7 @@ impl DocumentsDeletion {
|
||||
where
|
||||
D: serde::Serialize,
|
||||
{
|
||||
let identifier = schema.identifier();
|
||||
let identifier = schema.identifier().ok_or(Error::MissingIdentifier)?;
|
||||
let document_id = match extract_document_id(&identifier, &document)? {
|
||||
Some(id) => id,
|
||||
None => return Err(Error::MissingDocumentId),
|
||||
|
Reference in New Issue
Block a user