mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 10:37:41 +08:00
Fix indexing bug in words_prefix_position
This commit is contained in:
parent
a81165f0d8
commit
540a396e49
@ -81,8 +81,7 @@ impl<'t, 'u, 'i> WordPrefixPositionDocids<'t, 'u, 'i> {
|
|||||||
let mut current_prefixes: Option<&&[String]> = None;
|
let mut current_prefixes: Option<&&[String]> = None;
|
||||||
let mut prefixes_cache = HashMap::new();
|
let mut prefixes_cache = HashMap::new();
|
||||||
while let Some((key, data)) = new_word_position_docids_iter.move_on_next()? {
|
while let Some((key, data)) = new_word_position_docids_iter.move_on_next()? {
|
||||||
let (word, pos) = StrBEU32Codec::bytes_decode(key).ok_or(heed::Error::Decoding)?;
|
let (word, pos) = StrBEU16Codec::bytes_decode(key).ok_or(heed::Error::Decoding)?;
|
||||||
let (_fid, pos) = relative_from_absolute_position(pos);
|
|
||||||
|
|
||||||
current_prefixes = match current_prefixes.take() {
|
current_prefixes = match current_prefixes.take() {
|
||||||
Some(prefixes) if word.starts_with(&prefixes[0]) => Some(prefixes),
|
Some(prefixes) if word.starts_with(&prefixes[0]) => Some(prefixes),
|
||||||
|
Loading…
Reference in New Issue
Block a user