Gravatar for ebnoble32@charter.net

Question by sirfergall, Jan 6, 2016 5:09 PM

CoveoPager Boomerang-ing Users Back to Page 1

I've noticed some strange behavior with the coveo pager. The maximum returned results set in the admin console is 150 and we are returning 10 results per page in our results page.

When the number of results returned by a query is less than the maximum returned results value, e.g. 12, the pager shows as expected:

[1][2][>]

But when the number of results returned by a query is greater than the maximum returned results value, e.g. 460, the pager gives users the ability to select pages they shouldn't necessarily be able to. In this scenario, if a user selects page 15 the pager looks like:

[<][10][11][12][13][14][15][16][17][18][19][>]

Upon clicking a value above 15, since only 150 results are returned with 10 results per page, there aren't any results to show and the user is sent back to page 1. Is this the desired behavior?

Ideally, if a user were to make it to page 15, I'd expect the pager to not give the option to select pages greater than 15 and not give users the option to use the next button:

[<][10][11][12][13][14][15]

Thoughts?

1 Reply
Gravatar for mlaporte@coveo.com

Answer by Martin Laporte, Jan 7, 2016 3:31 AM

There is a new option on the Pager component that you can use to specify the maximum number of pages displayed. More info here: https://developers.coveo.com/display/JsSearchV1/Pager+Component

Beware that if using Coveo for Sitecore it's possible that the bundled version doesn't yet have this option available though.

Gravatar for ebnoble32@charter.net

Comment by sirfergall, Jan 8, 2016 9:09 AM

Hmm. We are using Coveo for Sitecore and the October release is a bit farther down the line than the release we're using. Any suggestions on how we could simulate the behavior of this? What immediately comes to mind is a bit of scripting to check the page selection buttons available in the pager against the value of the maximum returned results and hide those buttons that will cause the "boomerang-ing effect". Is there a means to programatically grab the maximum returned results value set in the admin console as well as the number of results returned per page via the API? Or, even better, is there a more elegant way?

Gravatar for mlaporte@coveo.com

Comment by Martin Laporte, Jan 10, 2016 7:09 PM

If you really require the fix now the best way is to open a case with support; then we might be able to provide a hotfix for your build that has the problem fixed.

Ask a question