From 6edb460bea563031d5a0ff126263bfb37116bae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 14 Jan 2020 16:52:24 +0100 Subject: [PATCH] Try with an exponential search --- meilisearch-core/src/bucket_sort.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meilisearch-core/src/bucket_sort.rs b/meilisearch-core/src/bucket_sort.rs index 7cc4561da..1ff05086b 100644 --- a/meilisearch-core/src/bucket_sort.rs +++ b/meilisearch-core/src/bucket_sort.rs @@ -15,7 +15,7 @@ use levenshtein_automata::DFA; use log::debug; use meilisearch_tokenizer::{is_cjk, split_query_string}; use meilisearch_types::DocIndex; -use sdset::{Set, SetBuf}; +use sdset::{Set, SetBuf, exponential_search}; use slice_group_by::{GroupBy, GroupByMut}; use crate::automaton::NGRAMS; @@ -103,7 +103,7 @@ where let mut offset = 0; for id in docids.as_slice() { let di = DocIndex { document_id: *id, ..DocIndex::default() }; - let pos = postings_list_view[offset..].binary_search(&di).unwrap_or_else(|x| x); + let pos = exponential_search(&postings_list_view[offset..], &di).unwrap_or_else(|x| x); let group = postings_list_view[offset + pos..] .linear_group_by_key(|m| m.document_id)