Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-32825

Page Provider does not include Aggregate Selection in Search

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2023.12
    • Fix Version/s: 2025.x, 2023.18
    • Environment:
      Production Environment in Nuxeo Cloud. Standard setup with Opensearch and MongoDB.
    • Release Notes Summary:
      Fixed bulk action on search results with aggregate selection.
    • Backlog priority:
      750
    • Browser:
    • Sprint:
      nxplatform #120
    • Story Points:
      5

      Description

      We encountered cases where a user executes a search based on aggregate selections and then runs a bulk action which executed on more documents than were returned on the search results page.

      This problem occurred when a user selects an aggregate value that is not contained in the aggregate buckets. This can happen when a user first uses a narrower selection where the aggregation buckets contain a bucket with a low count, then expands the search so that this aggregation bucket falls out of the bucket list, because values with a higher counts exist. The UI still keeps the old bucket value selected and includes it in the search, though. When then using 'Select All' on the search results and running a bulk action, the selected value is still correctly passed to the command executing the action via operation 
      Bulk.RunAction. However the query generated and passed to Elasticsearch does not contain the selected aggregate and therefore returns a larger result set.
       
      Here is the aggregate definition from the page provider (client info x-ed out):

      <aggregate id="XXXXX_datShot_agg" type="terms" parameter="XXXXX:datShot">
        <field schema="MarketingAssetSearch_pp" name="XXXXX_datShot_agg"/>
        <properties>
          <property name="order">count desc</property>
          <property name="size">20</property>
        </properties>
      </aggregate>
      

      I debugged the Java code and found that this line in the PageProviderHelper class filters out the aggregate, because it is not included in the buckets:
       
      https://github.com/nuxeo/nuxeo/blob/f56bd252d413ee525b75bd7c2e3dee01d1d13bb5/modules/platform/nuxeo-automation/nuxeo-automation-core/src/main/java/org/nuxeo/ecm/automation/core/util/PageProviderHelper.java#L361
       
      Can this line be removed so that the aggregate will be included even when the value is not included in a bucket list? Otherwise, the behavior between Web UI and Bulk Action execution will be inconsistent.
       
       

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: