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

JournalArticle search/searchCount queries retrieve different results

    Details

      Description

      Steps to Reproduce:

      1. Create a web content first version.
      2. Update the web content and for the second version add a couple of title translations.
      3. Execute the following Groovy script (replacing groupId and companyId with your JournalArticle groupId and companyId table fields):

       

      import com.liferay.journal.service.JournalArticleLocalServiceUtil;
      import java.util.Collections;
      import com.liferay.journal.constants.JournalArticleConstants;
      import com.liferay.journal.model.JournalArticle;
      import com.liferay.portal.kernel.dao.orm.QueryUtil;
      import com.liferay.portal.kernel.workflow.WorkflowConstants;
      
      long groupId = 20123L;
      long companyId = 20099L;
      
      int count = JournalArticleLocalServiceUtil.searchCount(
          companyId, groupId, Collections.emptyList(), JournalArticleConstants.CLASSNAME_ID_DEFAULT,
          null, null, null, null, null, "BASIC-WEB-CONTENT", null,
          null, null, WorkflowConstants.STATUS_APPROVED, null, true);
      
      out.println("SearchCount count: " + count);
      
      List<JournalArticle> journalArticles = JournalArticleLocalServiceUtil.search(
          companyId, groupId, Collections.emptyList(), JournalArticleConstants.CLASSNAME_ID_DEFAULT,
          null, null, null, null, null, "BASIC-WEB-CONTENT", null, 
          null, null, WorkflowConstants.STATUS_APPROVED, null, true, 
          QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
      
       out.println("Search count: " + journalArticles.size());
      

       

      Actual Results:
      Count printed differs between both queries.

       

      Expected Results:
      Printed count should be the same.

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            mariano.alvaro Mariano Álvaro
            Participants of an Issue:
            Recent user:
            Yunlin "Steven" Sun
            Engineering Assignee:
            Mariano Álvaro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              10 weeks, 1 day ago

                Packages

                Version Package