Instant Search for Confluence
Instant Search adds a search box to any Confluence page. Results appear while you type: there is no need to press Enter or to leave the page. The search is not case sensitive, accepts several words, and can be narrowed with filters, so a page can offer a search of exactly the content its readers need: one space, one label, one content type.
Typical uses are documentation spaces, knowledge bases, help desks, and QA or document libraries where readers need to find a page quickly.
Versions
Instant Search is available for Confluence Cloud and Confluence Data Center.
| Confluence Cloud | Confluence Data Center | |
|---|---|---|
| App version | 4.x | 3.x (2.9 for Confluence 7 and 8) |
| Compatibility | Confluence Cloud | 3.1: Confluence 10.0 to 10.2. 3.0: Confluence 9.0 to 9.5. 2.9: Confluence 7.15 to 8.9 |
| Type-ahead search box | Yes | Yes |
| Filters | Spaces, one label, one content type, last modified (a preset period) | Spaces, labels (required or excluded), content types, contributor, space category, space labels, likes, URL, last modified (any period) |
| Extra details in results | Space, content type, date last modified | Space, labels, breadcrumbs, date created, date last modified, likes, favourites |
| Sorting of results | By relevance | By relevance, likes, favourites, date modified or created, title, file name or size |
| Hiding text in excerpts | No | Yes |
| Search tracking | Always on. Results in the Instant Search Popular Searches macro | Turned on per search box. Results in the Instant Search Log Table macro and in Confluence administration |
| Styling with your own CSS classes | No | Yes |
| Wiki markup form of the macro | No | Yes |
| Replacing the Confluence search box | No | Yes (experimental) |
The macro has a shorter set of settings in Cloud: see Macro settings in Cloud. The option tables after that section describe Data Center.
Install the app
Confluence Cloud
- As a site administrator, open Apps and go to the Atlassian Marketplace (Explore more apps).
- Search for Instant Search for Confluence.
- Select Try it free or Buy now and confirm.
Confluence Data Center
- Open Administration > Manage apps > Find new apps.
- Search for Instant Search for Confluence.
- Select Free trial or Buy now and follow the steps to get a license.
No further setup is needed. The app uses Confluence's own search index, so there is nothing else to install or configure, and results respect each reader's permissions: a reader only sees content they are allowed to view.
Add a search box to a page
- Edit the page where the search box should appear.
- Type
/instant search(Cloud) or{instant(Data Center), or open the macro browser and choose Instant Search. - Set the options you need. The preview shows the search box as readers will see it.
- Insert the macro and publish the page.
With no options set, the box searches all content the reader can view and shows up to 10 results with a short excerpt.
To use it, start typing in the box. Results are listed under the box and update with every keystroke. Select a result to open it.
Macro settings in Cloud
In Cloud the macro has these settings. They are set in the macro's settings panel; Cloud has no wiki markup form.
| Setting | What it does | Default |
|---|---|---|
| Excerpt length | Rough length of the excerpt under each result, in characters. 0 shows no excerpts. |
40 |
| Limit | Number of results listed at first. Show more results loads more. | 10 |
| Watermark | Hint text shown in the empty box. | |
| Search button text | Text of the search button. | Search |
| Show | Extra details in each result: date last modified, content type, space. | none |
| Display | Shows or hides the search button. | shown |
| Search by last modified | Searches only content changed today, yesterday, in the past 7 days, 30 days or year. | any time |
| Label | Searches only content with this label. | |
| Search by content type | Searches only pages, blog posts, comments or attachments. | all |
| Space | Searches only the chosen spaces. | all |
Pressing Enter or the search button opens Confluence search with the same text and filters.
The Instant Search Popular Searches macro shows what readers searched for: see Search tracking.
Options: search box (Data Center)
These options change how the search box looks and behaves.
| Option | What it does | Default |
|---|---|---|
watermark |
Hint text shown in the empty box. @self is replaced with the name of the current space. |
|
inputFieldWidth |
Width of the box, as a CSS width, for example 200px. |
300px |
showSearchButton |
Shows or hides the search button. | hidden |
searchButtonHTML |
Text of the search button. @self is replaced with the name of the current space. |
|
focus |
Puts the cursor in the box when the page loads. | false |
tabOrder |
Position of the box in the page's tab order. | |
track |
Records what readers search for. See Search tracking. | false |
Options: results (Data Center)
These options change what each result shows.
| Option | What it does | Default |
|---|---|---|
limit |
Largest number of results listed, up to 50. | 10 |
excerptLength |
Rough length of the excerpt under each result, in characters. Set it to 0 to show no excerpts. |
40 |
resultWidth |
Width of the results box, for example 400px. |
|
showSpaceKey |
Shows the space of each result. | false |
showLabels |
Shows the labels of each result. | false |
showBreadCrumbs |
Shows where each result sits in the page tree. | false |
showDateCreated |
Shows the date the content was created. | false |
showDateLastModified |
Shows the date the content was last changed. | false |
showLikes |
Shows the number of likes. | false |
showFavorites |
Shows how many people saved the content as a favourite. | false |
separateLine |
Puts each result's title on its own line, above the excerpt. | false |
sort |
Sorts results: Relevance, Favorite, Modified, Created, Title, Filename or Filesize. |
Relevance |
sortDirectionDescending |
Sorts from the highest value down. Relevance and favourites are always sorted this way. | true |
sortLikes |
Sorts results by the number of likes: asc or desc. |
|
hideExcerptMacro |
Leaves the text of the page's Excerpt macro out of the result's excerpt. | false |
hideText |
Hides text in the excerpts that matches a regular expression (Java syntax). Separate several expressions with _,_. |
|
replaceText |
Text shown in place of what hideText hid. Separate several replacements with _,_, in the same order. |
empty |
Options: filters (Data Center)
Filters decide which content the box searches. Several filters can be combined.
| Option | What it does |
|---|---|
spaceKey |
Searches only the given space. Separate several keys with commas. @self means the space the page is in. |
type |
Searches only the given content types, separated by commas: page, blogpost, comment, attachment, userinfo, spacedesc, personalspacedesc, space, draft, mail, custom. |
label |
Searches only content with these labels, separated by commas or spaces. By default one matching label is enough. Put + before a label to require it, or - to leave out content that has it. |
spaceCategory |
Searches only spaces of the given category type. |
spaceLabel |
Searches only spaces with the given space categories, separated by commas. |
contributor |
Searches only content the given user has contributed to. |
lastModified |
Searches only content changed within a period: 3d is the last 3 days, 1m3d is the last month and 3 days. |
likesFilter |
Keeps only results with more or fewer likes than a number: >3 means more than 3 likes. |
filter |
Keeps or drops results by their URL. Put + (the default) before a text to require it in the URL, or - to drop results whose URL contains it. Separate several with commas or spaces. Keywords, used alone: @none (the default), @self, @parent, @home. |
Examples (Data Center)
Each example lists the options to set in the macro.
| What you want | Options |
|---|---|
| A search of one space that shows the space key and has no button | spaceKey = DOC, showSpaceKey = true, showSearchButton = false |
| A compact search of one space's pages, for a sidebar | spaceKey = DOC, type = page, limit = 3, inputFieldWidth = 200px, excerptLength = 0, watermark = Search articles |
| Pages changed in the last 3 days, with the date shown | spaceKey = DOC, type = page, lastModified = 3d, showDateLastModified = true |
| Only content that has all three labels | label = +atlassian,+confluence,+content |
| A search of the current space, wherever the page is copied to | spaceKey = @self, watermark = Search in @self |
Wiki markup (Data Center)
On Data Center the macro can also be written as wiki markup. Use this form where the macro browser is not available, for example in a space sidebar, a layout or a template. Options are separated with |.
{instantsearch}
{instantsearch:spaceKey=DOC|showSpaceKey=true|showSearchButton=false}
{instantsearch:spaceKey=DOC|type=page|limit=3|inputFieldWidth=200px|excerptLength=0|watermark=Search articles|showSearchButton=false}
{instantsearch:spaceKey=DOC|type=page|limit=3|lastModified=3d|showDateLastModified=true}
{instantsearch:spaceKey=DOC|label=+atlassian,+confluence,+content|excerptLength=0}
{instantsearch:spaceKey=@self|label=+atlassian,+confluence,+content|filter=@self}
{instantsearch:spaceKey=DOC|showLabels=true|showBreadCrumbs=true|hideExcerptMacro=true|inputFieldWidth=200px}
{instantsearch:spaceKey=DOC1,DOC2|resultWidth=400px|focus=true|track=true}
Styling with CSS (Data Center)
On Data Center each part of the search box can be given your own CSS class, so the box matches the look of your space. Define the classes in the space or site stylesheet, then name them in the macro.
| Option | Part it styles |
|---|---|
searchClass |
The search box as a whole |
inputClass |
The text input |
watermarkClass |
The hint text in the empty input |
searchDivClass |
The container of the search button |
searchButtonClass |
The search button |
resultClass |
The results box |
{instantsearch:spaceKey=DOC|resultClass=mystyle|resultWidth=400px}
Replace the Confluence search box (Data Center, experimental)
The option makeGlobal replaces the search box in the Confluence header with Instant Search on the page that holds the macro. Placed in a space's sidebar or layout, it does so for the whole space.
{instantsearch:makeGlobal=true}
This option is experimental: check it on a test page before you use it for a whole space.
Search tracking
Search tracking shows what readers look for in Instant Search:
- Popular searches: what readers look for most. These are the pages worth keeping up to date and easy to reach.
- Failed searches: what readers look for and do not find. These point to missing content, or to pages that need other words or labels.
- Searches of one user: what a given reader searched for.
Data Center
Tracking is off by default. Turn it on for a search box with the option track. Each record holds the search text, the page that was opened from the results, the page and space of the search box, the time, and the username of the reader. The records are kept in your own Confluence database and never leave your server.
To see the results, add the Instant Search Log Table macro to a page, for example a page only space administrators can view:
{instantsearch-log}
{instantsearch-log:showFailedTable=false}
The macro lists the tracked searches in tables. showFailedTable=false leaves out the table of failed searches, and showUserSearchTable=true adds the table of one user's searches. Confluence administrators also find the records under Instant Search > Tracking Log in Confluence administration, where they can look up the searches of one username and download all records as CSV.
Cloud
Tracking is always on. A search is recorded when a reader presses Enter or the search button and the search has results, when a reader opens a result, and when a reader selects Report bad search results; the last one counts as a failed search. Each record holds the search text, the filters of the search box, the opened result, the time, and the Atlassian account ID of the reader. The records are kept in the app's storage on Atlassian's Forge platform.
To see the results, add the Instant Search Popular Searches macro to a page. It shows three tables: Popular Searches, Current User Search (the searches of the reader who views the page) and Failed Searches. In its settings, choose which tables to show and how many rows each one has (10 by default).
Migrate from Data Center to Cloud
Instant Search has no automated migration path. The Confluence Cloud Migration Assistant moves your pages, but not the app's own data, and the Cloud app does not take over the Data Center macros on migrated pages. Plan a few manual steps for each page that has a search box.
What does not move to Cloud
| Data Center | In Cloud |
|---|---|
| Instant Search macros on pages, sidebars, layouts and templates | The Cloud app uses its own macros. Add an Instant Search macro to each page again. |
| Search tracking records | Not moved. Records in Cloud start empty. |
| Instant Search Log Table macro | Use the Instant Search Popular Searches macro instead. |
| Wiki markup form of the macro | Not available. Use the macro browser or /instant search. |
| Styling with your own CSS classes | Not available. |
Replacing the Confluence search box (makeGlobal) |
Not available. |
See Versions for the full list of differences between the two editions.
Before the migration
- List the pages that use the macro. The CQL query
macro = instantsearchfinds them. - For each page, note the macro's options, for example by saving the page's storage format or a screenshot of the macro settings.
- If you use search tracking and want to keep its results, save the Instant Search Log Table page as PDF or copy its tables. The records are not moved.
After the migration
- Install Instant Search for Confluence on the Cloud site: see Install the app.
- On each page from your list, remove the old macro, add Instant Search again and set its options. The Cloud macro has fewer options than Data Center: excerpt length, limit, watermark, search button text, what each result shows (date last modified, type, space key), the search button, last modified, label, content type and spaces. Data Center options that are not in this list have no Cloud equivalent.
- In Cloud, searches are recorded for every Instant Search box, with no option to turn this on. Add the Instant Search Popular Searches macro to a page where you want to see the results.
Help & Support
Please raise a support request here, or email us at support@votazz.co.