From abfa7ded25ba3a94a772c552e9b11de034de4eaa Mon Sep 17 00:00:00 2001 From: Vivek Kumar Date: Wed, 6 Sep 2023 17:31:18 +0530 Subject: [PATCH] use a new temp index in the test --- milli/src/search/new/matches/mod.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/milli/src/search/new/matches/mod.rs b/milli/src/search/new/matches/mod.rs index ac6e49008..5d61de0f4 100644 --- a/milli/src/search/new/matches/mod.rs +++ b/milli/src/search/new/matches/mod.rs @@ -800,7 +800,12 @@ mod tests { #[test] fn format_highlight_crop_phrase_query() { //! testing: https://github.com/meilisearch/meilisearch/issues/3975 - let temp_index = temp_index_with_documents(); + let temp_index = TempIndex::new(); + temp_index + .add_documents(documents!([ + { "id": 1, "text": "The groundbreaking invention had the power to split the world between those who embraced progress and those who resisted change!" } + ])) + .unwrap(); let rtxn = temp_index.read_txn().unwrap(); let format_options = FormatOptions { highlight: true, crop: Some(10) }; @@ -816,10 +821,10 @@ mod tests { let builder = MatcherBuilder::new_test(&rtxn, &temp_index, "those \"and those\""); let mut matcher = builder.build(text); - // should highlight both "and" and "those". + // should highlight "those" and the phrase "and those". insta::assert_snapshot!( matcher.format(format_options), - @"…between those who embraced progress and those who resisted change…" + @"…world between those who embraced progress and those who resisted…" ); }