2012-03-29 84 views
2

我剛纔重建索引我Magenot安裝運行V1.6的數據,現在我得到一個消息,說明Magento的 - 有與重建索引過程中的問題 - 目錄產品

There was a problem with reindexing process. 

分類產品現在沒有任何產品顯示在任何類別中。我需要儘快解決這個問題,因爲它發生在一個現場。

有沒有人有任何想法可能會導致此問題以及該修復程序是什麼?

我已經嘗試刪除var/report和var/locks上的內容,但沒有快樂。似乎有一些修正,但沒有專門針對分類產品

在此先感謝

+1

你有shell嗎?然後嘗試從shell('php shell/indexer.php reindexall')開始索引處理。 – Simon 2012-03-29 14:35:32

回答

6

這可能是什麼

重新索引過程出現問題。

當PHP異常從reindexProcessAction操作冒泡到曲面時發生錯誤。你可以在這裏看到這個代碼。

#File: app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php 
public function reindexProcessAction() 
{ 
    $process = $this->_initProcess(); 
    if ($process) { 
     try { 
      Varien_Profiler::start('__INDEX_PROCESS_REINDEX_ALL__'); 

      $process->reindexEverything(); 
      Varien_Profiler::stop('__INDEX_PROCESS_REINDEX_ALL__'); 
      $this->_getSession()->addSuccess(
       Mage::helper('index')->__('%s index was rebuilt.', $process->getIndexer()->getName()) 
      ); 
     } catch (Mage_Core_Exception $e) { 
      $this->_getSession()->addError($e->getMessage()); 
     } catch (Exception $e) { 
      $this->_getSession()->addException($e, 
       Mage::helper('index')->__('There was a problem with reindexing process.') 
      ); 
     } 
    } else { 
     $this->_getSession()->addError(
      Mage::helper('index')->__('Cannot initialize the indexer process.') 
     ); 
    } 

    $this->_redirect('*/*/list'); 
} 

具體地,該線

Mage::helper('index')->__('There was a problem with reindexing process.') 

到該錯誤的底部的最快的方法是使得它打印出異常消息暫時改變上述行。 Magento壓制默認的異常消息 - 可能是爲了防止最終用戶看到「醜陋」的PHP錯誤。將以上內容更改爲:

Mage::helper('index')->__('There was a problem with reindexing process. ' . $e->getMessage()) 

然後再次重新索引。 PHP錯誤消息應該指向問題代碼,它將包含在錯誤消息中。這應該有助於指出導致索引失敗的確切問題。

+0

它現在顯示和錯誤**無法初始化索引器進程**我嘗試添加。 $ e-> getMessage())到行尾Mage :: helper('index') - > __('無法初始化索引器進程'),但它沒有顯示任何內容。你有什麼想法可能是什麼問題? – 2012-03-29 20:40:25

+0

好吧,如果你得到一個不同的錯誤,上面的代碼將永遠不會運行。如果_initProcess中的代碼無法運行,則會引發「無法初始化索引器進程」,只有當進程頁面未傳遞請求標識參數時纔會發生這種情況。這應該足以讓你繼續。祝你好運! – 2012-03-29 21:03:16

+0

好吧,我明白,_initProcess不能運行,這就是爲什麼我得到的錯誤,但我不知道該從哪裏去排序問題了。當我運行reindex時,有沒有辦法讓我輸出錯誤?我真的很感謝你的幫助,因爲我在這裏有點深刻! – 2012-03-30 10:07:06

0

這裏是我工作:

  1. 發現core_url_rewrite,備份則該表截斷它。

  2. 清除所有兌現

  3. 重新索引目錄索引的索引管理重寫

都應該現在好了......

+0

不能正常工作.... – urfusion 2015-04-22 19:03:39

2

嗨,老兄,你可以截斷目錄表,並再次運行重新索引,它會用一個更具魅力.. 表名截斷catalog_product_flat_ *

「注意:在數據庫進行任何更改之前進行備份「 mysqldump [dbname]> [anyname] .sql

2

在這裏我找到了另一個解決方案及其工作。 我首先創建reindex.php,它在我的根文件夾,然後放在過去下面的代碼

require_once 'app/Mage.php'; 
umask(0); 
Mage :: app("default"); 
Mage::log("Started Rebuilding Search Index At: " . date("d/m/y h:i:s")); 
$sql = "truncate csr_catalogsearch_fulltext;"; 
$mysqli = Mage::getSingleton('core/resource')->getConnection('core_write'); 
$mysqli->query($sql); 
for ($i = 1; $i <= 9; $i++) { 
    $process = Mage::getModel('index/process')->load($i); 
    $process->reindexAll(); 
} 
echo Mage::log("Finished Rebuilding Search Index At: " . date("d/m/y h:i:s")); 

運行此文件後(www.example.com/reindex.php) 我像一個錯誤信息作爲..

 
General error: 1005 Can't create table catalog_category_flat_store_1' (errno: 150) 

然後,我只是在我的數據庫中運行以下查詢。像

ALTER TABLE catalog_category_entity ENGINE=INNODB; 
ALTER TABLE core_store ENGINE=INNODB; 

然後清理所有緩存並從amdin面板運行重新索引過程,並且它已成功運行。 我建議我不確定它是否會幫助解決您的問題。

+0

真棒非常有幫助.. – 2014-01-08 12:45:32