From b10337c858e1e313c2703f2b4e3c04abf346c495 Mon Sep 17 00:00:00 2001 From: PrivateGER Date: Tue, 30 May 2023 23:11:10 +0200 Subject: [PATCH] Add english and japanese stop words to Meili database --- packages/backend/src/db/meilisearch.ts | 60 ++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/packages/backend/src/db/meilisearch.ts b/packages/backend/src/db/meilisearch.ts index 01efaa0ba..8b8c36ddf 100644 --- a/packages/backend/src/db/meilisearch.ts +++ b/packages/backend/src/db/meilisearch.ts @@ -61,6 +61,66 @@ if (hasConfig) { ), ); + posts + .updateStopWords([ + "the", + "a", + "as", + "be", + "of", + "they", + "these", + "これ", + "それ", + "あれ", + "この", + "その", + "あの", + "ここ", + "そこ", + "あそこ", + "こちら", + "どこ", + "だれ", + "なに", + "なん", + "何", + "私", + "貴方", + "貴方方", + "我々", + "私達", + "あの人", + "あのか", + "彼女", + "彼", + "です", + "ありま", + "おりま", + "います", + "は", + "が", + "の", + "に", + "を", + "で", + "え", + "から", + "まで", + "より", + "も", + "どの", + "と", + "し", + "それで", + "しかし", + ]) + .catch((e) => + logger.error( + `Failed to set Meilisearch stop words, database size will be larger: ${e}`, + ), + ); + logger.info("Connected to MeiliSearch"); }