From 762950552edb1cb7e88c744b9e49655fa32986f1 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Thu, 27 Jun 2024 05:56:11 +0200 Subject: [PATCH] search: result per page 50 -> 100 and make configurable (#38) --- server/config/default.yaml | 4 ++++ server/src/routes/html/search.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server/config/default.yaml b/server/config/default.yaml index 329a504..d5d1fbc 100644 --- a/server/config/default.yaml +++ b/server/config/default.yaml @@ -38,6 +38,10 @@ disableGUI: false # You can disable searching through the GUI disableSearchGUI: false +# How many max entries do you want per page? +search: + resultPerPage: 100 + ## Configure the GUI html: css: diff --git a/server/src/routes/html/search.js b/server/src/routes/html/search.js index ede1f87..11b4aac 100644 --- a/server/src/routes/html/search.js +++ b/server/src/routes/html/search.js @@ -25,7 +25,7 @@ function shortURL(url, longVersion) { } search.get('/', async function (request, response) { - const limit = request.query.limit || 50; + const limit = request.query.limit || nconf.get('search:resultPerPage') || 100; const currentPage = Number.parseInt(request.query.page, 10) || 1; let result = await (request.query.search === '' || request.query.search === undefined