Skip to main content
CQL (Confluence Query Language) is used by confluence_search to find content. You can also use simple text queries that automatically use siteSearch.

Basic Syntax

CQL queries follow the pattern: field operator value
type = page AND space = "DEV"

Common Operators

OperatorDescriptionExample
=Exact matchtype = "page"
!=Not equaltype != "comment"
~Contains texttitle ~ "meeting notes"
INMatch any in listspace IN ("DEV", "TEAM")
>, <, >=, <=Comparisoncreated >= "2024-01-01"

Common Fields

FieldDescriptionExample
typeContent typetype = "page" or type = "blogpost"
spaceSpace keyspace = "DEV"
titlePage titletitle ~ "architecture"
textFull text searchtext ~ "API documentation"
labelContent labellabel = "approved"
creatorCreated bycreator = "john.doe"
createdCreation datecreated >= "2024-01-01"
lastModifiedLast modifiedlastModified >= "2024-06-01"
ancestorParent page IDancestor = "12345678"
parentDirect parent IDparent = "12345678"

Search Types

CQL Query

Pass a CQL string directly:
type=page AND space=DEV AND title~"Meeting Notes"
Pass plain text — confluence_search auto-detects and uses siteSearch:
project documentation architecture

Practical Patterns

Pages in a Space

type = page AND space = "DEV" ORDER BY lastModified DESC

Recently Modified Content

type = page AND lastModified >= "2024-06-01" ORDER BY lastModified DESC

Content with Specific Label

type = page AND label = "architecture" ORDER BY title ASC
space = "~username" AND type = page
Personal space keys starting with ~ must be quoted in CQL: space = "~username"

Pages Under a Parent

ancestor = "12345678" AND type = page ORDER BY title ASC

Full Text Search in Space

space = "DEV" AND text ~ "database migration" ORDER BY lastModified DESC

Tips

For simple searches, just pass plain text to confluence_search — it uses siteSearch by default, which mimics the Confluence web UI search.
Use siteSearch for relevance-ranked results: siteSearch ~ "important concept"
CQL syntax can differ slightly between Cloud and Server/DC. Test your queries if migrating between platforms.