Livesearch Macro - Restrict to labels: Possible to work with AND & OR?
Asked by Oliver Mettauer:

Hi,

I am working on a wiki-platform, which is based in an own space. Due to this, I implemented the livesearch macro on the space homepage.

As known, it is possible to include defined labels (hope exclude will once be available too). I would like to add certain labels, so i get only pages of interest as result.

It seems that in preview search, the macro search the content with Label A "OR" B. After clicking enter the result appears with Label A "AND" B, means also: no results, because none of the pages have both labels.

Is there a way to add a AND or OR rule in the livesearch macro settings?

Thank you very much for your help!

Regards

Oliver


Answers:
author: AdilusPrimus
body: Three years have passed since, and still the same issue for that Macro: any work around for setting a specific alignment of labels in the settings?

Thanks!


author: Diego
body: Hello there, [@Oliver Mettauer](/t5/user/viewprofilepage/user-id/3668395) !

As I understand, ++*you need to have the OR operator in your Livesearch Macro*++ . Looking through our documentation, I++*can tell you that the label list we specify is indeed an AND operator.*++ Here is an excerpt from our documents about the label parameter:
> *Specify labels to limit the search to content with that label. If unspecified will search all content regardless of label.*

Here is the whole page:
> * ++**[\[Confluence Server\] Livesearch Macro](https://confluence.atlassian.com/doc/livesearch-macro-163415902.html)**++

However, ++*we can still use the OR operator within the search field itself*++. Here is an example:
> 1. *Create a label named old*
> 2. *Create a label named new*
> 3. *Label pages with one or the other*
> 4. *In the Livesearch Macro, type this:*
>    1. *labelText:old OR labelText:new*
> 5. *The results should display all pages that contain at least one of the labels*

Also, here is a couple of documents on Labeling and Search that will surely help! Take a look:
> * ++**[\[Confluence Server\] Add, Remove and Search for Labels](https://confluence.atlassian.com/doc/add-remove-and-search-for-labels-136419.html)**++
> * ++**[\[Confluence Server\] Confluence Search Syntax](https://confluence.atlassian.com/doc/confluence-search-syntax-158720.html#ConfluenceSearchSyntax-searchbylabel)**++

I hope this helps you out! Looking forward to your reply.

comments: author: Oliver Mettauer
body: Hi Diego

Thank you very much for your answer. Happy to get that detailed help here.

Indeed I already checked the article with the search syntax, the mentioned syntax labelText works fine with me. What I would like to know is if I can add an OR-Rule in the settings of the macro.

Regarding the description "restrict to label(s)" i am only allowed to separate the predefined labels with commas. When using the macro, the live preview seems to use an "OR"-Rule and the detail search (after clicking enter) an AND-Rule (the labels are set in separate filters).

Is there a way I can set "*labelText:old OR labelText:new"*in the macro settings? Or can I solve the problem by adding the livesearch by Wiki Markup?


author: Romain Prieur
body: Hello,  

I have the exactly same issue "When using the macro, the live preview seems to use an "OR"-Rule and the detail search (after clicking enter) an AND-Rule (the labels are set in separate filters)."  

Any update on this Topic?

Thanks for helping


author: Anden
body: Hi [@Diego](/t5/user/viewprofilepage/user-id/1188952)

I am also facing the same issue as Romain and Oliver. Are there any updates for this?

Thank you,

Anden


author: Martin Heini
body: So I am.


author: Khloe Salmon
body: I'm also having this issue - is there any update on an OR rule for the Livesearch?

Many thanks

Khloe


Tags: confluence-server

label

macro

server