Finally bump grenad to v0.4.1

This commit is contained in:
Clément Renault 2022-02-16 15:28:48 +01:00
parent fb79c32430
commit f367cc2e75
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
18 changed files with 130 additions and 94 deletions

View file

@ -16,8 +16,8 @@ use crate::{DocumentId, FieldId, Result};
/// Returns the generated grenad reader containing the docid the fid and the orginal value as key
/// and the normalized value as value extracted from the given chunk of documents.
#[logging_timer::time]
pub fn extract_fid_docid_facet_values<R: io::Read>(
mut obkv_documents: grenad::Reader<R>,
pub fn extract_fid_docid_facet_values<R: io::Read + io::Seek>(
obkv_documents: grenad::Reader<R>,
indexer: GrenadParameters,
faceted_fields: &HashSet<FieldId>,
) -> Result<(grenad::Reader<File>, grenad::Reader<File>)> {
@ -40,7 +40,8 @@ pub fn extract_fid_docid_facet_values<R: io::Read>(
);
let mut key_buffer = Vec::new();
while let Some((docid_bytes, value)) = obkv_documents.next()? {
let mut cursor = obkv_documents.into_cursor()?;
while let Some((docid_bytes, value)) = cursor.move_on_next()? {
let obkv = obkv::KvReader::new(value);
for (field_id, field_bytes) in obkv.iter() {