mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-30 10:20:05 +00:00
Limit the number of derivations for a single word.
This commit is contained in:
18
milli/src/search/new/limits.rs
Normal file
18
milli/src/search/new/limits.rs
Normal file
@ -0,0 +1,18 @@
|
||||
/// Maximum number of tokens we consider in a single search.
|
||||
// TODO: Loic, find proper value here so we don't overflow the interner.
|
||||
pub const MAX_TOKEN_COUNT: usize = 1_000;
|
||||
|
||||
/// Maximum number of prefixes that can be derived from a single word.
|
||||
pub const MAX_PREFIX_COUNT: usize = 1_000;
|
||||
/// Maximum number of words that can be derived from a single word with a distance of one to that word.
|
||||
pub const MAX_ONE_TYPO_COUNT: usize = 150;
|
||||
/// Maximum number of words that can be derived from a single word with a distance of two to that word.
|
||||
pub const MAX_TWO_TYPOS_COUNT: usize = 50;
|
||||
|
||||
/// Maximum amount of synonym phrases that can be derived from a single word.
|
||||
pub const MAX_SYNONYM_PHRASE_COUNT: usize = 50;
|
||||
|
||||
/// Maximum amount of words inside of all the synonym phrases that can be derived from a single word.
|
||||
///
|
||||
/// This limit is meant to gracefully handle the case where a word would have very long phrases as synonyms.
|
||||
pub const MAX_SYNONYM_WORD_COUNT: usize = 100;
|
Reference in New Issue
Block a user