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

BooleanFilter toString produces incorrect string

    Details

      Description

      1. Start portal and go to the Script console in the Server Admin
      2. Execute the following Groovy-script:
        import com.liferay.portal.kernel.search.filter.BooleanFilter;
        
        BooleanFilter queryBooleanFilter = new BooleanFilter();
        
        queryBooleanFilter.addRequiredTerm("field", "value");
        
        out.println(queryBooleanFilter)
        

      Expected Result:

      {MUST({MUST({(field=value), (cached=null, executionOption=null)})}, ), MUST_NOT(), SHOULD(), (cached=null, executionOption=null)}
      

      Actual Results

      {MUST({MUST({(field=value), (cached=null, executionOption=null)})}, ), MUST_NOT({MUST({(field=value), (cached=null, executionOption=null)})}, ), SHOULD({MUST({(field=value), (cached=null, executionOption=null)})}, ), (cached=null, executionOption=null)}
      

      The sample code demonstrates that we set a "required term" which qualifies as a MUST clause, though it's also re-used when generating the output string for the MUST_NOT and SHOULD clauses too.

        Attachments

          Activity

            People

            • Assignee:
              joshua.chong Joshua Chong
              Reporter:
              tibor.lipusz Tibor Lipusz
              Participants of an Issue:
              Recent user:
              Csaba Turcsan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

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

                Packages

                Version Package
                7.0.0 DXP FP68
                7.0.X
                7.1.10 DXP FP5
                7.1.10.1 SP1
                7.1.2 CE GA3
                7.1.X
                Master