Foren

Search portlet Customization

karthik N, geändert vor 12 Jahren.

Search portlet Customization

Regular Member Beiträge: 106 Beitrittsdatum: 01.07.11 Neueste Beiträge
Hi all,
Im customizing the Liferay search portlet, I have configured search portlet it displays only document library and web content results.
Now the document library and web content results shown separately. I need that results should be displayed as combined and ordered by ascending.

Any idea?


Thanks in advance.


Karthik
thumbnail
Dave Weitzel, geändert vor 12 Jahren.

RE: Search portlet Customization

Regular Member Beiträge: 208 Beitrittsdatum: 18.11.09 Neueste Beiträge
The display of search results is done in the html/portlet/search/search.jsp page
You will see an iteration of the portlet's used in the search
for (int i = 0; i < portlets.size(); i++) {
Portlet portlet = (Portlet)portlets.get(i);


within that iteration there is a searchcontainer declared and built and displayed, this is why the results are grouped by portlet type.

I suspect all you need to do is declare one search container outside of the iteration, then build the list of entries inside that one search container and apply relevant sort criteria. You will need to ensure items such as the totalRows are correctly calculated and set outside of the iteration as well.

Dave