I would like to know how I can optimize the search in confluence.
Asked by Ellen van Beek:

We have several spaces, one of those spaces is a internal knowledeg base with artciles. Can I optimize the serach in confluence by having it search only the space the user is currently in ergo the knowledgebase? And if so, can I add other spaces the searchbar should search in?

If this is not possible, how can I optimize search with the use of labels? As far as I understand now, the labals are user based and article based and therefore not for everyone the same. When I add labels to a certain page for example the word 'Routine', I would like these pages to come up when some one searches for 'routine' in the knowledgebase.

<br />

Do you have any advice on how I can optimize the search by excluding irrelevant pages?


Answers:
author: Thomas Schlegel
body: Hi Ellen,

labels are not user specific. If you add the label "routine" to a page, then the page can be found by searching for this label by everyone who is permitted to see that page. Personal label do exist, but they are deprecated and you should not use them.

I have written an [article](https://community.atlassian.com/t5/Confluence-articles/The-Admin-s-tale-Fun-with-labels-not-with-flags/ba-p/591122) here about labels. Have you already seen that?

You can refine your search by adding one or more spaces to your search result window:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/4173i03A84F2E4E7921AC/image-size/large?v=v2&px=999 "image.png")

We also added a search field to the left sidebar using that macro in the space administration tools (Look \& Feel -\> Sidebar):

```
{livesearch:spaceKey=<your spacekey>|placeholder=Search in <your space name>?
```

The livesearch macro can be restricted to search in one or more spaces.

The spaces using this macro then looks like this:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/4175i8CAAF20E292A9F37/image-size/large?v=v2&px=999 "image.png")


author: Ellen van Beek
body: It does work when pressing return, but that is exactly not what I want haha. I would like to see the result as dropdown from the searchbar :p

comments: author: Thomas Schlegel
body: Unfortunately, that doesn't work. The dropdown is showing the best results but it is using the page titles / attachments titles / space and user names only.


author: Ellen van Beek
body: Alright, then it is up to us to search in a different way :-) Thank you for your time and help Thomas!


author: Ellen van Beek
body: Hi Thomas,

The labelling is not completely working as it should be, at least that is what I think. I have labelled an article with the word wrong and with the word details. When I search in the search bar on the right top for wrong details nothing comes up.

I do know that I can limit the searches to certain spaces through the search result window, but I actually want that we only have to use the searchbar in the top right and all relevant articles come up. Maybe my wishes go too far haha.

comments: author: Thomas Schlegel
body: Hmm, something should come up there, not as dropdown, but if you press return, you should get a result.

I've tested that here. Maybe you can have a look, if there is something different in your environment:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/4182iB6FC6FDDEC148690/image-size/large?v=v2&px=999 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/4183i9233373FC1D73496/image-size/large?v=v2&px=999 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/4185i79A92DF37FFDC027/image-size/large?v=v2&px=999 "image.png")

What happens, if you type "labelText:wrong" into the search field?


author: Ellen van Beek
body: Thank you Thomas, I will look into this and get back to you/the community if I have questions!

I had not read your article yet and what I found in the confluence explanations about labels confused me clearly haha.

comments: author: Thomas Schlegel
body: You're welcome, I hope, you won't get more confused by reading the article :-)

If you have any questions, don't hesitate to ask.