test a new implementation of the stop_words

This commit is contained in:
tamo 2021-04-08 21:21:20 +02:00
parent da036dcc3e
commit dcb00b2e54
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
3 changed files with 25 additions and 13 deletions

View file

@ -602,12 +602,13 @@ mod tests {
assert_eq!(stop_words.as_fst().as_bytes(), expected.as_fst().as_bytes());
// when we search for something that is a non prefix stop_words it should be ignored
// thus we should get a placeholder search (all the results = 3)
let result = index.search(&rtxn).query("the ").execute().unwrap();
assert!(result.documents_ids.is_empty());
assert_eq!(result.documents_ids.len(), 3);
let result = index.search(&rtxn).query("i ").execute().unwrap();
assert!(result.documents_ids.is_empty());
assert_eq!(result.documents_ids.len(), 3);
let result = index.search(&rtxn).query("are ").execute().unwrap();
assert!(result.documents_ids.is_empty());
assert_eq!(result.documents_ids.len(), 3);
let result = index.search(&rtxn).query("dog").execute().unwrap();
assert_eq!(result.documents_ids.len(), 2); // we have two maxims talking about doggos