mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-06 03:33:31 +01:00
Fix the addition of empty payload
This commit is contained in:
parent
47b484c07c
commit
19f48c15fb
@ -252,6 +252,24 @@ fn extract_addition_payload_changes<'r, 'pl: 'r>(
|
||||
previous_offset = iter.byte_offset();
|
||||
}
|
||||
|
||||
if payload.is_empty() {
|
||||
let result = retrieve_or_guess_primary_key(
|
||||
rtxn,
|
||||
index,
|
||||
new_fields_ids_map,
|
||||
primary_key_from_op,
|
||||
None,
|
||||
);
|
||||
match result {
|
||||
Ok(Ok((pk, _))) => {
|
||||
primary_key.get_or_insert(pk);
|
||||
}
|
||||
Ok(Err(UserError::NoPrimaryKeyCandidateFound)) => (),
|
||||
Ok(Err(user_error)) => return Err(Error::UserError(user_error)),
|
||||
Err(error) => return Err(error),
|
||||
};
|
||||
}
|
||||
|
||||
Ok(new_docids_version_offsets)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user