mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 13:24:27 +01:00
Restrict FST search to the first letter of the word
This commit is contained in:
parent
534143e91d
commit
1163f390b3
@ -467,7 +467,13 @@ fn fetch_matches<'txn, 'tag>(
|
|||||||
dfa_time += before_dfa.elapsed();
|
dfa_time += before_dfa.elapsed();
|
||||||
|
|
||||||
let mut number_of_words = 0;
|
let mut number_of_words = 0;
|
||||||
let mut stream = words.search(&dfa).into_stream();
|
|
||||||
|
let byte = query.as_bytes()[0];
|
||||||
|
let mut stream = if byte == u8::max_value() {
|
||||||
|
words.search(&dfa).ge(&[byte]).into_stream()
|
||||||
|
} else {
|
||||||
|
words.search(&dfa).ge(&[byte]).lt(&[byte + 1]).into_stream()
|
||||||
|
};
|
||||||
|
|
||||||
// while let Some(input) = stream.next() {
|
// while let Some(input) = stream.next() {
|
||||||
loop {
|
loop {
|
||||||
|
Loading…
Reference in New Issue
Block a user