mirror of
https://github.com/MisskeyIO/misskey
synced 2024-11-23 22:56:49 +09:00
Apply suggestions from code review
Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>
This commit is contained in:
parent
023b34df11
commit
4331d0bd43
@ -212,7 +212,7 @@ export class SearchService {
|
||||
tags: note.tags,
|
||||
};
|
||||
await this.elasticsearch.index({
|
||||
index: this.elasticsearchNoteIndex + `-${createdAt.toISOString().slice(0, 7).replace(/-/g, '')}` as string,
|
||||
index: `${this.elasticsearchNoteIndex}-${createdAt.toISOString().slice(0, 7).replace(/-/g, '')}`,
|
||||
id: note.id,
|
||||
body: body,
|
||||
}).catch((error) => {
|
||||
@ -229,7 +229,7 @@ export class SearchService {
|
||||
this.meilisearchNoteIndex!.deleteDocument(note.id);
|
||||
} else if (this.elasticsearch) {
|
||||
await this.elasticsearch.delete({
|
||||
index: this.elasticsearchNoteIndex + `-${this.idService.parse(note.id).date.toISOString().slice(0, 7).replace(/-/g, '')}` as string,
|
||||
index: `${this.elasticsearchNoteIndex}-${this.idService.parse(note.id).date.toISOString().slice(0, 7).replace(/-/g, '')}`,
|
||||
id: note.id,
|
||||
}).catch((error) => {
|
||||
this.logger.error(error);
|
||||
|
Loading…
Reference in New Issue
Block a user