implement Context trait for criteria

This commit is contained in:
many 2021-02-17 15:27:35 +01:00 committed by Kerollmops
parent d92ad5640a
commit 2d068bd45b
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -181,6 +181,7 @@ fn alterate_query_tree(
ops.iter_mut().try_for_each(|op| recurse(words_fst, op, number_typos, typo_cache)) ops.iter_mut().try_for_each(|op| recurse(words_fst, op, number_typos, typo_cache))
}, },
Operation::Query(q) => { Operation::Query(q) => {
// TODO may be optimized when number_typos == 0
if let QueryKind::Tolerant { typo, word } = &q.kind { if let QueryKind::Tolerant { typo, word } = &q.kind {
// if no typo is allowed we don't call word_derivations function, // if no typo is allowed we don't call word_derivations function,
// and directly create an Exact query // and directly create an Exact query