fix: 修正product_documents索引创建时报错的问题
- UUID与id主键冲突,显式指定id为主键
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user