Stand with Ukraine 🇺🇦

Find Any Text Across All Your Content

Search for Text Across All Content - Perform text searches within pages, blog posts, and attachments - Preview 2
Search for Text Across All Content - Perform text searches within pages, blog posts, and attachments - Preview 3
confluence-content

The macro sets parameters for the search term, result limit, and sorting order. It constructs a CQL query to find relevant content and executes it against the Confluence API. The results are displayed as a list.

Try for free

Template

#set($searchTerm = $parameters.searchTerm)
#set($limit = 50)
#set($sortOrder = "created desc")

## Define CQL query
#set($cqlQuery = "type in (page, blogpost, attachment) AND text ~ '\'$searchTerm\'' order by $sortOrder")


## Execute the query with expanded version data
#set($response = $ConfluenceManager.get("/wiki/rest/api/content/search?cql=$cqlQuery&limit=$limit&expand=space,version"))

<ul>
    <p style="margin-bottom: 10px;">
        Search results for <strong>$searchTerm:</strong>
    </p>
    #if($response.results.size() > 0)
    #foreach($content in $response.results)
    <li style="list-style-type: top; margin-left: 30px;">
        <span class="aui-lozenge aui-lozenge-subtle aui-lozenge-success">$content.type</span>
        <a href="${response._links.base}$content._links.webui" target="_blank">$content.title</a>
        in $content.space.name space
    </li>
    #end
    #else
    <li>No results found for "$searchTerm"</li>
    #end
</ul>

User Parameters

Search Term

Enter a search term

Chosen by Top Global Companies Across Diverse Industries

BNP Paribas
Census
CNES
EDP
HHMI
HP
Hyundai
Index
Intercars
Melia
BNP Paribas
Census
CNES
EDP
HHMI
HP
Hyundai
Index
Intercars
Melia
Ministry
NVIDIA
PayPay
Pfizer
Qualcomm
Rail Canada
Red Cross
SEC
Space Institute
Telefonica
Ministry
NVIDIA
PayPay
Pfizer
Qualcomm
Rail Canada
Red Cross
SEC
Space Institute
Telefonica

Got Questions?

Fill out the form, and we'll guide you through every step of the way