If you have problems indexing with Search API and see these symptoms:
Seeing PHP "Out Of Memory" errors when running Search API indexing operations.
... or seeing errors like these:
Could not index items on index '[index name]' because pending server tasks could not be executed.
.. or ..
SearchApiException: Could not index items since important pending server tasks could not be performed.And having a large amount of items in the search_api_task MySQL table, for example:
# EXAMPLE: Get number of rows in search_api_task table.
MYSITE@web-12345:/var/www/html/MYSITE/docroot$ echo "select count(1) FROM search_api_task" |drush --uri=MYSITE.COM sql-cli
count(1)
5361339# Run this within your Acquia server. EDIT THE --uri=XXX option to match your site.
# WARNING: THIS is a destructive operation. You should make a DB backup first!
echo TRUNCATE search_api_task |drush --uri=MYSITE.COM sql-cliAfter these steps, you will need to tell Search API to reindex your site.
One possible cause is that the Search API "tasks" table (which queues Search API operations for later processing) is too large.
The Search API "tasks" table balloons when...