diff --git a/rust/worker/src/blockstore/positional_posting_list_value.rs b/rust/worker/src/blockstore/positional_posting_list_value.rs index 5cddeb36044..f6d92c9e59c 100644 --- a/rust/worker/src/blockstore/positional_posting_list_value.rs +++ b/rust/worker/src/blockstore/positional_posting_list_value.rs @@ -20,7 +20,7 @@ impl PositionalPostingList { } pub(crate) fn get_positions_for_doc_id(&self, doc_id: i32) -> Option { - let index = self.doc_ids.iter().position(|x| x == Some(doc_id)); + let index = self.doc_ids.values().binary_search(&doc_id).ok(); match index { Some(index) => { let target_positions = self.positions.value(index);