Get macro data from Confluence Data Center with Luke

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Learn how to retrieve macro data from Confluence using the Luke GUI.

Use Case

In cases in which you want to get information from Confluence regarding macros that are being used, it might not be optimal to use SQL queries, as the 'BODY' column of the 'BODYCONTENT' table is NOT indexed, so basically SQL will do full table scan and analysis each record to match macro text. Also, the 'CONTENT' and 'BODYCONTENT' are two of the largest tables in the Confluence system.

Solution

Use Luke to search and view Data from GUI

Confluence parses, indexes, and stores a page's macro information in Lucene, which means it will be much faster to get the macro data from Lucene instead of the database.

Confluence 8.5.12 uses Lucene 4.4.0, so we can use Luke GUI (4.9.0) to open the index, search, and filter index data with desired conditions.

  1. Download Luke 4.9.0.

  2. Run the downloaded luke-with-deps.jar with the following command:

    java -jar luke-with-deps.jar
  3. Open the index directory from your Confluence home.

  4. After the index is loaded, on the Overview tab, there are two sections:

    1. Left section: list all the indexed fields, from which we can also find 'macroName'.

    2. Right section: if you select one field from the left and click Show top terms, the right section will list the top terms of the selected field.

  5. Now, if you go to the Search tab, you can use a Lucene query to filter the indexed documentation (you can replace the macroName with your desired one).

  6. Select one row from the Results section and double-click it; this will open the record detail page.

With Luke, you can easily filter macro-related data, but it does not provide the functionality to export the search results.

Updated on June 13, 2025

Still need help?

The Atlassian Community is here for you.