mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
sonic: index by pid
This commit is contained in:
1 parent
03db807a19
commit
bf5bc8b8b0
3 files changed
+4
-4
No files matched your search
@@ -8,7 +8,7 @@ bus.on('problem/add', async (doc, docId) => {
|
||||
const tasks = [];
|
||||
for (const domainId of [doc.domainId, ...union.map((i) => i._id)]) {
|
||||
tasks.push(
|
||||
sonic.push('problem', `${domainId}@title`, `${doc.domainId}/${docId}`, doc.title),
|
||||
sonic.push('problem', `${domainId}@title`, `${doc.domainId}/${docId}`, `${doc.pid || ''} ${doc.title}`),
|
||||
sonic.push('problem', `${domainId}@content`, `${doc.domainId}/${docId}`, doc.content.toString()),
|
||||
);
|
||||
}
|
||||
@@ -22,7 +22,7 @@ bus.on('problem/edit', async (pdoc) => {
|
||||
for (const domainId of [pdoc.domainId, ...union.map((i) => i._id)]) {
|
||||
tasks.push(
|
||||
sonic.flusho('problem', `${domainId}@title`, id)
|
||||
.then(() => sonic.push('problem', `${domainId}@title`, id, pdoc.title)),
|
||||
.then(() => sonic.push('problem', `${domainId}@title`, id, `${pdoc.pid || ''} ${pdoc.title}`)),
|
||||
sonic.flusho('problem', `${domainId}@content`, id)
|
||||
.then(() => sonic.push('problem', `${domainId}@content`, id, pdoc.content.toString())),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user