Reindex Jira server using REST API via cURL command
There are various type of REST Client that can be use. In this example, REST request was triggered from Linux's Terminal:
To trigger indexing and locking the instance:
curl -u admin_username:admin_password -X POST $JIRAURL/rest/api/2/reindex?type=FOREGROUND
To trigger indexing without setting the type:
curl -u admin_username:admin_password -X POST $JIRAURL/rest/api/2/reindex
The default value for the type is BACKGROUND_PREFFERED
Type of re-indexing available:
- FOREGROUND - runs a lock/full reindexing
- BACKGROUND - runs a background reindexing. If JIRA fails to finish the background reindexing, respond with 409 Conflict (error message).
- BACKGROUND_PREFERRED - If possible do a background reindexing. If it's not possible (due to an inconsistent index), do a foreground reindexing.