Full text Search API for documents

Raj Kishor Singh
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!
February 23, 2020

Hi Folks i want to know does Confluence API support or provide results for full text data ie. content of  documents. I can see for blogs and pages we can retrieve the body, but not sure is it possible for uploaded word or pdf documents.

 

thanks,

Raj

1 answer

1 accepted

2 votes
Answer accepted
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 24, 2020

Hey Raj,

Welcome to the Community! You can indeed use the API to search the text of documents for indexable content (Word, Text, PowerPoint, Excel, PDF, and HTML). The mechanism for searching via API is CQL - here are the documents on all the available search operators.

The text parameter includes the contents of attachments. For example, if I've got a text attachment that contains the word "potato", this search will return it:

https://mysite.atlassian.net/wiki/rest/api/content/search?cql=text ~ "potato"

 

For completeness (although you're asking about Cloud), I'll mention that Confluence Server would use the contentBody parameter for searching instead of the text parameter. Just a slight difference to note for anyone else finding this via Google search and looking for Server help.

Hope that helps!

Cheers,
Daniel

crazy_rationalist
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!
June 13, 2024

Hey Daniel,

I am using CQL search, but sometimes the results for the search term return empty. When I do the same search manually in Confluence, I get loads of results. So, is there a way to replicate the manual search with the API?

Here's an example for the search term: "What is the per diem costs allowed to be reimbursed for business trips to Paris?"

Manual search returning multiple results:

Screenshot 2024-06-13 at 12.16.06 PM.png

API search returning zero results:

Screenshot 2024-06-13 at 12.17.38 PM.png

 

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events