Hello, I am working on a project that uses the Confluence search API. However, I am finding that when I make a search that goes over 25 characters, the API returns 0 results. When it is under 25 characters, the search works normally and returns me the list of search results. Is there a way to fix this?
For reference the way I am calling the API is with:
https://mysite.atlassian.net/wiki/rest/api/content/search?cql=text~"my search"
Hi @Dong, Kevin and welcome to the community,
According to the API documentation, limit is for pagination and not for seaching over 25 characters:
limitinteger
The maximum number of content objects to return per page. Note, this may be restricted by fixed system limits.
Default:25
, Minimum:0
, Format:int32
So what you are saying is that on the request you provided, when "my search" is over 25 characters, then the response returns 0?
Hi Alex, yes that is the case. Doing searches on larger items through the API will return nothing but using the search normally on the website using the same exact search terms will return something.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you provide an example of your text string?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, my text string is this:
search?cql=text~"Error%20code%20CAA52202"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dong, Kevin I've search with a similar text, but didn't get any error.
REST API is limited by default. I would expect the built-in functionalities to be better.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So is there no way for the API to be able to do searches on larger keywords/phrases?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But I didn't encounter any problem with searching a big phrase.
I've searched for a phrase with 88 characters:
This is a big phrase which I’m searching to find inside a confluence page on my instance
And I got results:
So I find no issue with the specific problem you are referring to. The above http request has a limitation of 25 results per page, not characters.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see. I will go look for alternative ways to bypass this issue. Thank you for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dong, Kevin can you post you whole http request, as well as the response you are getting? Because you shouldn't have a problem using long CQL text strings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And if you search from the search field inside confluence, are you getting any results? If yes, where this text is located? On the body or page title, or somewhere else?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When searching from the search field inside Confluence, I do get results. Since I'm using fuzzy search it returns all results that contain the text in both bodies and page titles.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dong, Kevin with a premium subscription, I would raise an Atlassian request to solve your problem. support.atlassian.com/contact
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.