Search code examples
javahtmljspliferay

Liferay search-iterator only showing first 11 pages in page selector


I have a liferay search-container constaining thousands of results with a search-iterator attached. On the page selector dropdown it will only show the first 11 pages

First 11 pages

Clicking on a later page (I chose page 11) it expands to show the next 10 pages

Next set of pages

Selecting further pages only ever show 20 pages worth of page numbers (ie. selecting page 40 will show page numbers 30 through 50).

How do I change this to show all pages from 1 to 161?

I have tried changing the search-iterator type as well as adding a seperate search-paginator, niether of which fixed the issue.

I have also tried changing the search delta, which doesn't have any effect on the page selector.

Here is the JSP code for creating the search-container:

<% rowChecker = new RowChecker(renderResponse); %>

<liferay-ui:search-container searchContainer="${itemsSearchContainer}" rowChecker="<%=rowChecker%>" total="${itemsSearchContainer.total}">
    <liferay-ui:search-container-results results="${itemsSearchContainer.results}"/>
    <liferay-ui:search-container-row modelVar="item" keyProperty="itemKey" className="ItemDetail">
        <%-- Hidden: liferay-ui:search-container-column-text columns --%>
    </liferay-ui:search-container-row>

    <liferay-ui:search-iterator />

</liferay-ui:search-container>

Solution

  • There is an property that configure the pages to see on that select so if you change that the number will grow of the page displayed

    Set the maximum number of pages available above and below the currently displayed page.
    
    Defaults:
    search.container.page.iterator.max.pages=10