Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-20822

AGS/RM breaks the 'hasMoreItems' REST API search

    Details

      Description

      Summary

      With RM/AGS installed on ACS, the REST API response always responds with 'hasMoreItems'=true, even if there is no more. This is irrelevant on which search configuration is in use (SOLR4, SOLR6, database only).

      Customer is on v5.2.N ACS, therefore target is RM 2.N

      Replication Steps

      Versions Tested:

      • ACS 5.2.1, RM 2.6.0, SOLR4/ASS 1.1.1.1
      • ACS 5.2.5, RM 2.7.1/RM2.7.2, ASS 1.2.1
      • ACS 6.0.1.N, RM 3.0.N, ASS 1.3.N

      Install ACS without RM deployed.
      Install ACS with RM deployed.

      • Upload enough files to be able to test the paging 'maxItems' and 'SkipCount' configurations, for example in this replication we uploaded 1200 files with names ending in '10.txt'
      • Use POSTMAN or other REST client
      • Test both with setting search services configuration to use 'Database Only' and 'Never use database' for CMIS Query and AFTS setting.

      RM/AGS Deployed Results:

      POST http://localhost:8282/alfresco/api/-default-/public/search/versions/1/search
      
      {
        "query": {
          "language": "cmis",
          "query": "select * from cmis:document WHERE cmis:name LIKE '%10.txt'"
        },
        "paging": {
          "maxItems": 2,
          "skipCount": 1200
        },
        "fields": ["id", "name"]
      }
      

      Response (Never Use DB):

      {
          "list": {
              "pagination": {
                  "count": 2,
                  "hasMoreItems": true,
                  "totalItems": 1206,
                  "skipCount": 1200,
                  "maxItems": 2
              },
              "context": {},
              "entries": [
                  {
                      "entry": {
                          "name": "gp99w10.txt",
                          "id": "8af92c45-e60f-4d1b-b55f-fa4e3f14660b"
                      }
                  },
                  {
                      "entry": {
                          "name": "gp33w10.txt",
                          "id": "d6b1e094-ae00-42b5-8d1f-58f032165a80"
                      }
                  }
              ]
          }
      }
      

      Change to query skip total:

      POST http://localhost:8282/alfresco/api/-default-/public/search/versions/1/search
      
      {
        "query": {
          "language": "cmis",
          "query": "select * from cmis:document WHERE cmis:name LIKE '%10.txt'"
        },
        "paging": {
          "maxItems": 2,
          "skipCount": 1300
        },
        "fields": ["id", "name"]
      }
      

      Response:

      {
          "list": {
              "pagination": {
                  "count": 0,
                  "hasMoreItems": true,
                  "skipCount": 1300,
                  "maxItems": 2
              },
              "entries": []
          }
      }
      
      

      Set search services to Never use Database, response:

      {
          "list": {
              "pagination": {
                  "count": 0,
                  "hasMoreItems": true,
                  "totalItems": 1206,
                  "skipCount": 1300,
                  "maxItems": 2
              },
              "context": {},
              "entries": []
          }
      }
      
      

      Without RM/AGS deployed:

      {
        "query": {
          "language": "cmis",
          "query": "select * from cmis:document WHERE cmis:name LIKE '%10.txt'"
        },
        "paging": {
          "maxItems": 2,
          "skipCount":1300
        },
        "fields": ["id", "name"]
      }
      

      Response:

      {
          "list": {
              "pagination": {
                  "count": 0,
                  "hasMoreItems": false,
                  "totalItems": 964,
                  "skipCount": 1300,
                  "maxItems": 2
              },
              "context": {},
              "entries": []
          }
      }
      

      Note: all scenarios where tested on the different versions, the above are sample queries. AFTS, CMIS both/only/never database configs settings on search service tested.

      Expected Behavior

      • Whether RM/AGS is deployed or not, regardless of search index config(any solr version), database or never using database, cmis or afts search, if there are 'no more items' the response value for 'hasMoreItems' should be false

      Actual Behavior

      • When RM/AGS is deployed, regardless of search index config(any solr version), database or never using database, cmis or afts search, the 'hasMoreItems' is always true even if there are no more items

      The correct value occurs if RM/AGS is not deployed.

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  jsoria Jennie Soria [X] (Inactive)
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  14 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Structure Helper Panel