fix(tasks): limit to max 250 entries when using typesense
All checks were successful
continuous-integration/drone/push Build is passing

Resolves https://community.vikunja.io/t/typesense-250-hits-limit/2536/8
This commit is contained in:
kolaente 2024-07-11 10:06:39 +02:00
parent 2c6bc7742f
commit 2982acc0ec
Signed by: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -573,6 +573,10 @@ func (t *typesenseTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task,
}
if opts.perPage > 0 {
if opts.perPage > 250 {
log.Warningf("Typesense only supports up to 250 results per page, requested %d.", opts.perPage)
opts.perPage = 250
}
params.PerPage = pointer.Int(opts.perPage)
}