Search engines to use resultPerPage param if provided

Co-authored-by: Camila Loiola <camilaibs@gmail.com>
Signed-off-by: Emma Indal <emma.indahl@gmail.com>
This commit is contained in:
Emma Indal
2022-09-30 16:08:17 +02:00
committed by Camila Belo
parent 876e3b3d0c
commit 814c8a61f6
2 changed files with 3 additions and 2 deletions
@@ -210,7 +210,7 @@ export class ElasticSearchSearchEngine implements SearchEngine {
.multiMatchQuery(['*'], term)
.fuzziness('auto')
.minimumShouldMatch(1);
const pageSize = 25;
const pageSize = query.resultsPerPage || 25;
const { page } = decodePageCursor(pageCursor);
let esbRequestBodySearch = esb
@@ -71,8 +71,9 @@ export class LunrSearchEngine implements SearchEngine {
term,
filters,
types,
resultsPerPage,
}: SearchQuery): ConcreteLunrQuery => {
const pageSize = 25;
const pageSize = resultsPerPage || 25;
return {
lunrQueryBuilder: q => {