diff --git a/packages/backend/src/core/SearchService.ts b/packages/backend/src/core/SearchService.ts index 0e773e6e8..adc21781d 100644 --- a/packages/backend/src/core/SearchService.ts +++ b/packages/backend/src/core/SearchService.ts @@ -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);