mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
elastic: set default size
This commit is contained in:
1 parent
6f7154a83a
commit
d11070ff4f
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/elastic-search",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"main": "package.json",
|
||||
"repository": "https://github.com/hydro-dev/Hydro",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
|
||||
@@ -32,7 +32,7 @@ bus.on('problem/del', async (domainId, docId) => {
|
||||
});
|
||||
|
||||
global.Hydro.lib.problemSearch = async (domainId, q, opts) => {
|
||||
const allowedSize = system.get('elasic.indexSize');
|
||||
const allowedSize = system.get('elasic-search.indexSize') || 10000;
|
||||
const size = opts?.limit || system.get('pagination.problem');
|
||||
const from = Math.min(allowedSize - size, opts?.skip || 0);
|
||||
const union = await DomainModel.getUnion(domainId);
|
||||
|
||||
Reference in new issue
Block a user