How to monitor Re-indexing progress through REST API
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Purpose
REST API might be helpful to automate some operations on Confluence. If there is a need to automate and monitor progress made on Re-indexing, this can be achieved through the suggestion below.
Solution
- Environment variables we need be aware of prior to executing the curl command.
USER_NAME=<username> ### You must be Confluence Administrator
USER_PASSWORD=<user password>
CONFLUENCE_BASEURL=<Confluence Base URL> ### FQDN and context path without the trailing slash
- Now run the curl command like the example below after replacing username, password and the Confluence Base URL
curl -u <username>:<password> -X GET "http://localhost:8090/json/reindextaskprogress.action" | python -mjson.tool
- You will ideally see an output like this
{
"compactElapsedTime": "12:12:17",
"count": "3020121",
"percentageComplete": "67",
"total": "2051956"
}
Here the compactElapsedTime represents the time since the re-indexing has started. Count represents the number items to be indexed. PercentageComplete denotes the progress made so far since. the re-indexing has been kicked off. Finally, total represents the number of items those are indexed already.