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

DateRangeTermFilter does not work when a different date format is used

    Details

      Description

      7.0.x - Important Change Notes
      7.0.x backport of LPS-78857, LPS-79348, LPS-80931 together requires new version of Liferay Connector to Elasticsearch 6 (1.0.1+) and Liferay Solr 5 Search Engine (1.1.1+) apps to be installed.

      See also https://help.liferay.com/hc/en-us/articles/360022577331.

      The DateRangeTermFilter provides API to specify the date format of the lowerBound and upperBound dates. But, it does not actually work.

      Steps to Reproduce

      1. Navigate to the Control Panel → Server Administration
      2. Navigate to Script
        • Select Groovy as the Script Type
      3. Copy script from attached groovy script: DateRangeTermFilter.groovy
      4. Replace code in the script console with the copied code
      5. Click Execute

      Expected Results:
      The executed groovy script returns search results for both date formats

      Actual Results:
      The executed groovy script only returns search results for the default date format

      Sample Output - Actual Results

      /***** Running Script: DateRangeTermFilter *****/
      
      /*** DateRangeTermFilter: using Default Date Format - yyyyMMddHHmmss ***/
      Article Found: {ddmTemplateKey=[BASIC-WEB-CONTENT], entryClassPK=[36786], groupId=[20126], publishDate=[20180515183900]...}
      
      /*** DateRangeTermFilter: using Non-Default Date Format - MMddyyyyHHmmss ***/
      No Articles Found
      

      Additional Details - Groovy Script
      The script does the following:

      1. Create a unique Web Content with an expiration date
      2. Perform a search for the created WebContent using a DateRangeTermFilter with the default date format
        • Date Format: yyyyMMddHHmmss
        • Assert whether the created Web Content was returned and log result
      3. Perform a search for the created WebContent using a DateRangeTermFilter with a non-default date format
        • Date Format: MMddyyyyHHmmss
        • Assert whether the created Web Content was returned and log result

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 6 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP70
                  7.0.X
                  7.1.X
                  Master