mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
elastic: add skip limit
This commit is contained in:
1 parent
842322d15c
commit
7457786c5c
3 files changed
+5
-2
No files matched your search
@@ -32,8 +32,9 @@ bus.on('problem/del', async (domainId, docId) => {
|
||||
});
|
||||
|
||||
global.Hydro.lib.problemSearch = async (domainId, q, opts) => {
|
||||
const allowedSize = system.get('elasic.indexSize');
|
||||
const size = opts?.limit || system.get('pagination.problem');
|
||||
const from = opts?.skip || 0;
|
||||
const from = Math.min(allowedSize - size, opts?.skip || 0);
|
||||
const union = await DomainModel.getUnion(domainId);
|
||||
const domainIds = [domainId, ...(union?.union || [])];
|
||||
const res = await client.search({
|
||||
|
||||
Reference in new issue
Block a user