From c290719984e461f8a9354b797d5d45e90ec88ef9 Mon Sep 17 00:00:00 2001 From: mpostma Date: Mon, 4 Jan 2021 14:54:19 +0100 Subject: [PATCH] remove byte offset in index_seq --- meilisearch-core/src/raw_indexer.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/meilisearch-core/src/raw_indexer.rs b/meilisearch-core/src/raw_indexer.rs index 16fad6604..3aded1ca5 100644 --- a/meilisearch-core/src/raw_indexer.rs +++ b/meilisearch-core/src/raw_indexer.rs @@ -73,25 +73,18 @@ where where I: IntoIterator, { - let mut byte_offset = 0; let mut word_offset = 0; for text in text_iter.into_iter() { - let current_byte_offset = byte_offset; let current_word_offset = word_offset; let analyzed_text = self.analyzer.analyze(text); let tokens = process_tokens(analyzed_text.tokens()) - .map(|(i, mut t)| { - t.byte_start += current_byte_offset; - t.byte_end += current_byte_offset; - (i + current_word_offset, t) - }) + .map(|(i, t)| (i + current_word_offset, t)) .enumerate(); for (token_pos, (word_pos, token)) in tokens { word_offset = word_pos + 1; - byte_offset = token.byte_end + 1; let must_continue = index_token( token,