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

Custom filter widget no longer works with DDM fields on Elasticsearch

    Details

      Description

      In LPS-103224 we implemented nested fields for DDM. This breaks the custom filter widget which can only support a single top level field to aggregate on. 

      Steps to Reproduce:

      1. [On DXP 7.1 FP20+ and DXP 7.2 FP8+:
        1. Go to System Settings → Dynamic Data Mapping → Dynamic Data Mapping Indexer
        2. Deactivate "Enable Legacy Dynamic Data Mapping Index Fields." check
        3. Execute a full reindex]
      2. Go to Documents and Media > Document Types
      3. Add a new Document Type with a text field that is "Indexable - Keyword"
      4. Add a document using the created type and fill in the name and text fields
      5. Go to the Search page and add a Custom Filter widget
      6. Go to the configuration of the  Custom Filter widget

      Expected Result

      There should be a way to configure a nested field to filter on. With this filter, we will be able to display or filter the document created in step 3.

      Actual Result

      The configuration only allows the name of a top level field to filter on. We aren't able to display or filter the document created in step 3.


      Implemented solution:

      We have added support to nested queries in QueryTypeEntriesHolder and ComplexQueryBuilderImpl classes.

      That allows adding a parent "nested" custom filter portlet with several child filter portlets.

      For example if in previous Liferay versions you was filtering:

      • Filter Query Type: Match
      • Filter Field: ddm__ keyword__ 40635__ Field14510226_en_US (name of the ddm structure field in elasticsearch)
      • Filter Value: value_to_filter

      ...now you will be able to do the same using the nested fields:

      1. First custom filter portlet: nested parent query
        • Filter Query Type: Nested (new query type added in this LPS)
        • Filter Field: ddmFieldArray => it will be used as the path of the nested query
        • Query Name: nested_query
        • Parent Query Name: (empty)
      2. Second custom filter portlet: first match child filter
        • Filter Query Type: Match
        • Filter Field: ddmFieldArray.ddmFieldName
        • Filter Value: ddm__ keyword__ 40635__ Field14510226_en_US (name of the ddm structure field in elasticsearch)
        • Query Name: (empty)
        • Parent Query Name: nested_query
      3. Third custom filter portlet: second match child filter
        • Filter Query Type: Match
        • Filter Field: ddmFieldArray.ddmFieldValueKeyword_en_US
        • Filter Value: value_to_filter
        • Query Name: (empty)
        • Parent Query Name: nested_query

      This functionality should be also documented in the official Custom Filter portlet documentation

       
      (Note: due some Jira auto-format limitation, I have added a extra blank space in the ddm__ keyword__ 40635__ Field14510226_en_US identifier, because without that blank space, Jira is turning them in italic text)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brian.lee Brian Lee
              Reporter:
              jorge.diaz Jorge Diaz
              Participants of an Issue:
              Recent user:
              Sophia Zhang
              Engineering Assignee:
              Bryan Engler
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                49 weeks, 3 days ago
                Development End Date:
                Development Start Date:

                  Packages

                  Version Package
                  7.2.10 DXP FP10
                  7.2.10.4 DXP SP4
                  7.2.X
                  7.3.10 DXP FP1
                  7.3.10.1 DXP SP1
                  7.3.6 CE GA7
                  7.3.X
                  7.4.13 DXP GA1
                  Master