Prefer using constant for the database names

This commit is contained in:
Kerollmops 2021-06-15 11:06:42 +02:00
parent 78fe4259a9
commit 28c004aa2c
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
5 changed files with 183 additions and 152 deletions

View file

@ -11,6 +11,7 @@ use roaring::RoaringBitmap;
use serde_json::{Map, Value};
use crate::error::{Error, UserError, InternalError};
use crate::index::db_name;
use crate::update::index_documents::merge_function::{merge_obkvs, keep_latest_obkv};
use crate::update::{AvailableDocumentsIds, UpdateIndexingStep};
use crate::{BEU32, MergeFn, FieldsIdsMap, ExternalDocumentsIds, FieldId, FieldsDistribution};
@ -411,7 +412,7 @@ impl Transform<'_, '_> {
let key = BEU32::new(docid);
let base_obkv = self.index.documents.get(&self.rtxn, &key)?
.ok_or(InternalError::DatabaseMissingEntry {
db_name: "documents",
db_name: db_name::DOCUMENTS,
key: None,
})?;
let update_obkv = obkv::KvReader::new(update_obkv);