mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-08-01 11:20:04 +00:00
Search for closest non-stop words in proximity criteria
This commit is contained in:
@ -187,14 +187,15 @@ fn resolve_candidates<'t>(
|
|||||||
Phrase(words) => {
|
Phrase(words) => {
|
||||||
if proximity == 0 {
|
if proximity == 0 {
|
||||||
let most_left = words
|
let most_left = words
|
||||||
.first()
|
.iter()
|
||||||
.map(|o| o.as_ref())
|
.filter_map(|o| o.as_ref())
|
||||||
.flatten()
|
.next()
|
||||||
.map(|w| Query { prefix: false, kind: QueryKind::exact(w.clone()) });
|
.map(|w| Query { prefix: false, kind: QueryKind::exact(w.clone()) });
|
||||||
let most_right = words
|
let most_right = words
|
||||||
.last()
|
.iter()
|
||||||
.map(|o| o.as_ref())
|
.rev()
|
||||||
.flatten()
|
.filter_map(|o| o.as_ref())
|
||||||
|
.next()
|
||||||
.map(|w| Query { prefix: false, kind: QueryKind::exact(w.clone()) });
|
.map(|w| Query { prefix: false, kind: QueryKind::exact(w.clone()) });
|
||||||
|
|
||||||
match (most_left, most_right) {
|
match (most_left, most_right) {
|
||||||
|
Reference in New Issue
Block a user