Going Stellar

Home/CQL reference

CQL field

text in CQL (Confluence): syntax and examples

The text field is a master field that searches the title, the body and the labels of content in one go, like the search box in the Confluence UI. It only works with the contains operators. Use it when you know a word but not where it appears.

Syntax

text ~ "word"
text ~ "\"exact phrase\""
text !~ "word"

Arguments

ArgumentWhat it does
valueA word or phrase in double quotes. Add * for several characters or ? for one. Wrap a phrase in escaped inner quotes to keep the words together in order.

Works with

  • Operators: ~, !~
  • Functions: none
  • Not with: =, !=, IN, NOT IN, >, >=, <, <=

Examples

text ~ "checkout" AND type = page AND space = SD ORDER BY lastmodified DESC

Finds every page that mentions a feature, the one you edited last first.

Run on Confluence Cloud on .

text ~ "\"incident response\""

Finds pages where the two words appear next to each other, in that order.

Run on Confluence Cloud on .

text ~ "check*"

Catches variants such as checkout and checklist with one wildcard.

Run on Confluence Cloud on .

text ~ "release checklist" AND type = comment

Looks for review discussion on a topic, restricted to comments.

Run on Confluence Cloud on .

text !~ "checkout" AND type = page AND space = SD

Lists pages that never mention a topic, for example to see what a rename has not reached.

Run on Confluence Cloud on .

Pitfalls

  • Only ~ and !~ work. text = "checkout" and text != "checkout" fail with "Could not parse cql". text in ("a", "b") fails with "Operator 'in' is not supported for field 'text'. Supported operators are : ~, !~".
  • An empty value is a server error, not an empty result: text ~ "" returns HTTP 500 "java.lang.NullPointerException: query parameter is required." Check for empty input before building a query from user input.
  • A word is not found from the middle or from a split spelling. text ~ "*kout" and text ~ "check out" find nothing where text ~ "chec?out" finds the page. Attachments are not matched by file name: text ~ "roadmap" AND type = attachment finds nothing, while title ~ "roadmap*" AND type = attachment finds roadmap.svg.
  • Search words inside the quotes behave like search-box operators (checked on Confluence Cloud, November 2026). text ~ "checkout OR payment" widens the match, "checkout AND runbook" narrows it and "checkout -payment" excludes a word. Without them, "checkout payment" needs both words.

Questions and answers

Does text search attachment contents?

Searching a file name did not work in our checks. Search attachments with type = attachment and title ~ instead.

Sources

  1. CQL fields (Atlassian Developer, Confluence Cloud)
  2. Performing text searches using CQL (Atlassian Developer, Confluence Cloud)

Markdown version · All CQL pages