Search Box
The Search Box macro displays a search box on a page.
This macro offers the right balance between ease of use and flexibility to search specific Confluence spaces for content.
Usage
-
Go to the form you wish to edit.
-
Click Edit.
-
Click Insert More Content, and select Other Macros.
-
Select the Search Box macro from the provided list.
-
Complete the desired fields.
Parameter Description Type Default Required Space(s)
Search a specific space, list of spaces or use keywords to specify spaces @all, @personal, @global, @favourite, @current (default)
string
@current
Search all spaces
Overrides the spaces list above
checkbox
unchecked
Filter Last Modified
Filter the list of spaces by team labels (only the selected space is searched)
string
none
Grouping
Group results by space/type/@select
single select
none
Filter Last Modified
Filter list of search results by last modified date (today/yesterday/lastweek/lastmonth/@select)
single select
none
Object Type
Only return objects of type (page/blogpost/mail/comment/attachment/userinfo
single select
none
Global Text Label
The text to use for labeling global searches
string
Global Spaces
Personal Spaces Label
The text to use for labeling personal searches
string
Personal Spaces
Favourite Spaces Label
The text to use for labeling global searches
string
Favourite Spaces
All Spaces Label
The text to use for labeling global searches
string
All Spaces
Search Button Label
Search Button Label - The text to use for the search button
string
Search
Search Input Label
Adds a label to the search input
string
none
Access Key
Adds an access key to the search button
string
none
Show Button
Display the search button (true/false)
string
true
CSS Class
The class attribute of the element
string
none
-
The macro will then appear on the page.
Examples
Search the Current Space
Search Box macro added with default parameters.
Which results in:

Search a Specific Space
Create a search box to search a specific space as follows:
With Space parameter set to "ADAPTAVIST".
Which results in:

There’s no visual distinction between this search box and the one in the previous example, so it should be indicated on-screen that the search box is searching a different space.
The Space parameter value must be exactly the same as the Space Key in terms of capitalization. In our example above, if we used |
Specify Multiple Spaces
Create a search box to search a specific space as follows:
With Space parameter set to "SUP, PROD".


Search All Spaces
Create a search box that searches all spaces as follows:
With Search all spaces checkbox "checked".
[source,html]
Which results in:

Improved Layout
Using a search box on it’s own doesn’t tell the user what they are searching. Using macros such as the panel macro and Center Content, an improved search panel can be created:
Default Search Box macro contained in a Center macro within a Panel macro.
Which results in:

Hints and Tips:
The search will only allow a user to search in spaces that they have sufficient privileges to view.
Advanced Search Query Syntax can be used within the search box should more specific searching be required.
Frequently Asked Questions:
- Q: Can I display search results for a specific query on a page?
-
A: Yes