Modify pager operation based on total

Created on 22 May 2025, 1 day ago

Problem/Motivation

Currently, the pager on the search results page provided by this module adheres to the total result count that is part of the vertex search response. However, this number is a rough estimate of the number results and may not be precise. As you go deeper into the pagination, the estimate becomes more precise. The last page with results should have the accurate count.

When the pager is calculated, it may (for example) be based on the reported number of results being 55. This means that 6 pages will be available in the pager. If you are on the first page and then click on page 6, you may find that there are no results to display because, in actuality, there were only 32 results instead of 55 (for example).

Proposed resolution

Two things:

  1. The configuration for a vertex custom search provides a 'Total Results Limit' value. The pager should be calculated based on this value rather than the total results available as reported by the vertex response. This will mitigate the possibility of empty page links in the pager. If the limit is say 100, but Google says there are 1230 results, then 100 will be used as the number of possible results. If the limit is 100 but google says there are only 12 results found, then 12 will be used.
  2. Provide an alternate pager that does not display all the page links at once. Limit the navigation of the pager to the use of the 'next' page link. This means the user will move through the pages sequentially rather than picking page 6 while being on page 1 (again..for example). The response from vertex will include a nextPage token that, if populated, indicates that another page of results is available.
  3. Provide an option on the configuration page to use the default pager or the abbreviated version of the pager.
✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tzura

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024