This is for any Atlassian Confluence developers or contributors reading my blog. I am trying to develop a simple plugin and wanted to use the Confluence Search (v2) API but couln’t find much in the way of documentation or examples.
So I posted a question to the Confluence Forum but got no reply in three days :(. Should anyone be able to help me, the forum thread is here but I am also reposting here the text of the question:
I’m looking for examples and guidance in using the Search (v2) API in Confluence, specifically from a plugin.
I got hold of a SearchManager via Dependency Injection and obtained some results with code like the following
SearchQuery query = ...; Search search = new Search(query, null, null); SearchResults results = this.searchManager.search(search);My problem is that I have no idea about which implementation of the SearchQuery interface to use and in particular how to specify a phrase to search for, since no subclass seems to provide for a way to set a query term.
Thanks in advance.


We probably should have mentioned this in the release notes, but the v2 search API is a work in progress at the moment. It’s something I worked on during the 2.8 cycle with the view to improve search in 2.9+, but it’s not actually used inside Confluence yet!
Keep doing search the old way for now.