From 996619b22a024777a08483740458d48cc73f5725 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Tue, 4 Apr 2023 17:07:26 +0200 Subject: [PATCH] Increase position by 8 on hard separator when building query terms --- milli/src/search/new/query_term.rs | 2 +- .../index_documents/extract/extract_docid_word_positions.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/milli/src/search/new/query_term.rs b/milli/src/search/new/query_term.rs index 90b03d194..005c0a2e3 100644 --- a/milli/src/search/new/query_term.rs +++ b/milli/src/search/new/query_term.rs @@ -907,7 +907,7 @@ pub fn located_query_terms_from_string( TokenKind::Separator(separator_kind) => { match separator_kind { SeparatorKind::Hard => { - position += 1; + position += 8; } SeparatorKind::Soft => { position += 0; diff --git a/milli/src/update/index_documents/extract/extract_docid_word_positions.rs b/milli/src/update/index_documents/extract/extract_docid_word_positions.rs index 2d51fcc1a..c362f8f1b 100644 --- a/milli/src/update/index_documents/extract/extract_docid_word_positions.rs +++ b/milli/src/update/index_documents/extract/extract_docid_word_positions.rs @@ -153,7 +153,7 @@ fn json_to_string<'a>(value: &'a Value, buffer: &'a mut String) -> Option<&'a st /// take an iterator on tokens and compute their relative position depending on separator kinds /// if it's an `Hard` separator we add an additional relative proximity of 8 between words, -/// else we keep the standart proximity of 1 between words. +/// else we keep the standard proximity of 1 between words. fn process_tokens<'a>( tokens: impl Iterator>, ) -> impl Iterator)> {