Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-95582

During Web Content Search, the Web Contents's templates are being processed

    Details

      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

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 11 weeks, 5 days ago

                Packages

                Version Package
                7.1.10 DXP FP12
                7.1.X
                Master