Since subsequent requests differ only in the requested page of results, it is most efficient just to retrieve the most recent search request, change the value of the goToPage
property, and resubmit the request. There are two ways to do this:
Modify properties on the form, and resubmit it. This avoids the memory use required to save the request in the
SearchSession
. The downside is that resubmitting the form is difficult if you are creating your links through anchor tags. In that case, it is generally easiest to write a JavaScript function that makes the necessary changes and submits the form.Save the request in the
SearchSession
. This allows you to retrieve the request, modify it, and reissue it; no JavaScript is necessary. The downside is that this approach can use a lot of memory, especially if there are many users at your site issuing search queries.
Note that resubmitting a modified request is useful for faceted search as well as for paging.