Search content of a single space in confluence

Raju KC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2013

How to search content of a single space in confluence that uses zen foundation theme

2 answers

1 accepted

0 votes
Answer accepted
MatthewC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2013

you could create your own search box, either using the HTML macro or if you want to make it a little more usable, a user macro. you then just drop in {search-current-space} in the page.

## Macro title: Search Current Space
## Macro Name: search-current-space
## Macro has a body: N
## Body processing: No Macro Body
## Output: HTML
##
## Developed by: Matthew Cobby
## Date created: 26/07/2011
## Installed by: Matthew Cobby

<form method="POST" action="/dosearchsite.action" name="searchForm" style="padding: 1px; margin: 1px">
<input type="hidden" name="quickSearch" value="true" />
<input type="hidden" name="searchQuery.spaceKey" value="$space.getKey()" />
<input type="text" accessKey="s" name="searchQuery.queryString" size="50"/>
<input type="submit" value="Search Space"/>
</form>

what you are trying to do is create an HTML form in the page like this:

<form method="POST" action="/dosearchsite.action" name="searchForm" style="padding: 1px; margin: 1px">
<input type="hidden" name="quickSearch" value="true" />
<input type="hidden" name="searchQuery.spaceKey" value="**SPACEKEY OF CURRENT SPACE**" />
<input type="text" accessKey="s" name="searchQuery.queryString" size="25"/>
<input type="submit" value="Search Space"/>
</form>

if you wanted, you could add extra parameters to the macro to search types of content, date ranges, formatting rules etc

Deleted user January 24, 2013

That's true and yours is a much cooler solution, Matthew. But can OnDemand users create their own macros (or install their own plugins)?

MatthewC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2013

ahh, my bad. I thought they now allowed some user macros but obviously not, it's still a restricted function. However, if you use the documentation theme, there is an option to restrict the search box in the top right to the default space

https://confluence.atlassian.com/display/AOD/Searching+Confluence#SearchingConfluence-SearchOptionsWhenUsingtheDocumentationTheme

You can then do it on a space by space basis.

0 votes
Deleted user January 24, 2013

You could reate a 'Search this space' landing page and add a search box macro to the page

Note, I don't know if the macros still exist in 4.x -- but that's how I would do it in 3.5x

Update: Sorry, I should have said a "Page Tree Search" macro. You have to specify the home page.

MatthewC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2013

the only problem is that it misses out a lot of content, it won't search anything not under the home page, or other content like blog posts

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events