From 43f11e929dde94bc05c49cec0fdb4b50aaa43484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Wed, 19 Jun 2019 13:46:48 +0200 Subject: [PATCH] fix: Do not trigger a synonym when its not the last word and is a prefix --- meilidb-core/src/query_builder.rs | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/meilidb-core/src/query_builder.rs b/meilidb-core/src/query_builder.rs index ce427698a..decffc3b6 100644 --- a/meilidb-core/src/query_builder.rs +++ b/meilidb-core/src/query_builder.rs @@ -31,11 +31,14 @@ fn generate_automatons(query: &str, store: &S) -> Result(query: &str, store: &S) -> Result { - assert_eq!(matches.len(), 1); - let match_ = matches[0]; - assert_eq!(match_.query_index, 0); - assert_eq!(match_.word_index, 0); - }); assert_matches!(iter.next(), None); let builder = QueryBuilder::new(&store); let results = builder.query("bonj blabla", 0..20).unwrap(); let mut iter = results.into_iter(); - assert_matches!(iter.next(), Some(Document { id: DocumentId(0), matches }) => { - assert_eq!(matches.len(), 1); - let match_ = matches[0]; - assert_eq!(match_.query_index, 0); - assert_eq!(match_.word_index, 0); - }); assert_matches!(iter.next(), None); }