Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Merge #559
Browse files Browse the repository at this point in the history
559: Avoid having an ending separator before crop marker r=irevoire a=ManyTheFish

related to meilisearch/meilisearch#2528


Co-authored-by: ManyTheFish <many@meilisearch.com>
  • Loading branch information
bors[bot] and ManyTheFish authored Jun 20, 2022
2 parents a59ae19 + a0ab90a commit 64b8334
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion milli/src/search/matches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,11 @@ impl<'t, A: AsRef<[u8]>> Matcher<'t, '_, A> {
(Some(before_token_kind), Some(after_token_kind)) => {
if before_token_kind == after_token_kind {
before_tokens.next();
after_tokens.next();

// this avoid having an ending separator before crop marker.
if remaining_words > 1 {
after_tokens.next();
}
} else if before_token_kind == SeparatorKind::Hard {
after_tokens.next();
} else {
Expand Down

0 comments on commit 64b8334

Please sign in to comment.