remove field_id_from_position

This commit is contained in:
ad hoc 2022-04-05 09:50:34 +02:00
parent dac81b2d44
commit b85cd4983e
No known key found for this signature in database
GPG Key ID: 4F00A782990CC643
2 changed files with 2 additions and 6 deletions

View File

@ -74,10 +74,6 @@ pub fn absolute_from_relative_position(field_id: FieldId, relative: RelativePosi
(field_id as u32) << 16 | (relative as u32) (field_id as u32) << 16 | (relative as u32)
} }
pub fn field_id_from_position(position: u32) -> FieldId {
(position >> 16 & 0xffff) as u16
}
/// Transform a raw obkv store into a JSON Object. /// Transform a raw obkv store into a JSON Object.
pub fn obkv_to_json( pub fn obkv_to_json(
displayed_fields: &[FieldId], displayed_fields: &[FieldId],

View File

@ -12,7 +12,7 @@ use super::helpers::{
use crate::error::SerializationError; use crate::error::SerializationError;
use crate::index::db_name::DOCID_WORD_POSITIONS; use crate::index::db_name::DOCID_WORD_POSITIONS;
use crate::update::index_documents::helpers::read_u32_ne_bytes; use crate::update::index_documents::helpers::read_u32_ne_bytes;
use crate::{field_id_from_position, FieldId, Result}; use crate::{relative_from_absolute_position, FieldId, Result};
/// Extracts the word and the documents ids where this word appear. /// Extracts the word and the documents ids where this word appear.
/// ///
@ -67,7 +67,7 @@ pub fn extract_word_docids<R: io::Read + io::Seek>(
if added_to_exact && added_to_word_docids { if added_to_exact && added_to_word_docids {
break; break;
} }
let fid = field_id_from_position(position); let (fid, _) = relative_from_absolute_position(position);
if exact_attributes.contains(&fid) && !added_to_exact { if exact_attributes.contains(&fid) && !added_to_exact {
exact_word_docids_sorter.insert(word_bytes, &value_buffer)?; exact_word_docids_sorter.insert(word_bytes, &value_buffer)?;
added_to_exact = true; added_to_exact = true;