From 5a5263a0cee742f5611b54f230b81122a41e9072 Mon Sep 17 00:00:00 2001 From: sdjdd Date: Thu, 28 Mar 2024 15:30:51 +0800 Subject: [PATCH] chore: temp search index --- next/api/src/service/search-ticket.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/next/api/src/service/search-ticket.ts b/next/api/src/service/search-ticket.ts index 610575a3b..b64e36a90 100644 --- a/next/api/src/service/search-ticket.ts +++ b/next/api/src/service/search-ticket.ts @@ -124,7 +124,15 @@ export class SearchTicketService { ); await this.esClient.bulk({ - body: docs.flatMap((doc) => [{ index: { _index: this.indexName, _id: doc.objectId } }, doc]), + body: docs.flatMap((doc) => [ + { + index: { + _index: this.indexName + '-tmp', + _id: doc.objectId, + }, + }, + doc, + ]), }); } @@ -292,7 +300,7 @@ export class SearchTicketService { .toJSON(); const res = await this.esClient.search({ - index: this.indexName, + index: [this.indexName, this.indexName + '-tmp'], body, });