2013-04-16 260 views
2

這是一個Magento問題 - 使用企業版。不幸的是,他們的技術支持人員都在舊金山,而且我在英國,所以他們對我的支持僅限於一定的時間窗口。Magento索引管理問題,產品不在類別頁面中顯示

我有活躍的類別,設置爲顯示產品和/或產品和靜態塊,並且是默認根類別的子類別。

我也有測試產品,這些測試產品有庫存數量,在目錄,搜索中可見,並且分配給這些子類別。

問題是,我的測試產品(或任何產品!)未顯示在類別頁面上。我使用的是默認/默認主題,並沒有改變page_layout。

我已清除/清除所有緩存並重新編制索引。

但是,我的大多數索引顯示爲「SCHEDULED」狀態,並且從未更新過 - 旁邊沒有複選框,因此我無法選擇它們來「重新索引數據」。

查看截圖。

Magento - Index Management

如果任何人有關於如何解決此問題的任何線索,我會很高興。

感謝

+0

第一次看到這樣的事情:( – RIK

+0

不知道很多關於索引,但可以是任何自定義擴展是在衝突狀態。請嘗試關閉該關閉 – RIK

回答

3

重新編制在一定程度上需要顯示在前面的產品,特別是如果你已經平表啓用(管理員面板>系統>配置>目錄>前端:「使用平面目錄類別」和「使用平面目錄產品「)。

索引的情況有點奇怪。這你做你的本地工作站上,或者您有機會獲得殼牌公司託管,您可以手動運行此命令強制指標:

pwd$ php shell/indexer.php reindexall

如果已經啓用了平表,你可以嘗試禁用它們,以檢查如果產品在前面可見。

您還需要將正確的權限放在var和media文件夾及其內容上。 755應該沒問題。

+0

平板目錄類別和使用平面目錄的產品是都設置爲'否',因爲他們一直是。 變量和媒體文件夾也設置爲0755.我沒有改變任何東西在這裏。 我正在一個活的臨時環境,但我不熟悉殼腳本。 仍然沒有運氣 – digiwig

0

這真的很有趣,我最近有一個類似的問題,其中一個reindex沒有完全工作。但我沒有安排被顯示。

我可以問問您使用的是哪個版本的Enterprise?

由於Ventus建議強制重新建立索引的經過驗證的方法是使用shell腳本,要做到這一點,您需要SSH到您的服務器。然後使用cd命令(更改目錄)到您的網站在文件系統上的位置。例如。 CD /無功/網絡/ ....

從這裏運行php殼/ indexer.php reindexall

+0

Magento的版本。1.13.0.0 – digiwig

0
  1. 設置cron來運行,這將重新索引需要提供你沒有更改的crontab值的照顧。

從你的屏幕看起來你從來沒有在這個設置上運行cron。

1

問題已解決。謝謝你們的答案,但它不是以上所述。

我已經錯誤地安裝了產品功能模塊。我是在假設,在app/code/local/...開發時,任何不起作用將回落到應用程序/代碼/核心/ ...

可悲的是,情況並非如此。我的錯,每個人都知道做出假設的短語。

Magento的學習曲線非常陡峭!

+0

我有同樣的問題,只有前兩個在已顯示dex狀態,其餘部分顯示「已安排」。 你能否給我提供一些指引,你是如何解決這個問題的。 現在看到所有的索引嗎?我正在使用1.13.0版本 謝謝 – p4pravin

0

將下面的代碼放到magento安裝中的.php文件中,然後從您的URL中運行它,這將清理並重新索引所有內容。你可以從cron作業運行它。任何錯誤,然後你有一個問題與你的數據庫在巫婆的情況下,你應該備份,然後重新創建一個新的數據庫實例。

<?php 

set_time_limit(0); 
require_once dirname(__FILE__) . '/app/Mage.php'; 


//get all stores 

$websites = Mage::app()->getWebsites(); 
$thisstore = $websites[1]->getDefaultStore()->getCode(); 



echo "Store: ".$thisstore."<br/>"; 

//clean var dir 

$dirs = array(
     'downloader/.cache/*', 
     'var/cache/', 
     'var/locks/', 
     'var/log/', 
     'var/report/', 
     'var/minifycache/', 
     'var/mincache/', 
     'var/tmp/' 
    ); 

    foreach($dirs as $v => $k) { 
     exec('rm -rf '.$k); 
    } 
/* 
//clean out sessions 
$dirs = array('var/session/'); 

    foreach($dirs as $v => $k) { 
     exec('rm -rf '.$k); 

    } 
*/ 
//clean db log files 
$xml = simplexml_load_file('./app/etc/local.xml', NULL, LIBXML_NOCDATA); 
$db['host'] = $xml->global->resources->default_setup->connection->host; 
$db['name'] = $xml->global->resources->default_setup->connection->dbname; 
$db['user'] = $xml->global->resources->default_setup->connection->username; 
$db['pass'] = $xml->global->resources->default_setup->connection->password; 
$db['pref'] = $xml->global->resources->db->table_prefix; 
global $db; 

    $tables = array(
     'catalogsearch_fulltext', 
     'dataflow_batch_export', 
     'dataflow_batch_import', 
     'log_customer', 
     'log_quote', 
     'log_summary', 
     'log_summary_type', 
     'log_url', 
     'log_url_info', 
     'log_visitor', 
     'log_visitor_info', 
     'log_visitor_online', 
     'importexport_importdata', 
     'core_url_rewrite', 
     'report_viewed_product_index', 
     'report_event', 
     'core_cache', 
     'core_cache_option', 
     'core_cache_tag' 
    ); 

    mysql_connect($db['host'], $db['user'], $db['pass']) or die(mysql_error()); 
    mysql_select_db($db['name']) or die(mysql_error()); 

    foreach($tables as $v => $k) { 
     mysql_query('SET FOREIGN_KEY_CHECKS=0; '.'TRUNCATE `'.$db['pref'].$k.'`;'.' SET FOREIGN_KEY_CHECKS=1; ') or die(mysql_error()); 
    } 

///---------------------------------// 
// now run standard magento cleanup file 


## Function to set file permissions to 0644 and folder permissions to 0755 

function AllDirChmod($dir = "./", $dirModes = 0755, $fileModes = 0644){ 
    $d = new RecursiveDirectoryIterator($dir); 
    foreach(new RecursiveIteratorIterator($d, 1) as $path){ 
     if($path->isDir()) chmod($path, $dirModes); 
     else if(is_file($path)) chmod($path, $fileModes); 
    } 
} 

## Function to clean out the contents of specified directory 

function cleandir($dir) { 

    if ($handle = opendir($dir)) { 
     while (false !== ($file = readdir($handle))) { 
      if ($file != '.' && $file != '..' && is_file($dir.'/'.$file)) { 
       if (unlink($dir.'/'.$file)) { } 
       else { echo $dir . '/' . $file . ' (file) NOT deleted!<br />'; } 
      } 
      else if ($file != '.' && $file != '..' && is_dir($dir.'/'.$file)) { 
       cleandir($dir.'/'.$file); 
       if (rmdir($dir.'/'.$file)) { } 
       else { echo $dir . '/' . $file . ' (directory) NOT deleted!<br />'; } 
      } 
     } 
     closedir($handle); 
    } 

} 

function isDirEmpty($dir){ 
    return (($files = @scandir($dir)) && count($files) <= 2); 
} 

// rebuild everything!!! 
$processes = Mage::getSingleton('index/indexer')->getProcessesCollection(); 
$processes->walk('setMode', array(Mage_Index_Model_Process::MODE_REAL_TIME)); 
$processes->walk('save'); 

$processes->walk('reindexAll'); 
$processes->walk('reindexEverything'); 

echo "----------------------- CLEANUP START -------------------------<br/>"; 
$start = (float) array_sum(explode(' ',microtime())); 
echo "<br/>*************** SETTING PERMISSIONS ***************<br/>"; 
echo "Setting all folder permissions to 755<br/>"; 
echo "Setting all file permissions to 644<br/>"; 
AllDirChmod("."); 
echo "Setting pear permissions to 550<br/>"; 


echo "<br/>****************** CLEARING CACHE ******************<br/>"; 

if (file_exists("var/cache")) { 
    echo "Clearing var/cache<br/>"; 
    cleandir("var/cache"); 
} 

if (file_exists("var/session")) { 
    echo "Clearing var/session<br/>"; 
    cleandir("var/session"); 
} 

if (file_exists("var/minifycache")) { 
    echo "Clearing var/minifycache<br/>"; 
    cleandir("var/minifycache"); 
} 

if (file_exists("downloader/pearlib/cache")) { 
    echo "Clearing downloader/pearlib/cache<br/>"; 
    cleandir("downloader/pearlib/cache"); 
} 

if (file_exists("downloader/pearlib/download")) { 
    echo "Clearing downloader/pearlib/download<br/>"; 
    cleandir("downloader/pearlib/download"); 
} 

if (file_exists("downloader/pearlib/pear.ini")) { 
    echo "Removing downloader/pearlib/pear.ini<br/>"; 
    unlink ("downloader/pearlib/pear.ini"); 
} 

if (file_exists("media/catalog/product/cache/")) { 
    echo "Removing media/catalog/product/cache/<br/>"; 
    unlink ("media/catalog/product/cache/"); 
} 

if (file_exists("media/tmp/")) { 
    echo "Removing media/tmp/<br/>"; 
    unlink ("media/tmp/"); 
} 
date_default_timezone_set("Europe/London"); 
echo "Start Cleaning all caches at ... " . date("Y-m-d H:i:s") . "<br/>"; 
ini_set("display_errors", 1); 

Mage::app('admin')->setUseSessionInUrl(false); 
Mage::getConfig()->init(); 

$types = Mage::app()->getCacheInstance()->getTypes(); 

try { 
    echo "Cleaning data cache... <br/>"; 
    flush(); 
    foreach ($types as $type => $data) { 
     echo "Removing $type ... "; 
     echo Mage::app()->getCacheInstance()->clean($data["tags"]) ? "[OK]" : "[ERROR]"; 
     echo "<br/>"; 
    } 
} catch (exception $e) { 
    die("[ERROR:" . $e->getMessage() . "]"); 
} 

echo "<br/>"; 

try { 
    echo "Cleaning stored cache... "; 
    flush(); 
    echo Mage::app()->getCacheInstance()->clean() ? "[OK]" : "[ERROR]"; 
    echo "<br/>"; 
} catch (exception $e) { 
    die("[ERROR:" . $e->getMessage() . "]"); 
} 

try { 
    echo "Cleaning merged JS/CSS..."; 
    flush(); 
    Mage::getModel('core/design_package')->cleanMergedJsCss(); 
    Mage::dispatchEvent('clean_media_cache_after'); 
    echo "[OK]<br/>"; 
} catch (Exception $e) { 
    die("[ERROR:" . $e->getMessage() . "]"); 
} 

try { 
    echo "Cleaning image cache... "; 
    flush(); 
    echo Mage::getModel('catalog/product_image')->clearCache(); 
    echo "[OK]<br/>"; 
} catch (exception $e) { 
    die("[ERROR:" . $e->getMessage() . "]"); 
} 

echo "<br/>************** CHECKING FOR EXTENSIONS ***********<br/>"; 
If (!isDirEmpty("app/code/local/")) { 
    echo "-= WARNING =- Overrides or extensions exist in the app/code/local folder<br/>"; 
} 
If (!isDirEmpty("app/code/community/")) { 
    echo "-= WARNING =- Overrides or extensions exist in the app/code/community folder<br/>"; 
} 
$end = (float) array_sum(explode(' ',microtime())); 
echo "<br/>------------------- CLEANUP COMPLETED in:". sprintf("%.4f", ($end-$start))." seconds ------------------<br/>"; 

//sitemap refresh 
$collection = Mage::getModel('sitemap/sitemap')->getCollection(); 
    foreach ($collection as $sitemap) { 
     try { 
      $sitemap->generateXml(); 
     } 
     catch (Exception $e) { 
      $errors[] = $e->getMessage(); 
     } 
    } 

?> 
相關問題