mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-29 08:35:15 +08:00
feat: Assert that query are not invalid ones
This commit is contained in:
parent
f5dd776efd
commit
f0f5fc9891
@ -16,6 +16,8 @@ impl LevBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_automaton(&self, query: &str) -> Levenshtein {
|
pub fn get_automaton(&self, query: &str) -> Levenshtein {
|
||||||
|
assert!(!query.is_empty());
|
||||||
|
|
||||||
let dfa = if query.len() <= 4 {
|
let dfa = if query.len() <= 4 {
|
||||||
self.automatons[0].build_prefix_dfa(query)
|
self.automatons[0].build_prefix_dfa(query)
|
||||||
} else if query.len() <= 8 {
|
} else if query.len() <= 8 {
|
||||||
|
Loading…
Reference in New Issue
Block a user