Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

CQL "creator=currentUser() and type=page" can't get the all pages ?

山口尊広
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 2, 2020

I execute the CQL (Confluence Query Language) the following to get my all pages via rest api

creator=currentUser() and type=page

But I can't get the the pages of the SPACE key is "SSTB".

My workaround JQL is the following.

(space in (SSTB) and creator=currentUser() and type=page) or (creator=currentUser() and type=page)

But this one is for specific, not good.

Could you someone why the first CQL can't get the all pages or wrong point in CQL.

1 answer

1 accepted

0 votes
Answer accepted
Stephen Deutsch
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 Champions.
November 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.

Don Wallbaum
Contributor
November 17, 2016

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
TAGS
AUG Leaders

Atlassian Community Events