fix add primary key on index creation

This commit is contained in:
mpostma 2021-03-11 22:54:38 +01:00
parent 271c8ba991
commit 7d9637861f
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A

View File

@ -486,6 +486,11 @@ impl IndexStore for HeedIndexStore {
let index = spawn_blocking(move || -> Result<Index> { let index = spawn_blocking(move || -> Result<Index> {
let index = open_index(&path, 4096 * 100_000)?; let index = open_index(&path, 4096 * 100_000)?;
if let Some(primary_key) = primary_key {
let mut txn = index.write_txn()?;
index.put_primary_key(&mut txn, &primary_key)?;
txn.commit()?;
}
Ok(index) Ok(index)
}) })
.await .await