Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-71939

CQL search for custom content fails when using containment relationships

    XMLWordPrintable

    Details

      Description

      Issue Summary

      Connect Apps can create custom content, which can implement their own containment model. In addition, custom content can opt into search indexing. When all of these are enabled, CQL should respect the containment fields in CQL: ancestor, container, and parent.

      Steps to Reproduce

      Given a connect descriptor with this custom content section:

      ...
          "customContent": [
            {
              "key": "question",
              "bodyType": "storage",
              "name": {
                "value": "Questions "
              },
              "apiSupport": {
                "supportedContainerTypes": [
                  "space"
                ],
                "supportedSpacePermissions": [
                  "read",
                  "create",
                  "delete"
                ],
                "supportedChildTypes": [
                  "ac:questions-answers-for-confluence:answer",
                  "ac:questions-answers-for-confluence:reaction",
                  "comment",
                  "attachment"
                ],
                "indexing": {
                  "enabled": true
                }
              },
              "uiSupport": {
                "listViewComponent": {
                  "moduleKey": "questionsView"
                },
                "contentViewComponent": {
                  "moduleKey": "questionsView"
                },
                "icons": {
                  "item": {
                    "url": "/images/questions-black.svg"
                  }
                }
              }
            },
            {
              "key": "answer",
              "name": {
                "value": "Answers"
              },
              "apiSupport": {
                "supportedContainerTypes": [
                  "ac:questions-answers-for-confluence:question"
                ],
                "supportedChildTypes": [
                  "ac:questions-answers-for-confluence:reaction",
                  "comment",
                  "attachment"
                ],
                "indexing": {
                  "enabled": true
                }
              },
              "uiSupport": {
                "contentViewComponent": {
                  "moduleKey": "questionsView"
                },
                "listViewComponent": {
                  "moduleKey": "questionsView"
                },
                "icons": {
                  "item": {
                    "url": "/images/questions-black.svg"
                  }
                }
              }
            },
            {
              "key": "reaction",
              "name": {
                "value": "Votes"
              },
              "apiSupport": {
                "supportedContainerTypes": [
                  "ac:questions-answers-for-confluence:question",
                  "ac:questions-answers-for-confluence:answer"
                ],
                "supportedSpacePermissions": [
                  "read",
                  "create",
                  "delete"
                ],
                "indexing": {
                  "enabled": true
                }
              },
              "uiSupport": {
                "contentViewComponent": {
                  "moduleKey": "questionsView"
                },
                "listViewComponent": {
                  "moduleKey": "questionsView"
                },
                "icons": {
                  "item": {
                    "url": "/images/questions-black.svg"
                  }
                }
              }
            },
      ...
      

      Then the App has the following hierarchies of custom content:
      Question → has Answers → has Reactions and Question → has Reactions.

      In the data, we have:

      • Question with ID = 633405478 being parent of two answers, one of them with Id = 635601068
      • Answer with ID = 635601068 is a parent of 3 reactions with Ids = 1226571928, 635601089 and 633405653

      What I want to search for is getting all reactions whose parent/container is answer with Id = 635601068. Given that, following CQL searches are not working as expected:

      • type='ac:questions-answers-for-confluence:reaction' and container = 635601068: returns no results, should return 3 results with reactions above
      • type='ac:questions-answers-for-confluence:reaction' and ancestor = 635601068: returns no results, should return 3 results with reactions above
      • type='ac:questions-answers-for-confluence:reaction' and ancestor = 633405478: returns no results, should return at least 3 results with reactions above (I’m not interested in this kind of search because it’s too broad as I want to return only reactions with answer 635601068 as direct parent, but this search doesn’t work as expected as well)

      Similar CQL search that does work (but doesn't help with my issue) is searching for answers based on question ID as container

      • type='ac:questions-answers-for-confluence:answer' and container = 633405478: correctly returns 2 child answers

      Expected Results

      All 3 CQL searches should return 3 results, according to the definitions of the CQL search fields.

      Actual Results

      All 3 CQL searches return no results.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nmcginley nmcginley
              Reporter:
              ibuchanan devpartisan
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: