From 54d4450a715f8dda3b81b0b457164d0402ddcedb Mon Sep 17 00:00:00 2001 From: John Conroy <62477388+john-conroy@users.noreply.github.com> Date: Fri, 6 Dec 2024 12:38:18 -0500 Subject: [PATCH] John conroy/search last page (#3640) * Add tiebreaker for sort * Add changelog * Fix comment * Update variable name --------- Co-authored-by: John Conroy --- CHANGELOG-search-last-page.md | 1 + context/app/static/js/components/search/utils.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG-search-last-page.md diff --git a/CHANGELOG-search-last-page.md b/CHANGELOG-search-last-page.md new file mode 100644 index 0000000000..1e3356bcb6 --- /dev/null +++ b/CHANGELOG-search-last-page.md @@ -0,0 +1 @@ +- Fix bug where you could not scroll to deeper search pages. \ No newline at end of file diff --git a/context/app/static/js/components/search/utils.ts b/context/app/static/js/components/search/utils.ts index 13b23e8e01..70d232e657 100644 --- a/context/app/static/js/components/search/utils.ts +++ b/context/app/static/js/components/search/utils.ts @@ -54,7 +54,10 @@ function buildSortField({ sortField, mappings }: { sortField: SortField; mapping ? [esb.sort(getESField({ field: secondarySortField.field, mappings }), secondarySortField.direction)] : []; - return [primarySort, ...secondarySort]; + // Sort values need to be unique for search_after. + const uniqueSort = esb.sort('uuid.keyword', 'desc'); + + return [primarySort, ...secondarySort, uniqueSort]; } export function buildQuery({