I am trying to write something that will let me use the API to search for a given string throughout Confluence.
For example if I want to search for the string 'testString' I can use:
This appears to work as expected and returns all spaces/pages with 'testString' in the body of the page.
However I want to search across other Confluence sources such as:
It feels like this should be simple but try as I might I haven't been able to modify my existing query above to accommodate these other sources as the results are never found when I test it.
Has anyone done this before? Suggestions would be most welcome.
Thanks very much!
you are searching only on pages (type=page). Try leaving that parameter away:
This will search attachments, comments, pages & blogs. I'm pretty sure, that the page history cannot be searched.
You might want to extent the result to more than 25 hits, as it's limited to this by default.
Thank you Jan-Peter, thats just what I needed! I completely missed that I was still searching on pages.
As you say it doesn't seem to return 'history' values and I may have to leave that one for now but this gets me most of the way there.
Thanks again, really appreciated,
Also worth noting that you ought to make sure when you are searching multiple keywords either by using a search with cql=text or cql=title then you should make sure there is a + between each of the keywords (replacing the space) in your search string and the whole string must be enclosed by double quotes. So any code used may mean you need to add a regex to .replace the space characters in your string with a +
Hello Confluence Community! What if i told you that you could have a healthier life and be 100% meet-less? This month, we're promoting a healthy, balanced work diet with Confluence. We la...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events