Since the Enterprise_Search module adds a cronjob, which runs every day by default at 3am, I found a better solution than adding a line of code to the shell/abstract.php file.
All you have to do is create a small module that adds a specific event to the global namespace instead of the administrator:
<?xml version="1.0"?> <config> <modules> <YourNamespace_YourModuleName> <version>0.0.1</version> </YourNamespace_YourModuleName> </modules> <global> <events> <catelogsearch_searchable_attributes_load_after> <observers> <enterprise_search> <class>enterprise_search/observer</class> <method>storeSearchableAttributes</method> </enterprise_search> </observers> </catelogsearch_searchable_attributes_load_after> </events> </global> </config>
Remember to activate your module by placing another configuration file in app/etc/modules/YourNamespace_YourModuleName.xml :
<?xml version="1.0"?> <config> <modules> <YourNamespace_YourModuleName> <active>true</active> <codePool>local</codePool> <depends> <Enterprise_Search/> </depends> </YourNamespace_YourModuleName> </modules> </config>
Now you can restore the Solr index from the command line by issuing the following command from the Magento root folder (provided that you have access to the shell, of course):
php shell/indexer.php --reindex catalogsearch_fulltext
source share