bug(lib): ignore primary if already set on document addition

This commit is contained in:
Marin Postma 2021-12-15 10:07:47 +01:00
parent 5af51c852c
commit d534a7f7c8
2 changed files with 26 additions and 1 deletions

View file

@ -237,7 +237,9 @@ impl Index {
let mut txn = self.write_txn()?;
if let Some(primary_key) = primary_key {
self.update_primary_key_txn(&mut txn, primary_key)?;
if self.primary_key(&txn)?.is_none() {
self.update_primary_key_txn(&mut txn, primary_key)?;
}
}
let indexing_callback = |indexing_step| debug!("update: {:?}", indexing_step);