Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
7.1.X, Master
-
7.1.x
-
Committed
-
0.5
-
3
Description
Description:
During displaying the search hits, in this case web content, the content's title and description or content is being displayed.
During collecting the title and description, a JournalArticleDisplay is created here:
https://github.com/liferay/liferay-portal/blob/master/modules/apps/journal/journal-service/src/main/java/com/liferay/journal/internal/search/JournalArticleIndexer.java#L844
During the JournalArticleDisplay creation, the web content templates are being processed.
With a simple template, the user doesn't experience any performance issue, but if we use a "heavy" template, then displaying the search results will be very slow. For that I added a long cycle.
Reproduction steps:
1) Create a structure with a text field
2) Create a template for it, it should contain:
<#assign x=7000000> <#list 1..x as i> ${i} </#list>
3) Uncheck the Cacheable in the template, (this is necessary to reproduce the issue)
4) Create 3 web contents based on this structure and template, all of them should contain the same word in the description or text field, for example: "summary". Set the Default Template and fill the Summary field as well for each web content.
5) Put a Search portlet to a page
6) Search for the word: "summary"
Result:
Finding the 3 web contents took 25 seconds, as the Template is being processed for 3 times
Notes:
Reproduced on master: 56307b2bef62742af6c13ea1bea4acd9cc26c505