Overview:
The {search-box} macro displays a search box on your page...
There are some occasions when you want to display a search box on your page and this macro offers the right balance between ease of use and flexibility.
Parameters:
Add the macro to your page as follows:
{search-box:space=s|all=true/false}
| Parameter | Required | Default | Notes |
|---|---|---|---|
| space | Current Space | The space to search. If omitted, the current space will be searched. If a valid space key is specified, that will be searched instead. (multiple spaces can be specified when separated by a comma) | |
| all | false | If set to true, all spaces which the user has access to will be searched. |
Examples:
Hints and Tips:
The search will only allow a user to search in spaces that they have sufficient privileges to view.
If you create a search-box to search a space that the user cannot view, the search will fail. Use the show-to macro or hide-from macro to remove the search box from users who cannot use it.
You can use advanced Search Query Syntax 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 |









Comments (48)
May 13, 2006
Anonymous says:
Excellent Macro!! Would really like to see ehanced search capabilities. Is it ...Excellent Macro!! Would really like to see ehanced search capabilities. Is it possible to search only a portion of a space, for instance when you look at the directory tree can you search from the current node down only? Any other search capabilities would be excellent such as searching by user, date, etc.... search capabilities similar to all the big search engines (google, yahoo, etc). Wikis are an excellent tool for user collaboration, however our team believes there are three important pieces to the puzzle: organization, navigation, searchability. Wikis inherently provide excellent capabilities for the first two, however we'd like to see the search capabilities improved. If anyone has thoughts they can share that would be great.
Oct 21, 2006
Anonymous says:
is it possible to limit the search to a specific page (of which the search-box r...is it possible to limit the search to a specific page (of which the search-box resides)? For example, we have a page that contains username(s) and info. This page will be populated with over 100 usernames. So rather than the end user having to manually scroll the page and visually search for a user, I have put a searchbar at the top of the page. However, I can't get it to only look within page for "username".
Any suggestions are welcome.
-J
Oct 21, 2006
Dan Hardiker says:
In a word - no. The confluence search engine is for finding content, not for sea...In a word - no. The confluence search engine is for finding content, not for searching within it.
You would either need a custom plugin (that filters down the list as you type in your query) ... or, much easier, just use Ctrl+F in your browser to find in the page!
Oct 21, 2006
Guy Fraser says:
Press Ctrl + F to use your browsers inbuilt page searchPress Ctrl + F to use your browsers inbuilt page search
Feb 02, 2007
Anonymous says:
My question is can searches be limited on content type. Confluence appears to gi...My question is can searches be limited on content type. Confluence appears to give priority first to images, then attachment (PDF etc) and then pages. I would like the ability to control what is searched for a little more.
Comments welcome
Feb 02, 2007
Guy Fraser says:
You can use our Advanced Search Plugin to create a far more flexible search inte...You can use our Advanced Search Plugin to create a far more flexible search interface: http://confluence.atlassian.com/display/CONFEXT/Advanced+Search+Plugin
Mar 16, 2007
Anonymous says:
I am not able to use Search Box Macro. Can anyone please tell me the steps for...I am not able to use Search Box Macro.
Can anyone please tell me the steps for using the same.
Thanks
Shailendra
Jun 27, 2007
Guy Fraser says:
You need to install the Content Formatting Macros plugin.You need to install the Content Formatting Macros plugin.
Jun 20, 2007
Matthew Donadio says:
Does the macro syntax allow an image to be used for the search button? Thanks.Does the macro syntax allow an image to be used for the search button? Thanks.
Jun 27, 2007
Guy Fraser says:
Not currently but there is a feature request - please vote/comment on: http://ji...Not currently but there is a feature request - please vote/comment on: http://jira.adaptavist.com/browse/WEB-47
Dec 06, 2007
Jose Remy says:
Is it possible to translate "search" button label in other language ? Regards,Is it possible to translate "search" button label in other language ?
Regards,
Apr 07, 2008
Matt B says:
Hey Guy, don't suppose there's a way we can get this search box to use <input...Hey Guy, don't suppose there's a way we can get this search box to use <input type="search" /> is there? So that it looks Apple-style...
I've asked this before elsewhere and I'm going to be embarrassed if you replied last time saying "no"
I voted/commented on http://jira.adaptavist.com/browse/WEB-47
Apr 07, 2008
Guy Fraser says:
Unfortunately type="search" is invalid HTML: http://www.w3schools.com/TAGS/tag_i...Unfortunately type="search" is invalid HTML: http://www.w3schools.com/TAGS/tag_input.asp
Apr 07, 2008
Matt B says:
Check out this page to see what I mean: http://www.37signals.com/svn/archives2/...Check out this page to see what I mean:
http://www.37signals.com/svn/archives2/searchin_safari.php
(In other browsers, like one of the comments on that page says, an input tag with the type="search" attribute will degrade to a normal text box in non-Safari browsers, sans button. But like I said before, we pretty much only use Safari in-house.)
Apr 07, 2008
Guy Fraser says:
You could possibly use jQuery - check the jQuery browser object to see if the pa...You could possibly use jQuery - check the jQuery browser object to see if the page is running in Safari and if so set type attr to "search" for the input.
Apr 07, 2008
Matt B says:
Hmm not sure what you mean... {search-input:type=search} ? I think I tr...Hmm not sure what you mean...
{search-input:type=search}?
I think I tried that before and it didn't work, hmm. I'll try some things when I get to the office later.
Apr 14, 2008
Matt B says:
So what I ended up doing is just ripping the HTML code from the source of a rend...So what I ended up doing is just ripping the HTML code from the source of a rendered version of the page that has the advanced search on it, and changed the input type to "search".
That let us use the Apple-style search box in Safari with the Advanced Search plugin:
Apr 14, 2008
Christian Spröte says:
We are using Confluence with german language, so I'd like to change the caption ...We are using Confluence with german language, so I'd like to change the caption of the search-box - how can this be done?
Apr 17, 2008
Matt B says:
Anybody have any idea why we can use Adaptavist's advanced search plugin to find...Anybody have any idea why we can use Adaptavist's advanced search plugin to find pages with Japanese titles or content, but searching for Japanese characters with Confluence's default search doesn't return any results unless you search for English characters?
Jul 16, 2008
Tomi Strugar says:
Is there a parameter to drop the Search button and just have the Search box (lik...Is there a parameter to drop the Search button and just have the Search box (like in Conf 2.8)?
Oct 03, 2008
William Chever says:
Great plugin, thanks. Is there any way to always have a particular page include...Great plugin, thanks.
Is there any way to always have a particular page included in search results? We have a set of HTML help files and regardless of the search term used, we want to have the set of help files always be included in the results.
Thanks.
Oct 04, 2008
Guy Fraser says:
If you're using Theme Builder you could use the builder-show macro to displa...If you're using Theme Builder you could use the builder-show macro to display a link when the user is looking at the search results page.
Nov 06, 2008
Guillermo Chutrau says:
Search Macro We still use/have the {search} macro I can't find a help page for...Search Macro
We still use/have the {search} macro
I can't find a help page for it. It is listed in the Full Notation Guide that comes with our Dashboard.
I would like to know how to set the parameters to look for additions by the Anonymous user.
Dec 17, 2008
Edward Tam says:
Is there a way to have the search-box macro search more than 1 space? I would l...Is there a way to have the search-box macro search more than 1 space? I would like to have it search 3 spaces. The only other option I see is having it search all spaces which I rather avoid.
Apr 29, 2009
Almar Hollaar says:
How do I get a search-box in my search result page? Also the filter options in t...How do I get a search-box in my search result page?
Also the filter options in the search result page don't work!
Thx
Apr 29, 2009
wflybutter says:
We are having the same problem, when we have the Adaptavist Theme Builder appli...We are having the same problem, when we have the Adaptavist Theme Builder applied. We also receive a 'Page not found' when the 'clear filter' link is clicked.
Apr 29, 2009
wflybutter says:
We are having the same problem, when we have the Adaptavist Theme Builder appli...We are having the same problem, when we have the Adaptavist Theme Builder applied. We also receive a 'Page not found' when the 'clear filter' link is clicked.
Jun 04, 2009
Anh Bui says:
Does anyone know if you can change the 'No results found' message? I am trying ...Does anyone know if you can change the 'No results found' message?
I am trying to enter a specific message for the results page if a document is not found but not sure if this is possible.
Any suggestions?
Jul 23, 2009
Mark Weber says:
is it possible to search in 2 defined spaces ?? {search-box:space=test1,test2}...is it possible to search in 2 defined spaces ??
{search-box:space=test1,test2}works, but differently. a dropdown appears next to the search-input (at least with my version of Content Formatting Macros)
Adaptavist Content Formatting Macros
Vendor: Adaptavist.com Ltd
Plugin Version: 1.6.9
actually same question as Edward Tam's, Dec 17, 2008
thank you
Jul 23, 2009
Mark Weber says:
why is the search-box macro not documentation (this page) on adaptavist.com not ...why is the search-box macro not documentation (this page) on adaptavist.com not up to date?
neither the parameter list nor the examples are meainingful.
thank you.
Jul 23, 2009
Mark Weber says:
is it possible to show pages in searchresult, where not only the original sites ...is it possible to show pages in searchresult, where not only the original sites with the searched content are but also the pages, where other pages with the searched content, are included resp. imported ??
Oct 31, 2009
Colin Ho says:
Can the documentation please be updated to match version 1.6.12? Thanks!Can the documentation please be updated to match version 1.6.12? Thanks!
Feb 19, 2010
ryan brown says:
I have this search box at the bottom of my page, but when you navigate to the pa...I have this search box at the bottom of my page, but when you navigate to the page, it automatically loads to the search box scrolling way down past the top of the site. There is a cursor in the box awaiting text. Is there any way to make the search box inactive so that my page will load to the top instead of scrolling down to the search box?
Sep 10, 2010
John Connors says:
Can you suggest any ways to customize the search results, for example to add a l...Can you suggest any ways to customize the search results, for example to add a link to return to the home page or previous page, to remove the space/user filter panel on the right, or to remove the label filter panel?
Oct 13, 2010
Hor Pui Yin says:
Hi search-box macro is it supposed to limit results based on the label? How "l...Hi
search-box macro is it supposed to limit results based on the label?
How "label" param work?
I found below in the notation guide. The document at https://www.adaptavist.com/display/AtlassianConfluence/search-box+macro seem not complete.
Add a search box to your page:
Oct 28, 2010
Derek says:
Hi, I really need some help here. I created a few pages which are under lets sa...Hi,
I really need some help here. I created a few pages which are under lets say XYZ space.
When I use the search box provided on the upper right side, I was not able to search the words in my document!
For example, I made a blank page and type in pokemon,power rangers. When I searched these words in the search box under the XYZ space the results shows null. It is possible to search if I used labels. But that is a hassle as I do not want to label every page.
The other pages created by other admins were able to search their contents, not based on labels. Please advice and give me some suggestion.
Maybe there was some setting I did wrong when I created the page?
Oct 28, 2010
Guy Fraser says:
It takes the search engine a few minutes to index new pages, try your search aga...It takes the search engine a few minutes to index new pages, try your search again to see if it's now showing up in the results.
Oct 28, 2010
Derek says:
Hi Fraser, Sadly it is not, have been trying to figure this out almost a week p...Hi Fraser,
Sadly it is not, have been trying to figure this out almost a week plus. That's why I have to resort to posting it here. Even my superiors have no idea why is this so. Created the page almost 1 week plus already, yet the search does not show the results.
Kindly help or advice please. I need it done asap.
Thanks in advance.
Oct 29, 2010
Derek says:
Hey someone please reply me or help me !! Is the search engine dead? How come it...Hey someone please reply me or help me !! Is the search engine dead? How come it works for old pages and not new ones.(and I mean new ones as those I created a week plus ago)
Oct 29, 2010
Guillermo Chutrau says:
Make sure your indexing is turned on, and reboot the server. That should solve y...Make sure your indexing is turned on, and reboot the server. That should solve your problem.
Nov 02, 2010
Guillermo Chutrau says:
did it work?did it work?
Nov 03, 2010
Derek says:
How to make sure indexing is turned on? I can't just reboot the server, it belon...How to make sure indexing is turned on? I can't just reboot the server, it belongs to my company. =)
Dec 01, 2010
Samael Bate says:
You can reindex Confluence by going to the Content Indexing section in the Admin...You can reindex Confluence by going to the Content Indexing section in the Admin Panel.
Nov 15, 2010
Derek says:
Is there a single soul out there kind enough to help me on this????? Or is this ...Is there a single soul out there kind enough to help me on this????? Or is this page just not active anymore
Jan 12, 2011
Simon Frei says:
How is it possible to display the search results in de content area of space lay...How is it possible to display the search results in de content area of space layout=
Jan 13, 2011
Robin Crorie says:
Hi Simon, Have you looked into the Advanced Search macro? It gives you a lot mo...Hi Simon,
Have you looked into the Advanced Search macro? It gives you a lot more functionality but the main reason I mention it is that you use a separate macro to display the results. This means the results will be displayed in the contents of the page the macro is placed within.
Not too sure if thats what you are after exactly, but here is the documentation with some more information and usage examples: Advanced Search macro
Mar 04, 2011
Wolfgang Geithner says:
Hi Guy, nice macro, especially the search in multiple space functionality is ve...Hi Guy,
nice macro, especially the search in multiple space functionality is very interesting. I wanted to search in two spaces, where I have access too. I separated the space keys by comma, but the macro does not limit the search to the two spaces, but rather searches everywhere. The status message of site search says: "Searched for test in $inSpace."
We are using Confluence 2.6.1.
Any idea?
Kind regards
Wolfgang
Apr 15, 2011
Exsiss says:
I was wondering if it was possible to have a parameter for having text in the se...I was wondering if it was possible to have a parameter for having text in the search bar that disappears when someone clicks it. For instance, on this site the search bar says "Search"and when you click it it goes away.
How did you go about doing this?
Thanks.