refactor: 🚸 only index public posts
This commit is contained in:
parent
c456b1082d
commit
cf8a733927
2 changed files with 2 additions and 1 deletions
|
@ -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")
|
||||
|
|
|
@ -806,7 +806,7 @@ async function insertNote(
|
|||
}
|
||||
|
||||
export async function index(note: Note, reindexing: boolean): Promise<void> {
|
||||
if (!note.text) return;
|
||||
if (!note.text || note.visibility === "public") return;
|
||||
|
||||
if (config.elasticsearch && es) {
|
||||
es.index({
|
||||
|
|
Loading…
Reference in a new issue