Confluence Search Syntax

This page describes the special words and punctuation marks you can use to refine your search.

Matched phrase search

Use double quotes to search for content that contains the phrase 'cheese one', or a phrase where 'cheese' and 'one' are the major words:

"cheese one"

Note: Confluence will ignore common words (stop words), including 'and', 'the', 'or', and more, even if they are included within double quotes. See the default list of stop words used by Confluence's search engine, Lucene, in the Lucene documentation.

For example:

  1. Searching for "cheese one" returns only pages in which 'one' appears as the first word after 'cheese'.
  2. Searching for "the one" returns all pages containing 'one' because 'the' is a stop word.

If you'd like to override Lucene's tokenization and stemming, cast your vote on this improvement request:  CONF-14910 - Provide ability to override Lucene tokenisation and stemming and search for exact text Open

OR search

To search for content that contains one of the terms, 'chalk' or 'cheese', use the operator OR in capital letters:

chalk OR cheese

AND search

To search for content that contains both the terms 'chalk' and 'cheese', use the operator AND in capital letters:

chalk AND cheese

NOT search

To search for content that contains 'chalk' but NOT 'cheese', use the operator NOT in capital letters:

chalk NOT cheese

Excluded term search

To search for content that contains 'chalk' and 'butter' but not 'cheese':

chalk butter -cheese

Group search terms

To search for content that must contain 'chalk' but can contain either 'cheese' or 'butter', use brackets to group the search terms:

(cheese OR butter) AND chalk

Title search

To search for pages and posts with certain words in the title, use the Add a filter option at the bottom left of the page and choose With title. Enter the words you're looking for, in any order, and hit enter.

Confluence search filters are powered by CQL.
  What's CQL, and how do I use it?

CQL (Confluence Query Language) is a query language developed for Confluence, which you can use in some macros and the Confluence search. Confluence search and CQL-powered macros allow you to add filters to build up a search query, adding as many filters as you need to narrow down the search results.

Use the Add a filter link to add more filters to your query.
 

  Use AND, OR, and NOT operators
  • For an OR search, specify multiple values in the same field.
    So to show pages with 'label-a', 'label-b' or both you'd put 'label-a' and 'label-b' in the same Label field, like this:
  • For an AND search, add more than one filter and specify a single value in each.
    To show only pages with label-a and label-b you'd put 'label-a' in one label field, then add a second Label field to the macro, and put 'label-b' in the second one, like this:

    Put simply, OR values are entered in the same filter, AND values are entered in different filter. 
    Only some filters support AND. If the filter doesn't support the AND operator, you won't be able to add that filter more than once.  
  • For a NOT search, enter a minus sign (-) before the label. This'll exclude everything with that label.


You can use the following CQL filters to build your query:

Filter Description Operators
Label*

Include pages, blog posts or attachments with these labels.

OR (multiple values in the same filter)

AND (multiple Label filters)

With ancestor

Include pages that are children of this page.

This allows you to restrict the macro to a single page tree.

OR (multiple values in the same filter)
Contributor**

Include pages or blog posts that were created or edited by these people.

OR (multiple values in the same filter)
Creator

Include items created by these people.

OR (multiple values in the same filter)
Mentioning user

Include pages and blog posts that @mention these people.

