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
5 changed files with 183 additions and 152 deletions

View File

@ -32,7 +32,7 @@ const LMDB_MAX_KEY_LENGTH: usize = 511;
const ONE_KILOBYTE: usize = 1024 * 1024;
const MAX_POSITION: usize = 1000;
const WORDS_FST_KEY: &[u8] = crate::index::WORDS_FST_KEY.as_bytes();
const WORDS_FST_KEY: &[u8] = crate::index::main_key::WORDS_FST_KEY.as_bytes();
pub struct Readers {
pub main: Reader<FileFuse>,

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);