Forums

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

Confluence Search API (/wiki/rest/api/search) Not Returning Accurate Results Compared to UI Search

Himanshu Ganglani
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!
October 30, 2024

Problem Statement: 
We are using the Confluence Cloud API for advanced search with CQL, but we are experiencing discrepancies between the search results from the Confluence UI and the API. We are using following CQL query

API doc: 
https://developer.atlassian.com/server/confluence/advanced-searching-using-cql/ 

CQL
:  title~"custom"++OR+title~"applications"


In the UI, the results differ significantly from those returned by the API.

Expected Behavior:

The API search should return the same results as the UI search when using equivalent search criteria.

Actual Behavior:

The API search should be similar to ui search results

Needs Investigation ?

  1. Are there any differences in how the API and UI interpret CQL queries?
  2. Could there be permission issues that affect API searches differently from UI searches?
  3. Are there any known limitations or bugs with the API search functionality?
  4. How can we debug the API request to understand why it's not returning results?

1 answer

0 votes
Marc - Devoteam
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 Leaders.
November 1, 2024

Hi @Himanshu Ganglani 

Welcome to the community.

Can you share the results and the difference from both searches?

Do mind the documentation you used is based on an on-prem installation of Confluence not Cloud!

The APi's are very different.

Cloud documentation on CQL, advanced-searching-using-cql 

Himanshu Ganglani
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 3, 2024

Hi @Marc - Devoteam ,

We're using the Cloud API and a cloud instance for Confluence.

Could you please help me correct the CQL so that it returns the same results in the API as in the UI search?

Marc - Devoteam
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 Leaders.
November 5, 2024

Hi @Himanshu Ganglani 

What are the differences you see, searching via the GUI or API?

And in my opinion the API call should be: cql=title~"test"%20OR%20title~"jira"

Keep in mind that the limit of returned information is 25 results.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events