Skip to content

Commit

Permalink
John conroy/search last page (#3640)
Browse files Browse the repository at this point in the history
* Add tiebreaker for sort

* Add changelog

* Fix comment

* Update variable name

---------

Co-authored-by: John Conroy <[email protected]>
  • Loading branch information
john-conroy and john-conroy authored Dec 6, 2024
1 parent cd5e17c commit 54d4450
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-search-last-page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix bug where you could not scroll to deeper search pages.
5 changes: 4 additions & 1 deletion context/app/static/js/components/search/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 54d4450

Please sign in to comment.