sonic: fix re-index

This commit is contained in:
undefined committed 2021-12-06 12:51:00 +08:00
1 parent e802ad83b5
commit 3f872a7b84
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ export async function run({ domainId }, report) {
if (!(i % 1000)) report({ message: `${i} problems indexed` });
const union = await DomainModel.searchUnion({ union: pdoc.domainId, problem: true });
const tasks = [];
for (const did of [domainId, ...union.map((j) => j._id)]) {
for (const did of [pdoc.domainId, ...union.map((j) => j._id)]) {
tasks.push(
pdoc.title && sonic.push('problem', `${did}@title`, `${pdoc.domainId}/${pdoc.docId}`, pdoc.title),
pdoc.content.toString() && sonic.push('problem', `${did}@content`, `${pdoc.domainId}/${pdoc.docId}`, pdoc.content.toString()),