sonic: fix imvalid limit error

This commit is contained in:
undefined committed 2021-04-27 12:26:40 +08:00
1 parent 6924875ec9
commit 23880f11fa
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -22,6 +22,6 @@ bus.on('problem/del', async (domainId, docId) => {
global.Hydro.lib.problemSearch = async (domainId: string, query: string) => {
const c = system.get('pagination.problem');
const docIds = await sonic.query('problem', `${domainId}@title`, query, { limit: c });
docIds.push(...await sonic.query('problem', `${domainId}@content`, query, { limit: c - docIds.length }));
if (c - docIds.length > 0) docIds.push(...await sonic.query('problem', `${domainId}@content`, query, { limit: c - docIds.length }));
return docIds.map(Number);
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/sonic",
"version": "1.0.2",
"version": "1.0.3",
"description": "Sonic search service",
"main": "service.js",
"typings": "service.d.ts",