Reindex Drupal's Search API module indexes programmatically
I had recently found the need to manually reindex the Search API indexes programmatically after performing some other operation. The code snippet below will do just that for you :)
// Load Search API Index.
$search_api_index = search_api_index_load('SEARCH_API_INDEX_NAME');
// Clear the index.
Refer to Search API documentation here:
By the way, this was tested working with Search API 7.x-1.6.
Hope this helps somebody out there!