Label Search Displays too many files, need quote marks to display correctly

Gentlefolk,

Confluence 5.8.17

I created a label: es-meetingnotes

I used this label with the macro "Content Report Table" which was instructed to search for the label: es-meetingnotes

 

The macro was instructed to display three entries. As expected the "Find more results" displayed.

When I click on the "Find more results" link, instead of seeing the expected six entries, I get 163 results.

 

It appears that this labelText: (es-meetingnotes) search was searching for:

es

 

not

 

es-meetingnotes

 

 

 

I found that when I put "es-meetingnotes" in quotes, however, the search performs correctly, displaying just the six files with the es-meetingnotes label:

 labelText: ("es-meetingnotes")

 

Atlassian support site states that using a dash is legal:

https://answers.atlassian.com/questions/38054097/what-are-the-best-practices-for-how-to-name-labels

Any idea what is going on? It isn't a big deal to remove a dash, I am just trying to figure out why the dash is allowing the search function to ignore the rest of the search term.

 

Thx!

 

 

1 answer

1 accepted

0 vote
Stephen Deutsch Community Champion Nov 17, 2016

To understand this, you have to understand how Confluence search works. Confluence uses Lucene in the background, which often breaks the content into words (refered to as tokens). By using this tokenization, Lucene can find multiple words together (in the page content, for example) even if there are one or more words in the middle.

If you look at this page: https://confluence.atlassian.com/doc/confluence-search-fields-161188.html#ConfluenceSearchFields-Pages

You can see that LabelText is also tokenized. The problem comes in that Lucene treats the dash character as a token separator, much like a space, so that is why it matches both es, meetingnotes, and es-meetingnotes. That is why you need to surround it with quotes in order to find an exact match.

Thank you, Stephen. Does this mean that underscores also causes this tokenization?

Are there characters then that do not result in this tokenization? If a dash tokenizes, then does an underscore? An asterisk? Are there special  characters are are acceptable to Confluence labels and don't tokenize the labelText Search function?

My confusion - and at this point irk - is that the available help on labels states that both dashes and underscores are legal, when in fact, they really are not.

https://answers.atlassian.com/questions/38054097/what-are-the-best-practices-for-how-to-name-labels

You have helped clarify an issue, thank you again!


Don

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

989 views 23 13
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