From 063bbda72cae5ee402bec9ffd36b9b95ea012690 Mon Sep 17 00:00:00 2001 From: R2m1liA <15258427350@163.com> Date: Wed, 5 Nov 2025 08:05:54 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3product=5Fdocuments?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=E5=88=9B=E5=BB=BA=E6=97=B6=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - UUID与id主键冲突,显式指定id为主键 --- src/meilisearch_endpoint/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meilisearch_endpoint/index.ts b/src/meilisearch_endpoint/index.ts index 583f346..a95204a 100644 --- a/src/meilisearch_endpoint/index.ts +++ b/src/meilisearch_endpoint/index.ts @@ -150,7 +150,7 @@ export default defineEndpoint({ // 删除所有索引 await index.deleteAllDocuments(); try { - const enqueueRes = await index.addDocuments(docs); + const enqueueRes = await index.addDocuments(docs, { primaryKey: 'id' }); result.push({ config: cfg.collection_name, enqueued: enqueueRes }); } catch (error) { console.error(`Error reindexing collection ${cfg.collection_name}:`, error);