mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
sonic: fix re-index
This commit is contained in:
1 parent
e802ad83b5
commit
3f872a7b84
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/sonic",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "Sonic search service",
|
||||
"main": "service.js",
|
||||
"typings": "service.d.ts",
|
||||
|
||||
@@ -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()),
|
||||
|
||||
Reference in new issue
Block a user