Enhanced Search
Using Enhanced Search, you can search your content using CQL without calling Atlassian's Confluence REST API.
To perform a search, follow these steps:
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.
