fix: search service to use replaceAllObjects method

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei
2024-01-31 12:48:10 +08:00
parent c4a27cc25a
commit 00964c3822

View File

@@ -262,9 +262,8 @@ export class SearchService {
documents.push(...documents_) documents.push(...documents_)
}) })
try { try {
await index.clearObjects()
await Promise.all([ await Promise.all([
index.saveObjects(documents, { index.replaceAllObjects(documents, {
autoGenerateObjectIDIfNotExist: false, autoGenerateObjectIDIfNotExist: false,
}), }),
index.setSettings({ index.setSettings({