Uploaded image for project: 'Search and Discovery'
  1. Search and Discovery
  2. SEARCH-2126

In sharded mode, the facets with 0 results are supressed in the response unlike standalone mode

    Details

    • Bug Priority:
      Category 1
    • Sprint:
      Team Ninja-King - S&I 40, Team Ninja-King - S&I 41, Team Ninja-King - S&I 42
    • Delivery Team:
      Search
    • Story Points:
      13
    • Release Train:
      Southall

      Description

      Setup 1: ACS latest + SS / IE (latest) in standalone mode

      Setup 2: ACS latest + SS / IE (latest) in sharded mode

      To reproduce the error:
      Run the e2e-test > FacetedSearchTest > searchWithQueryFaceting()

      Or create a plain text file cars.txt and run the following search query on Setup 1 and Setup 2:
      URL: POST http://localhost:8081/alfresco/api/-default-/public/search/versions/1/search

      {
        "facetFields" : {
          "facets" : [ {
            "field" : "'content.size'"
          } ]
        },
        "facetQueries" : [ {
          "query" : "content.size:[0 TO 102400]",
          "label" : "small"
        }, {
          "query" : "content.size:[102400 TO 1048576]",
          "label" : "medium"
        }, {
          "query" : "content.size:[1048576 TO 16777216]",
          "label" : "large"
        } ],
        "includeRequest" : true,
        "query" : {
          "query" : "cars"
        }
      }

      Expected Result:
      The response should be consistent in standalone / sharded mode. Buckets with 0 count should be supressed in the response consistently if that's the desired behaviour.

      Error:
      In a sharded mode, the following 2 facet buckets are supressed / not included in the response. These are returned in a standalone mode.

            {
                  "count": 0,
                  "label": "large",
                  "filterQuery": "content.size:[1048576 TO 16777216]"
               },
               {
                  "count": 0,
                  "label": "medium",
                  "filterQuery": "content.size:[102400 TO 1048576]"
               }
      

      In a Standalone mode, the query returns:

      {"list": {
         "entries": [{"entry": {
            "isFile": true,
            "createdByUser": {
               "displayName": "UserSearch-SultHsImViqYTyN FirstName LN-UserSearch-SultHsImViqYTyN",
               "id": "UserSearch-SultHsImViqYTyN"
            },
            "modifiedAt": "2020-02-24T03:31:14.075+0000",
            "nodeType": "cm:content",
            "content": {
               "sizeInBytes": 44,
               "mimeTypeName": "Plain Text",
               "mimeType": "text/plain",
               "encoding": "ISO-8859-1"
            },
            "parentId": "1ed385e5-76be-43f8-ae6a-cd366b9a0c5a",
            "createdAt": "2020-02-24T03:31:14.024+0000",
            "isFolder": false,
            "search": {"score": 1},
            "modifiedByUser": {
               "displayName": "UserSearch-SultHsImViqYTyN FirstName LN-UserSearch-SultHsImViqYTyN",
               "id": "UserSearch-SultHsImViqYTyN"
            },
            "name": "cars.txt",
            "location": "nodes",
            "id": "2bbe2a70-ff6b-4708-ba99-e464008b9768"
         }}],
         "pagination": {
            "maxItems": 100,
            "hasMoreItems": false,
            "totalItems": 1,
            "count": 1,
            "skipCount": 0
         },
         "context": {
            "request": {
               "query": {"query": "cars"},
               "facetFields": {"facets": [{
                  "field": "'content.size'",
                  "offset": 0,
                  "mincount": 1,
                  "missing": false,
                  "facetEnumCacheMinDf": 0
               }]},
               "facetQueries": [
                  {
                     "query": "content.size:[0 TO 102400]",
                     "label": "small"
                  },
                  {
                     "query": "content.size:[102400 TO 1048576]",
                     "label": "medium"
                  },
                  {
                     "query": "content.size:[1048576 TO 16777216]",
                     "label": "large"
                  }
               ]
            },
            "consistency": {"lastTxId": 228},
            "facetQueries": [
               {
                  "count": 1,
                  "label": "small",
                  "filterQuery": "content.size:[0 TO 102400]"
               },
               {
                  "count": 0,
                  "label": "large",
                  "filterQuery": "content.size:[1048576 TO 16777216]"
               },
               {
                  "count": 0,
                  "label": "medium",
                  "filterQuery": "content.size:[102400 TO 1048576]"
               }
            ]
         }
      }}

      In Sharded mode, the query returns:

      {"list": {
         "entries": [{"entry": {
            "isFile": true,
            "createdByUser": {
               "displayName": "UserSearch-rxSvjgMoxLbtRST FirstName LN-UserSearch-rxSvjgMoxLbtRST",
               "id": "UserSearch-rxSvjgMoxLbtRST"
            },
            "modifiedAt": "2020-02-21T03:29:22.483+0000",
            "nodeType": "cm:content",
            "content": {
               "sizeInBytes": 44,
               "mimeTypeName": "Plain Text",
               "mimeType": "text/plain",
               "encoding": "ISO-8859-1"
            },
            "parentId": "7f5a403d-2f80-47f0-a346-7beb972940f5",
            "createdAt": "2020-02-21T03:29:22.432+0000",
            "isFolder": false,
            "search": {"score": 1},
            "modifiedByUser": {
               "displayName": "UserSearch-rxSvjgMoxLbtRST FirstName LN-UserSearch-rxSvjgMoxLbtRST",
               "id": "UserSearch-rxSvjgMoxLbtRST"
            },
            "name": "cars.txt",
            "location": "nodes",
            "id": "da614162-f2e5-4245-b33f-087413e59433"
         }}],
         "pagination": {
            "maxItems": 100,
            "hasMoreItems": false,
            "totalItems": 1,
            "count": 1,
            "skipCount": 0
         },
         "context": {
            "request": {
               "query": {"query": "cars"},
               "facetFields": {"facets": [{
                  "field": "'content.size'",
                  "offset": 0,
                  "mincount": 1,
                  "missing": false,
                  "facetEnumCacheMinDf": 0
               }]},
               "facetQueries": [
                  {
                     "query": "content.size:[0 TO 102400]",
                     "label": "small"
                  },
                  {
                     "query": "content.size:[102400 TO 1048576]",
                     "label": "medium"
                  },
                  {
                     "query": "content.size:[1048576 TO 16777216]",
                     "label": "large"
                  }
               ]
            },
            "consistency": {"lastTxId": 227},
            "facetQueries": [{
               "count": 1,
               "label": "small",
               "filterQuery": "content.size:[0 TO 102400]"
            }]
         }
      }}
      

      Acceptance criteria:

      • The results should not return zero (the results should be consistent between standalone and sharded)
      • Setting minCount (facet fields) to 0 will force it to 1.
      • Update API documentation if required with this behaviour. Security implications of returning sensible data.
      • Add e2e test for sharded environment

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  mbhave Meenal Bhave [X] (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Structure Helper Panel