Q:

Liferay Search Container pagination

I have used liferay-ui:search-container in my code. 
the search results are being displayed properly till i click on the NEXT. The portlet is being reloaded and that is taking me to the first page of the portlet, trashing the presented search results.
How do I retain the search results even after the portlet gets reloaded?

A:

You can give a value to the iteratorURL attribute if its default behaviour doesn't fit your needs. 
In the following example when you click 'Next' on the search result table the proccesAction() method of the portlet will be invoked with param1 and param2. 
You can add logic to that method to retain your search results.
<%
PortletURL urlPaginator=renderResponse.createActionURL();
urlPaginator.setParameter("param1", value1);
urlPaginator.setParameter("param2",value2);
%>

<liferay-ui:search-container iteratorURL="<%=urlPaginator%>">

