From 1cc106b8de558b867adbd545310b9e43f314c0fa Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 11 May 2023 21:09:29 +0900 Subject: [PATCH] =?UTF-8?q?fix(backend):=20=E3=81=B2=E3=81=A8=E3=81=A4?= =?UTF-8?q?=E3=81=AEMeilisearch=E3=82=B5=E3=83=BC=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=92=E8=A4=87=E6=95=B0=E3=81=AEMisskey=E3=82=B5=E3=83=BC?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=81=A7=E4=BD=BF=E3=81=88=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/docker_example.yml | 1 + .config/example.yml | 1 + .devcontainer/devcontainer.yml | 1 + CHANGELOG.md | 5 +++++ chart/files/default.yml | 1 + packages/backend/src/config.ts | 1 + packages/backend/src/core/SearchService.ts | 2 +- 7 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.config/docker_example.yml b/.config/docker_example.yml index 39682e154..5cb17a44d 100644 --- a/.config/docker_example.yml +++ b/.config/docker_example.yml @@ -103,6 +103,7 @@ redis: # port: 7700 # apiKey: '' # ssl: true +# index: '' # ┌───────────────┐ #───┘ ID generation └─────────────────────────────────────────── diff --git a/.config/example.yml b/.config/example.yml index ef8373c4d..c17939596 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -103,6 +103,7 @@ redis: # port: 7700 # apiKey: '' # ssl: true +# index: '' # ┌───────────────┐ #───┘ ID generation └─────────────────────────────────────────── diff --git a/.devcontainer/devcontainer.yml b/.devcontainer/devcontainer.yml index 1d761ae75..824a046dc 100644 --- a/.devcontainer/devcontainer.yml +++ b/.devcontainer/devcontainer.yml @@ -103,6 +103,7 @@ redis: # port: 7700 # apiKey: '' # ssl: true +# index: '' # ┌───────────────┐ #───┘ ID generation └─────────────────────────────────────────── diff --git a/CHANGELOG.md b/CHANGELOG.md index fda8c9dcf..c38cb12c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ ## 13.12.2 +## NOTE +Meilisearchの設定に`index`が必要になりました。値はMisskeyサーバーのホスト名にすることをお勧めします(アルファベット、ハイフン、アンダーバーのみ使用可能)。例: `misskey-io` +過去に作成された`notes`インデックスは、`---notes`にリネームが必要です。例: `misskey-io---notes` + ### General - 投稿したコンテンツのAIによる学習を軽減するオプションを追加 @@ -27,6 +31,7 @@ ### Server - センシティブワードの登録にAnd、正規表現が使用できるようになりました。 +- Fix: ひとつのMeilisearchサーバーを複数のMisskeyサーバーで使えない問題を修正 ## 13.12.1 diff --git a/chart/files/default.yml b/chart/files/default.yml index 342c6091f..e62032abf 100644 --- a/chart/files/default.yml +++ b/chart/files/default.yml @@ -124,6 +124,7 @@ redis: # port: 7700 # apiKey: '' # ssl: true +# index: '' # ┌───────────────┐ #───┘ ID generation └─────────────────────────────────────────── diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index b41fb603b..c6e107538 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -62,6 +62,7 @@ export type Source = { port: string; apiKey: string; ssl?: boolean; + index: string; }; proxy?: string; diff --git a/packages/backend/src/core/SearchService.ts b/packages/backend/src/core/SearchService.ts index c5b91197c..9502afcc9 100644 --- a/packages/backend/src/core/SearchService.ts +++ b/packages/backend/src/core/SearchService.ts @@ -68,7 +68,7 @@ export class SearchService { private idService: IdService, ) { if (meilisearch) { - this.meilisearchNoteIndex = meilisearch.index('notes'); + this.meilisearchNoteIndex = meilisearch.index(`${config.meilisearch!.index}---notes`); this.meilisearchNoteIndex.updateSettings({ searchableAttributes: [ 'text',