Set Default search as current space search

Chaithra N
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.
December 16, 2013

Hi,

We have a requirement to set search to do searching only for current space. Can anybody let us know how this can be set at space level or at gobal level.

We need this at the default search button

Note: We are using Confluence Version 5.1.3

Thanks,

Chaithra

3 answers

1 accepted

0 votes
Answer accepted
Davin Studer
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.
December 16, 2013

Just realized that this can also be set in the Theme Configuration if you are using the Documentation Theme. Go to Confluence Admin -> Look and Feel -> Themes. Click on Configure Theme and there is a check box for limiting search to the current space.

0 votes
Holger_Wassermann_INT June 16, 2017

Documentation theme is not included in Version 6.0.

How to solve this problem now?

Any tipps for an alternative theme with a function to limiting search to the current space?

Davin Studer
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.
June 16, 2017

Here's a non-technical possibility for you. On your space home page you could put a search box on the page using the livesearch maco. One of the properties of that macro allows you to specify a space to search.

Holger_Wassermann_INT June 16, 2017

Hi Davin,

thanks for your quick reply!

Yes ok, but I still have this issue with the main search box on the top. How to solve this?

I wonder that no plugin or theme address this function.

Davin Studer
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.
June 16, 2017

That is why I provided a non-technical solution. If you want to do the searchbox you will need to do it with some Javascript. In Confluence Admins -> Look and feel -> Custom HTML add the below block.

<script type="text/javascript">
AJS.toInit(function(){
 AJS.$('#quick-search input[name="where"]').val(AJS.params.spaceKey);
});
</script>
Like Shadurskaya Valentina likes this
Davin Studer
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.
June 16, 2017

Actually, wait! It should already be limited to the current space. The above code will work, but looking at my install shows that when you type and hit enter the search page is limited to the current space. Are you referring to the dropdown that appears as you search? If so that would take some looking into.

Holger_Wassermann_INT June 16, 2017

Thanks. Let me explain it more in detail.

We have several users. Some users should not have access to the space or even profiles and names of other users. But, if I log in with some user data and use the main search box, where I type in the name of another user. This other user is getting displayed with it's name. Then, when I click on the name of that user, the profile page of this user opens. Both functions, the search result showing the name of other users and the display of the user profil page should not be possible.

Hope this makes it clear. Looking forward to your reply.

Daniel Wal November 18, 2019

@Davin Studer - So, where did you find that setting in your 'install'? 

0 votes
Davin Studer
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.
December 16, 2013

By default the top search box should only search the current space. In order to search other spaces you have to prefix the search with spaceKey:{key} {term} for a specific space or ALL:{term} for all spaces. The top search should by default only search the space you are currently in. If it doesn't then there is some non-default thing that is changing that.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events