fix(backend): Remove Meilisearch index when notes are deleted (#10988)
* fix(backend): Include feature to delete Meilisearch index notes * Update variable name `cascadingNotesFilter` -> `federatedLocalCascadingNotes` * tweak --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
parent
7ec07d5fd2
commit
60366a4558
3 changed files with 26 additions and 3 deletions
|
@ -115,6 +115,15 @@ export class SearchService {
|
|||
}
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async unindexNote(note: Note): Promise<void> {
|
||||
if (!['home', 'public'].includes(note.visibility)) return;
|
||||
|
||||
if (this.meilisearch) {
|
||||
this.meilisearchNoteIndex!.deleteDocument(note.id);
|
||||
}
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async searchNote(q: string, me: User | null, opts: {
|
||||
userId?: Note['userId'] | null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue