We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5715012 commit ef8378aCopy full SHA for ef8378a
functions/src/backfill.js
@@ -78,7 +78,7 @@ module.exports = functions.firestore.document(config.typesenseBackfillTriggerDoc
78
79
lastDoc = thisBatch.docs.at(-1) ?? null;
80
try {
81
- await typesense.collections(encodeURIComponent(config.typesenseCollectionName)).documents().import(currentDocumentsBatch);
+ await typesense.collections(encodeURIComponent(config.typesenseCollectionName)).documents().import(currentDocumentsBatch, { action: 'upsert' });
82
functions.logger.info(`Imported ${currentDocumentsBatch.length} documents into Typesense`);
83
} catch (error) {
84
functions.logger.error(`Import error in a batch of documents from ${currentDocumentsBatch[0].id} to ${lastDoc.id}`, error);
0 commit comments