Can I limit a search in the global search box to a certain space?

In Confluence, is there any way to limit a search in the global search box to a specific space? 

E.g., SPACEKEY: searchTerm

I am building a glossary space and I want people to be able to search for a term from anywhere in Confluence and have it come up prominently in the search results. So a search might look like this - GLOSSARY: widgit

This would be prefereable to making them navigate to the Glossary space and then perform their search.

Maybe there is an add-on that provides this functionality?

Thank you.

3 answers

1 vote
Davin Studer Community Champion Oct 06, 2014

If you look at the source for the form you will see a hidden input like this ...

<input type="hidden" name="where" value="">

the value should be either conf_all or the space key you want to search. You could set it with this...

<script type="text/javascript">
		AJS.$('#quick-search input[name="where"]').val("conf_all");

Thank you for the response Davin. The problem then becomes that ALL searches would be limited to the space defined (i.e., glossary). I want people to be able to perform global searches for content as normal, but restrict the search to the glossary space when they specifically want to search for a glossary term.

Davin Studer Community Champion Oct 06, 2014

Ok. If you set it to global search (conf_all) then you can put "stuff AND spacekey:???" in the search field and you should get the results only for that space.

1 vote
Boris Berenberg Community Champion Oct 06, 2014

There isn't a great way to do this. What you can do is to configure the documentation theme to restrict search within the space the user is viewing. Take a look at: For this to work in your scenario, the user would have to be within the GLOSSARY space to begin with. You could also put GLOSSARY into the page name, and then use that as part of the search to make it more accurate?

Thank you Boris. I was hoping to streamline the glossary search so a user wouldn't have to navigate to the glossary space before performing their search. If they have to navigate to the space first, they can just use the existing space search box in the left nav, or i can put a space search box on each page in the glossary. Either way, this requires several clicks in the workflow to get to the term search: 1) Click on Spaces 2) Select Space Directory 3) Filter for Glossary 4) Click on Glossary 5) Enter Search term in the left nav search box (of course, this may be short-cutted a little for savvy users who use favorite spaces or bookmarks - but we can't rely on that) The workflow I would like to see is this: 1) Go to the global search box at the top any confluence page and enter GLOSSARY: yourSearchTerm - while maintaining the ability to perform global content searches by omitting 'GLOSSARY:' from the search query. It seems like the ability to use a SPACEKEY in the global search would be a useful feature.

Boris Berenberg Community Champion Oct 06, 2014

I totally agree with you and encourage you to file a suggestion for this at:

Gary -

Unless I am misunderstanding what you are asking, there is not an add-on BUT this is not a very hard plugin to adjust the global search bar to work this way, where it defaults to all spaces, but has perhaps a dropdown to select a space (i.e., glossary, etc.).. 

Or - put the livesearch macro in a central page. Type:


in the page. Save the page. Edit it, and double click on the macro to edit additional parameters including a space key if want to limit (All the parameters are defined here - if you want to do direct using the "insert wiki markup" option.)

It this really bugs you or your users - we can create that "plugin" with UX modification as described in your Confluence system for you quickly. Know that as a separate plugin, it will not affect your upgrades, but might require modification between upgrades.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

292 views 2 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you