Charlie McCormack
16th November, 2023
Top 10 CQL queries for Confluence search
Learn to navigate one of Mother Nature's harshest habitats: the Confluence Jungle. Cut through the undergrowth with these 10 CQL queries.
The Knowledge Jungles of Confluence are one of Mother Nature's harshest, but richest, habitats. Child pages compete for sunlight, racing to the tops of the canopy as the weak get neglected in the darkness. Content that has gone untouched for 2-3 (working) centuries lies in wait for prey.
Yet this is where some of Earth's most intelligent creatures make their home. Here, we see the rare ‘Priscilla’ from HR. The Priscilla has no chance of surviving the Confluence jungle without her admin. Armed with the standard Confluence search bar, the tool that ought to cut through the thicket, she finds herself unable to forge a path to the information glen she seeks.
Instead, she approaches the desk of her Confluence admin. Yes, your desk, with her gaze lowered in defeat. What the Priscilla wants is elusive, and you're going to have to go deep into the Confluence jungle…
Forge ahead with our top 10 CQL queries
But you're not afraid, and the Priscilla needn't be either. You don't need to be the Bear Grylls of Confluence search to survive and thrive in this environment and we can prove it. With these top ten CQL queries, we'll have you on your way before you even have to start considering 'alternate hydration methods'.
1: Search for a page titled “brand” within a space “MAR”, specifying that the page was created in the past year:
space = "MAR" AND title ~ "brand" AND created >= now("-1y")
2: Search for your comments:
type = comment AND creator = currentUser()
3: Search for a keyword within the content of an attachment.
type = attachment AND text ~ "poisonousfrogs"
4: Search for a keyword within direct child pages.
parent = "page-ID" AND text ~ "values"
5: Search for a blog post with a particular label.
type = blogpost AND label = launch
It’s like closing your eyes and listening for a very specific birdcall.
6: Find a page that contains a Confluence macro.
type = page AND macro = jira
7: Search for content where the creator or contributor is either D.Attenborough or S.Backshall.
creator IN (dattenborough, sbackshall) OR contributor IN (dattenborough,sbackshall)
8: Find pages you created since the start of the current year.
type = page AND creator = currentUser() AND created >= startOfYear()
9: Search for content containing multiple keywords.
text ~ "resources library"
10: Find pages that mention you, and you are not the author. Order by most recent.
mention = currentUser() AND creator != currentUser() ORDER BY created DESC
Power up your Confluence Search
By arming yourself with these powerful CQL queries, you won't need to rely on the standard search bar alone. You'll be fully equipped to slash through the data thicket and dive headfirst into the jungle with newfound efficiency.
You can easily search with CQL using Enhanced Search, a feature of ScriptRunner for Confluence Data Center, available for a 30-day free trial on Atlassian Marketplace.
Try it free today
Got a Confluence jungle that you need to navigate?