OR (multiple values in the same filter)
With parent Include only direct children of this page (further sub-pages won't be included) EQUALS (one page only)
In space** Include items from these spaces. OR (multiple values in the same filter)
Including text** Include items that contain this text. CONTAINS (single word or phrase)
With title Include items that contain this text in the title. CONTAINS (single word or phrase)
Of type** Include only pages, blogs or attachments. OR (multiple values in the same filter)

* This field is required in CQL-powered macros.

** You can add these filters in CQL-powered macros but in search they're part of the standard search filters, so they don't appear in the Add a filter menu.

 

 

Date range search

To search for content modified within a certain date range, pick a timeframe in the Last modified section on the left. If you're looking for something created within a particular date range, use the Add a filter option at the bottom left of the page and choose Created. For either option, you can pick from some predefined options, like last 24 hours and last week.

Confluence search filters are powered by CQL.
  What's CQL, and how do I use it?

CQL (Confluence Query Language) is a query language developed for Confluence, which you can use in some macros and the Confluence search. Confluence search and CQL-powered macros allow you to add filters to build up a search query, adding as many filters as you need to narrow down the search results.

Use the Add a filter link to add more filters to your query.
 

  Use AND, OR, and NOT operators
  • For an OR search, specify multiple values in the same field.
    So to show pages with 'label-a', 'label-b' or both you'd put 'label-a' and 'label-b' in the same Label field, like this:
  • For an AND search, add more than one filter and specify a single value in each.
    To show only pages with label-a and label-b you'd put 'label-a' in one label field, then add a second Label field to the macro, and put 'label-b' in the second one, like this:

    Put simply, OR values are entered in the same filter, AND values are entered in different filter. 
    Only some filters support AND. If the filter doesn't support the AND operator, you won't be able to add that filter more than once.  
  • For a NOT search, enter a minus sign (-) before the label. This'll exclude everything with that label.


You can use the following CQL filters to build your query:

Filter Description Operators
Label*

Include pages, blog posts or attachments with these labels.

OR (multiple values in the same filter)

AND (multiple Label filters)

With ancestor

Include pages that are children of this page.

This allows you to restrict the macro to a single page tree.

OR (multiple values in the same filter)
Contributor**

Include pages or blog posts that were created or edited by these people.

OR (multiple values in the same filter)
Creator

Include items created by these people.

OR (multiple values in the same filter)
Mentioning user

Include pages and blog posts that @mention these people.

OR (multiple values in the same filter)
With parent Include only direct children of this page (further sub-pages won't be included) EQUALS (one page only)
In space** Include items from these spaces. OR (multiple values in the same filter)
Including text** Include items that contain this text. CONTAINS (single word or phrase)
With title Include items that contain this text in the title. CONTAINS (single word or phrase)
Of type** Include only pages, blogs or attachments. OR (multiple values in the same filter)

* This field is required in CQL-powered macros.

** You can add these filters in CQL-powered macros but in search they're part of the standard search filters, so they don't appear in the Add a filter menu.

 

 

Wildcard searches

You can use one or more wildcard characters in your search. For example, you could search for http*.atlassian.* to find https://www.atlassian.com or http://www.atlassian.jp.

Leading wildcards

Lucene doesn't allow wildcards at the beginning of your search, but you can format your search as a regular expression as a workaround. For example, you can't search for *hum* or ?hum*, as they begin with a wildcard, but you can search for /.*hum.*/ and find things like hum, human, and inhumane.

Wildcards can either replace a single character in your search, or multiple characters.

Single character

To replace a single character in your search, use a question mark (?) as a wildcard, For example, to search for 'butter', 'bitter', 'better', or 'batter'. 

b?tter

Multiple characters

To replace multiple characters in your search, use an asterisk (*) as a wildcard. For example, to search for 'chicken' or 'chickpea':

chick*

Multiple wildcards

Use multiple wildcards in your search. The following query will search find 'chick', 'coconut', or 'chickpea':

c*c*


You can also combine wildcard characters in one search. For example, the search term below will return 'chick' but not 'chickpea':

c*c?

Note: Confluence doesn't support leading wildcards. This means searching for *heese will not return cheese. 

Proximity searches

Use a tilde character followed by a number, to find two words within a certain number of words of each other.

For example, the following search will return 'Octagon blog post', but not 'Octagon team blog post':

"octagon post"~1

The following search isn't valid, because you can't search for two words within zero words of each other. If you think the words are next to each other, use the matched phrase search.

"octagon post"~0

Range search

Use the operator 'TO', in capital letters, to search for names that fall alphabetically within a specified range:

[adam TO ben]

Note: You can't use the AND keyword inside this statement.

Fuzzy search

Use a tilde (~) character to find words spelled similarly.

If you want to search for octagon, but you're not sure how it's been spelt, type the word followed by a tilde:

octogan~

Combined search

You can also combine various search terms together:

o?tag* AND past~ AND ("blog" AND "post")

Searching for macros

You can search Confluence content to find where a macro is used. Start your search string with macroName: and type the macro name after the colon. For example, to search for all excerpt-include macros:

macroName:excerpt-include*

For more information about macroName and other search fields, see Confluence Search Fields.

Searching for labels

To search for pages and posts with a particular label or labels, use the Add a filter option at the bottom left of the page and choose Label.

Confluence search filters are powered by CQL.
  What's CQL, and how do I use it?

CQL (Confluence Query Language) is a query language developed for Confluence, which you can use in some macros and the Confluence search. Confluence search and CQL-powered macros allow you to add filters to build up a search query, adding as many filters as you need to narrow down the search results.

Use the Add a filter link to add more filters to your query.
 

  Use AND, OR, and NOT operators
  • For an OR search, specify multiple values in the same field.
    So to show pages with 'label-a', 'label-b' or both you'd put 'label-a' and 'label-b' in the same Label field, like this:
  • For an AND search, add more than one filter and specify a single value in each.
    To show only pages with label-a and label-b you'd put 'label-a' in one label field, then add a second Label field to the macro, and put 'label-b' in the second one, like this:

    Put simply, OR values are entered in the same filter, AND values are entered in different filter. 
    Only some filters support AND. If the filter doesn't support the AND operator, you won't be able to add that filter more than once.  
  • For a NOT search, enter a minus sign (-) before the label. This'll exclude everything with that label.


You can use the following CQL filters to build your query:

Filter Description Operators
Label*

Include pages, blog posts or attachments with these labels.

OR (multiple values in the same filter)

AND (multiple Label filters)

With ancestor

Include pages that are children of this page.

This allows you to restrict the macro to a single page tree.

OR (multiple values in the same filter)
Contributor**

Include pages or blog posts that were created or edited by these people.

OR (multiple values in the same filter)
Creator

Include items created by these people.

OR (multiple values in the same filter)
Mentioning user

Include pages and blog posts that @mention these people.

OR (multiple values in the same filter)
With parent Include only direct children of this page (further sub-pages won't be included) EQUALS (one page only)
In space** Include items from these spaces. OR (multiple values in the same filter)
Including text** Include items that contain this text. CONTAINS (single word or phrase)
With title Include items that contain this text in the title. CONTAINS (single word or phrase)
Of type** Include only pages, blogs or attachments. OR (multiple values in the same filter)

* This field is required in CQL-powered macros.

** You can add these filters in CQL-powered macros but in search they're part of the standard search filters, so they don't appear in the Add a filter menu.

 

 

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport