mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-24 13:40:31 +01:00
Sort positions before iterating over them during word pair proximity extraction
This commit is contained in:
parent
cc32519a2d
commit
8970246bc4
@ -53,7 +53,9 @@ pub fn extract_word_pair_proximity_docids<R: io::Read>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let word = word.to_string();
|
let word = word.to_string();
|
||||||
let mut iter = read_u32_ne_bytes(value).collect::<Vec<_>>().into_iter();
|
let mut positions: Vec<_> = read_u32_ne_bytes(value).collect();
|
||||||
|
positions.sort_unstable();
|
||||||
|
let mut iter = positions.into_iter();
|
||||||
if let Some(position) = iter.next() {
|
if let Some(position) = iter.next() {
|
||||||
document_word_positions_heap.push(PeekedWordPosition { word, position, iter });
|
document_word_positions_heap.push(PeekedWordPosition { word, position, iter });
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user