Skip to content

Commit

Permalink
Merge branch 'develop' into aaa
Browse files Browse the repository at this point in the history
  • Loading branch information
penginn-net authored Nov 5, 2024
2 parents e334e3f + c647faa commit 919cd2d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_YOJO.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Cherrypick 4.11.1

### Server
- Change: `api/admin/recreate-index`では再インデックスをしないように
- Fix: 高度な検索でノート本文に含まれないタグが検索対象外なのを修正
- Enhance: リモートユーザーの`/api/clips/show``/api/users/clips`の応答にemojisを追加 [#466](https://github.com/yojo-art/cherrypick/pull/466)
- Fix: Opensearch利用時ファイルのセンシティブ状態が変更されたとき変更されるように
- Change: `notes/advanced-search``query`が必須ではなくなりました
Expand Down
9 changes: 5 additions & 4 deletions packages/backend/migration/1729457336777-AddSearchable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ export class AddSearchable1729457336777 {
name = 'AddSearchable1729457336777';

async up(queryRunner) {
await queryRunner.query('ALTER TABLE "user" ADD "searchableBy" "public"."user_searchableby_enum"');
await queryRunner.query('CREATE TYPE "public"."user_searchableby_enum" AS ENUM(\'public\', \'followersAndReacted\', \'reactedOnly\', \'private\')');
await queryRunner.query('CREATE TYPE "public"."note_searchableby_enum" AS ENUM(\'public\', \'followersAndReacted\', \'reactedOnly\', \'private\')');
await queryRunner.query('ALTER TABLE "user" ADD "searchableBy" "public"."user_searchableby_enum"');
await queryRunner.query('ALTER TABLE "note" ADD "searchableBy" "public"."note_searchableby_enum"');
await queryRunner.query('CREATE INDEX "IDX_3932b42da4cf440203d2013649" ON "user" ("searchableBy") ');
}
}

async down(queryRunner) {
await queryRunner.query('ALTER TABLE "note" DROP COLUMN "searchableBy"');
await queryRunner.query('DROP TYPE "public"."note_searchableby_enum"');
await queryRunner.query('ALTER TABLE "user" DROP COLUMN "searchableBy"');
await queryRunner.query('DROP TYPE "public"."note_searchableby_enum"');
await queryRunner.query('DROP TYPE "public"."user_searchableby_enum"');
}
};
2 changes: 1 addition & 1 deletion packages/backend/src/core/AdvancedSearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ export class AdvancedSearchService {
}

if (q && q !== '') {
const fields = [opts.useStrictSearch ? 'text.keyword' : 'text'];
const fields = ['tags', opts.useStrictSearch ? 'text.keyword' : 'text'];
if (!opts.excludeCW) { fields.push(opts.useStrictSearch ? 'cw.keyword' : 'cw' );}
osFilter.bool.must.push({ simple_query_string: { fields: fields, 'query': q, default_operator: 'and' } });
}
Expand Down

0 comments on commit 919cd2d

Please sign in to comment.