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

Web content search service by kewords and structureid fail (via DB query)

    Details

      Description

      Method

      public List<JournalArticle> filterFindByKeywords(
      long companyId, long groupId, List<Long> folderIds,
      long classNameId, String keywords, Double version, String type,
      String ddmStructureKey, String ddmTemplateKey, Date displayDateGT,
      Date displayDateLT, int status, Date reviewDate, int start, int end,
      OrderByComparator orderByComparator) throws SystemException {

      of com.liferay.portlet.journal.service.persistence.JournalArticleFinderImpl

      doesn't work.

      If keywords value is not null the "andOperator" remain false with the side effect that the result query have the last OR condition which retrieve all web content.

      Otherwise if keywords value is null the query works fine.

      Example of the result query:

      SELECT JournalArticle.*
      FROM JournalArticle LEFT JOIN JournalArticle tempJournalArticle ON (JournalArticle.groupId = tempJournalArticle.groupId) AND (JournalArticle.articleId = tempJournalArticle.articleId) AND (JournalArticle.version < tempJournalArticle.version)
      WHERE (JournalArticle.companyId = 10153)
      AND (JournalArticle.groupId = 10179)
      AND (JournalArticle.classNameId = 0)
      AND (JournalArticle.status != 8)
      AND ( (JournalArticle.articleId LIKE '%test%' AND '%test%' IS NOT NULL)
      OR (lower(JournalArticle.title) LIKE '%test%' AND '%test%' IS NOT NULL)
      OR (JournalArticle.description LIKE '%test%' AND '%test%' IS NOT NULL)
      OR (JournalArticle.content LIKE '%test%' AND '%test%' IS NOT NULL)
      OR (JournalArticle.displayDate >= null AND null IS NOT NULL)
      OR (JournalArticle.displayDate <= null AND null IS NOT NULL)
      OR (JournalArticle.reviewDate <= null AND null IS NOT NULL) )
      AND (JournalArticle.structureId LIKE '%REFERENZA%' AND '%REFERENZA%' IS NOT NULL)
      OR (tempJournalArticle.id_ IS NULL)
      ORDER BY modifiedDate DESC

        Attachments

          Activity

            People

            Assignee:
            michael.saechang Michael Saechang
            Reporter:
            algoritma Fabio De Pra (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              7 years, 2 weeks, 2 days ago

                Packages

                Version Package