Update milli/src/search/criteria/proximity.rs

Co-authored-by: Clément Renault <clement@meilisearch.com>
This commit is contained in:
Many 2021-06-10 11:30:33 +02:00 committed by GitHub
parent e923a3ed6a
commit 36715f571c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,8 +176,8 @@ fn resolve_candidates<'t>(
let result = match query_tree {
And(ops) => mdfs(ctx, ops, proximity, cache, wdcache)?,
Phrase(words) => if proximity == 0 {
let most_left = words.first().map(|w| Query {prefix: false, kind: QueryKind::exact(w.clone())});
let most_right = words.last().map(|w| Query {prefix: false, kind: QueryKind::exact(w.clone())});
let most_left = words.first().map(|w| Query { prefix: false, kind: QueryKind::exact(w.clone()) });
let most_right = words.last().map(|w| Query { prefix: false, kind: QueryKind::exact(w.clone()) });
let mut candidates = None;
for slice in words.windows(2) {
let (left, right) = (&slice[0], &slice[1]);