Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-24568

Confluence search is broken for data within content elements, such as URLs in links, parameters in macros, image names on pages

      In Confluence 3.5.x and earlier, it was possible to search a space or site for macro parameters, URLs in links, and other markup elements, because they were part of the wiki markup and thus part of the page content. This is no longer possible in Confluence 4.

      Root cause: Metadata (parameters) for content elements is hidden from the global search.

      Problem specification:

      • While it is possible to search for macro names using the macroName search field, this functionality is obscure, and the usage of that field is tricky. See "How to search Confluence for usage of a macro": http://ffeathers.wordpress.com/2011/11/04/how-to-search-confluence-for-usage-of-a-macro/
      • It is not possible to search for macro parameters.
        • This means, for example, that you cannot discover where a particular excerpt or page is included into another page (CONF-23775). Scenario: I want to remove a page or update its content, but I need to find out first where it is included into another page.
        • Another scenario: I have changed a page name, and now I need to fix all the macros that refer to that page. Note that Confluence will fix links, but not the page names inside macros. Examples of macros that need fixing: children, excerpt, excerpt-include, anchor, pagetree, pagetreesearch, plus any number of user macros and macros added by plugins.
      • It is not possible to search for URLs used in links (CONF-24079). Scenario: Our website has moved to a different server and we want to fix all the links in the documentation that point to our website.
      • It is not possible to find all the pages that use a given image (or other attachment). You can search for attachments by filename using the filename field, but you can't search for their usage. For example, I can find out where "myImage.png" is attached to a page, but I cannot find all the pages that display "myImage.png". Scenario: I want to remove/update a screenshot, but first I need to know where it's used. Note that this problem is made even more urgent by the fact that the Confluence editor now links to the original source of an image, if you copy content from one page to another by copying and pasting.

      Please refer to the following comments on our customer feedback pages:

      Note: This issue is about the Confluence search function, not the search within the editor. For similar issues related to search within the editor, please see CONF-23560, CONF-23561, CONF-23667.

        1. screenshot-1.jpg
          81 kB
          Shannon Greywalker

            [CONFSERVER-24568] Confluence search is broken for data within content elements, such as URLs in links, parameters in macros, image names on pages

            Now that the plugin mentioned above has been discontinued, is there another way to search for macro content?

            Should we reopen this issue, since it seems it's not solved in Confluence 6?

            Jochen Suckfüll added a comment - Now that the plugin mentioned above has been discontinued, is there another way to search for macro content? Should we reopen this issue, since it seems it's not solved in Confluence 6?

            Hi,

            Can I ask what the implications of this work are? Does this mean that I can now search for macro parameters? How do I specify this? I can't seem to find any documentation on this.

            Steve

            Steve Goldberg added a comment - Hi, Can I ask what the implications of this work are? Does this mean that I can now search for macro parameters? How do I specify this? I can't seem to find any documentation on this. Steve

            Regarding the use case of finding which pages make use of an attached image.

            You can get help with this by looking at Page Information on the page hosting the image. The 'Incoming Links' section includes pages that refer to attachments of the page.

            Essentially, anything that refers to this page via ResourceIdentifiers will appear in that 'Incoming Links' section. So once macros include ResourceIdentifiers this section will also show the pages with macros that refer to the subject page.

            (It is probably a useful enhancement to subdivide the 'Incoming Links' into the type of reference. This isn't a trivial improvement to make though.)

            Paul Curren added a comment - Regarding the use case of finding which pages make use of an attached image. You can get help with this by looking at Page Information on the page hosting the image. The 'Incoming Links' section includes pages that refer to attachments of the page. Essentially, anything that refers to this page via ResourceIdentifiers will appear in that 'Incoming Links' section. So once macros include ResourceIdentifiers this section will also show the pages with macros that refer to the subject page. (It is probably a useful enhancement to subdivide the 'Incoming Links' into the type of reference. This isn't a trivial improvement to make though.)

            BillA added a comment -

            This issue is largely caused by the fact that page links in macro parameters don't get refactored when a page is renamed. (see CONF-3649).

            BillA added a comment - This issue is largely caused by the fact that page links in macro parameters don't get refactored when a page is renamed. (see CONF-3649 ).

            SarahA added a comment -

            Hallo to the Confluence team

            Thanks for the plugin. It's great! I do have a question: Are there any plans to make this functionality a part of the Confluence app (instead of as a plugin)?

            SarahA added a comment - Hallo to the Confluence team Thanks for the plugin. It's great! I do have a question: Are there any plans to make this functionality a part of the Confluence app (instead of as a plugin)?

            SarahA added a comment -

            A plugin is now available that solves part of the problem. The "Confluence Macro Indexer" plugin extends the Confluence search, so that you can search for macro parameters and their values:
            https://marketplace.atlassian.com/plugins/com.atlassian.confluence.plugins.confluence-macro-indexer-plugin

            SarahA added a comment - A plugin is now available that solves part of the problem. The "Confluence Macro Indexer" plugin extends the Confluence search, so that you can search for macro parameters and their values: https://marketplace.atlassian.com/plugins/com.atlassian.confluence.plugins.confluence-macro-indexer-plugin

            lingbo (Inactive) added a comment - - edited

            A use case:

            I want to search for all links that contain 'JIRA000' in them in the Atlassian OnDemand space (http://confluence.atlassian.com/display/AOD/Atlassian+OnDemand+Documentation+Home) and change them to refer to 'JIRA'. But I can't find a way to do it.

            As the writer, I know that links with 'JIRA000' in them in the AOD space can be absolute URLs and there are also those in the form of relative links. But the question is how I can dig them all out.

            lingbo (Inactive) added a comment - - edited A use case: I want to search for all links that contain 'JIRA000' in them in the Atlassian OnDemand space ( http://confluence.atlassian.com/display/AOD/Atlassian+OnDemand+Documentation+Home ) and change them to refer to 'JIRA'. But I can't find a way to do it. As the writer, I know that links with 'JIRA000' in them in the AOD space can be absolute URLs and there are also those in the form of relative links. But the question is how I can dig them all out.

            SarahA added a comment -

            Hallo Shannon

            You're right, I did miss that point. As far as I know, the

            {pagetreesearch}

            macro uses the standard Confluence search, so it should be OK. For example, I've just tested it with this search term:
            macroName: include*
            And it worked.

            Nevertheless, your point is worth stating as part of the requirements.

            SarahA added a comment - Hallo Shannon You're right, I did miss that point. As far as I know, the {pagetreesearch} macro uses the standard Confluence search, so it should be OK. For example, I've just tested it with this search term: macroName: include* And it worked. Nevertheless, your point is worth stating as part of the requirements.

            Shannon Greywalker added a comment - - edited

            Sarah, I think it's possible that you misconstrued the main thrust of my point #1 above. What I'm specifically asking for is that I be able to use either the global search control in the upper right of each page or the rendered search field for any

            {pagetreesearch} macros to search for strings in the underlying storage format. In other words, make sure that this search functionality is not limited only to the global search control. If I use the rendered field from any {pagetreesearch}

            macro, then of course the search should be scoped/limited only to the macro's specified root page and its descendants.

            Shannon Greywalker added a comment - - edited Sarah, I think it's possible that you misconstrued the main thrust of my point #1 above. What I'm specifically asking for is that I be able to use either the global search control in the upper right of each page or the rendered search field for any {pagetreesearch} macros to search for strings in the underlying storage format. In other words, make sure that this search functionality is not limited only to the global search control. If I use the rendered field from any {pagetreesearch} macro, then of course the search should be scoped/limited only to the macro's specified root page and its descendants.

            SarahA added a comment -

            Thanks for your detailed feedback, Shannon. I've added the pagetree and pagetreesearch macros to the list.

            A quick note to everyone: The list of affected macros is intended as illustrative rather than definitive. It isn't possible to list all the affected macros, since new ones will continually appear. The solution should allow for a search across all macros.

            Shannon, I agree with the points in your comments. In particular, point 3 in your first comment is important. In the issue description, I've already included use cases such as URLs in links, and image names in page content, and the rather vague reference to "other markup elements". In discussion with various people, I've said that the problem is a general one, caused by the fact that the information is now hidden inside the XHTML markup elements rather than being part of page content, as it was in wiki markup. But I didn't put that clearly enough in the issue itself. Your comment puts it very nicely.

            SarahA added a comment - Thanks for your detailed feedback, Shannon. I've added the pagetree and pagetreesearch macros to the list. A quick note to everyone: The list of affected macros is intended as illustrative rather than definitive. It isn't possible to list all the affected macros, since new ones will continually appear. The solution should allow for a search across all macros. Shannon, I agree with the points in your comments. In particular, point 3 in your first comment is important. In the issue description, I've already included use cases such as URLs in links, and image names in page content, and the rather vague reference to "other markup elements". In discussion with various people, I've said that the problem is a general one, caused by the fact that the information is now hidden inside the XHTML markup elements rather than being part of page content, as it was in wiki markup. But I didn't put that clearly enough in the issue itself. Your comment puts it very nicely.

              gvotruong Giang Vo
              barconati BillA
              Affected customers:
              21 This affects my team
              Watchers:
              35 Start watching this issue

                Created:
                Updated:
                Resolved: