non-canned label searching against specified Spaces


Trying to find a way, whereby Confluence users can search for labels across several spaces (i.e. a space category as opposed to a single space or all spaces). The user enters a label into a search box (so not a pre-canned search query) and it only searches for the label in a number of specified spaces (possibly using a space category)

With the current confluence search macros
1. Existing search macro work either or a single space or all spaces
2. To specify a label you need to do so by adding a filter following the initial search
Would like to achieve this type of searching without having to develop customised code or using the labelText syntax
I have searched for plug-ins to address this and have not managed to locate any. Has anyone found a solution to the above challenge ?

2 answers

You can almost get there with standard CQL. Something like

space.title ~ "space" and type=page

would return all pages in spaces which contain "space" in their name.

Unfortunately there doesn't seem to be any extension for space category like space.category or space.label.

Are you running Confluence Server? Scriptrunner for Confluence would be able to help you out here as it includes a CQL Search macro and has an option to write an extension to CQL that could include the space category. However, as far as I know, this is not a built in element, so code would have to be written (although there are examples on the documentation page). 

Otherwise you can search multiple spaces with CQL, but you have to know the space key for each space, so this probably wouldn't work so well...

Stephen thanks for your response. Running Confluence Server 6.2.2. Our end users will not be in a position to create CQL syntax. looking to have a search box that a user can provide a label and then the secrch is limited ot a number of spaces 

Hi Eamonn,

I thought about it and there might be a way to do it with a user macro. Give me some time and I'll get back to you.

My idea is to have a search box that has a predefined space category field from the editor but that will search for a particular label that is input on the page. This is what you are looking for, right?

Hi Stephen, many thanks for the response and effort - yes that is what i am looking for

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

792 views 33 5
Join discussion

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