2013-10-09 49 views
1

是否有可能運行一些代碼或更改一個設置,當我登錄或類似的東西時會自動重建索引?Magento - 重建沒有索引管理頁面的索引?

的問題是任何時候,我瀏覽到索引管理我得到以下錯誤:

404錯誤未找到 頁。

這個問題似乎在我管理員視圖中的多個地方彈出。

在此先感謝。

回答

4

我建議你修復這些文件,並通過管理界面來完成。

但是,您可以在命令行中嘗試使用 。

cd [MAGENTO_ROOT]/shell/ 
php indexer.php --status 

這會告訴你索引器的狀態。之後,你可以運行下面的命令:

php indexer.php --reindex catalog_product_attribute 

這將重新索引catalog_product_attribute,對於要重新索引藏漢別人做到這一點。 下面是參數列表,你可以使用

catalog_product_attribute Product Attributes 
catalog_product_price Product Prices 
catalog_url Catalog Url Rewrites 
catalog_product_flat Product Flat Data 
catalog_category_flat Category Flat Data 
catalog_category_product Category Products 
catalogsearch_fulltext Catalog Search Index 
cataloginventory_stock 
1

你甚至不應該從後端重新索引。你可以從命令行執行它:

> php shell/indexer.php reindexall 

這將工作,但你仍然需要解決你的問題。該頁面不應該說404.
檢查var/log文件夾的錯誤。

2

您可以在magento的根目錄下創建一個新的php文件,並將以下代碼粘貼到文件中並手動運行它,或者您可以創建一個方法在admin_session_user_login_success上運行並添加用於重新索引數據的代碼。

include '/app/Mage.php'; 
Varien_Profiler::enable(); 
Mage::setIsDeveloperMode(true); 
ini_set('display_errors', 1); 
umask(0); 
Mage::app('default'); 
Mage::register('isSecureArea', 1); 

for($i=1;$i<=9;$i++){ 
    Mage::getModel('index/process')->load($i)->reindexAll(); 
} 
0

嘗試使用cron作業重新索引。

你只需要添加一個cron作業,它會根據你的給定時間重新索引。 謝謝,