mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-18 17:11:15 +08:00
Search for closest non-stop words in proximity criteria
This commit is contained in:
parent
709ab3c14c
commit
3e190503e6
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user