diff --git a/packages/backend/src/server/api/endpoints/notes/search.ts b/packages/backend/src/server/api/endpoints/notes/search.ts index 21ee7f48eb..8c5798b62d 100644 --- a/packages/backend/src/server/api/endpoints/notes/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/search.ts @@ -85,6 +85,7 @@ export default define(meta, paramDef, async (ps, me) => { query .andWhere("note.text ILIKE :q", { q: `%${sqlLikeEscape(ps.query)}%` }) + .andWhere("note.visibility = 'public'") .innerJoinAndSelect("note.user", "user") .leftJoinAndSelect("user.avatar", "avatar") .leftJoinAndSelect("user.banner", "banner") diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index adebc22a40..b7704946ff 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -806,7 +806,7 @@ async function insertNote( } export async function index(note: Note, reindexing: boolean): Promise { - if (!note.text) return; + if (!note.text || note.visibility === "public") return; if (config.elasticsearch && es) { es.index({