Enhanced Search

Using Enhanced Search, you can search your content using CQL without calling Atlassian's Confluence REST API. 

For help with CQL, visit CQL Guide.

To perform a search, follow these steps:

  1. Open the Enhanced Search screen in one of the following ways: 

  2. Enter your CQL query in the search bar.

    CQL autocomplete for ScriptRunner for Confluence is available here. 

    CQL autocomplete will dynamically show you components of CQL (field, operator, and function) while you type your query.

    CQL autocomplete is contextual, so once you start typing, only components that are valid for CQL rules and are relevant to your Confluence instance appear. For example, if you have a field of title, the only operators that are ones that work with that field. 

    CQL autocomplete results are limited to 20, so while you may see autocomplete results quickly, you might have to type more to get the results you want.

  3. Click the Search button to view your results. Two things can happen here: 
    • Invalid CQL query: An error message is displayed that provides information about the error within your query. You can rewrite your query now.
    • Valid CQL query: The Results table is displayed, showing all of the content that matches your query. You can click the link in the Title column to access the content returned by the search.
      CQL query results
If there are more than 100 matches, the table displays the first 100 results, and you can scroll through additional pages of the table to view more results.

Examples 

To learn more about different types of CQL queries, visit the Types of CQL Queries section of the CQL Guide. For the following examples, we will use different constructions of CQL queries to find the following content:

  • Title contains CQL
  • Content type is page
  • Text contains help for functions
  • Space is ScriptRunner for Confluence

By the end of the example, we will have a list of pages in the ScriptRunner for Confluence documentation that have help for CQL functions.

Basic CQL query 

To start, we're going to search for content that contains CQL by searching with a basic CQL query of title ~ CQL, which means the title contains "CQL."

As you can see, this returned a lot of content, including pages. In the next example, we will narrow in our search results. 

Combined CQL query

Since we want to narrow in our search results, we are going to add to our CQL query. title ~ CQL AND type = page means we are looking for a title that contains CQL, and the content type is a page.

Now we have narrowed our search results to only pages that have CQL in the title, but we can narrow in our search further by looking for help with functions. 

Multiple CQL queries

To search the text on our pages, we are going to add in a second CQL statement. (title ~ CQL AND type = page) AND (text ~ "help with functions") will search the instance for pages with CQL in the title that also contain text to help with functions. We enclose each statement with parenthesis so the search looks for all of the statements. 

Now, the search results contain the information you want, but from different spaces. Add one final CQL query to determine your space: (title ~ CQL AND type = page) AND (text ~ "help with functions") AND (space = SR4C). 

Now you have pages in a certain space that help you with CQL functions. 


On this page