Magento索引管理问题,产品未显示在类别页面中
这是一个Magento问题-使用企业版。不幸的是,他们的支持技术人员都在旧金山,我的总部设在英国,所以他们对我的支持被限制在一定的时间窗口。 我有活动的类别,设置为显示产品和/或产品和静态块,是默认根类别的子类别 我也有测试产品,它们是启用的,有库存,有数量,在目录中可见,搜索,并分配给这些子类别 问题是,我的测试产品(或任何产品!)不会显示在类别页面上。我正在使用默认/默认主题,并且没有更改页面布局 我已清除/刷新所有缓存,并重新编制索引 但是,我的大多数索引显示为“已计划”状态,并且从未更新过-这些索引旁边没有复选框,因此我无法将它们选择为“重新索引数据” 请看屏幕截图 如果有人对如何解决这个问题有任何线索,我将非常高兴Magento索引管理问题,产品未显示在类别页面中,magento,indexing,product,Magento,Indexing,Product,这是一个Magento问题-使用企业版。不幸的是,他们的支持技术人员都在旧金山,我的总部设在英国,所以他们对我的支持被限制在一定的时间窗口。 我有活动的类别,设置为显示产品和/或产品和静态块,是默认根类别的子类别 我也有测试产品,它们是启用的,有库存,有数量,在目录中可见,搜索,并分配给这些子类别 问题是,我的测试产品(或任何产品!)不会显示在类别页面上。我正在使用默认/默认主题,并且没有更改页面布局 我已清除/刷新所有缓存,并重新编制索引 但是,我的大多数索引显示为“已计划”状态,并且从未更新
感谢您,在前端显示产品时需要Reindex,特别是当您启用了平面表格时(管理面板>系统>配置>目录>前端:“使用平面目录类别”和“使用平面目录产品”) 索引的情况有点奇怪。如果您在本地工作站上执行此操作,或者您在主机上有权访问shell,则可以通过运行以下命令手动强制执行索引:
pwd$php shell/indexer.php reindexall
若你们已经启用了平板,你们可以试着禁用它们,以检查产品是否在正面可见
您还需要对var和媒体文件夹及其内容设置正确的权限。755应该可以。在前端显示产品时需要Reindex,尤其是在启用了平板表的情况下(管理面板>系统>配置>目录>前端:“使用平板目录类别”和“使用平板目录产品”) 索引的情况有点奇怪。如果您在本地工作站上执行此操作,或者您在主机上有权访问shell,则可以通过运行以下命令手动强制执行索引:
pwd$php shell/indexer.php reindexall
若你们已经启用了平板,你们可以试着禁用它们,以检查产品是否在正面可见
您还需要对var和媒体文件夹及其内容设置正确的权限。755应该可以。这真的很有趣,我最近遇到了一个类似的问题,reindex没有完全工作。然而,我没有被安排展示 请问您使用的是什么版本的Enterprise 正如Ventus所建议的,强制重新索引的一种经过尝试和测试的方法是使用shell脚本,要做到这一点,您需要SSH到您的服务器中。然后使用cd命令(更改目录)将您的网站定位到文件系统中的位置。例如cd/var/www/
从这里运行php shell/indexer.php reindexall这真的很有趣,我最近遇到了一个类似的问题,reindex没有完全工作。然而,我没有被安排展示 请问您使用的是什么版本的Enterprise 正如Ventus所建议的,强制重新索引的一种经过尝试和测试的方法是使用shell脚本,要做到这一点,您需要SSH到您的服务器中。然后使用cd命令(更改目录)将您的网站定位到文件系统中的位置。例如cd/var/www/ 从这里运行php shell/indexer.php reindexall
从屏幕上看,您似乎从未在此设置上运行过cron。问题已解决。谢谢你们的回答,但不是上面提到的 我错误地安装了产品功能模块。我假设在app/code/local/中开发时。。。任何不起作用的东西都会退回到app/code/core/ 遗憾的是,情况并非如此。是我的错,每个人都知道做假设这句话
Magento的学习曲线非常陡峭 问题解决了。谢谢你们的回答,但不是上面提到的 我错误地安装了产品功能模块。我假设在app/code/local/中开发时。。。任何不起作用的东西都会退回到app/code/core/ 遗憾的是,情况并非如此。是我的错,每个人都知道做假设这句话
Magento的学习曲线非常陡峭 将下面的代码放入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();
}
}
?>
全局->资源->默认设置->连接->主机;
$db['name']=$xml->global->resources->default\u setup->connection->dbname;
$db['user']=$xml->全局->资源->默认设置->连接->用户名;
$db['pass']=$xml->全局->资源->默认设置->连接->密码;
$db['pref']=$xml->global->resources->db->table\u前缀;
全球$db;
$tables=数组(
“目录搜索全文”,
“数据流批量导出”,
“数据流\u批量\u导入”,
“记录客户”,
“日志”,
“日志摘要”,
“日志摘要类型”,
“日志url”,
“日志url\u信息”,
“日志访问者”,
“记录访客信息”,
“登录访客在线”,
“importexport_importdata”,
“核心url重写”,
“报告(已查看)(产品)(索引)”,
“报告事件”,
“核心缓存”,
“核心缓存选项”,
'核心(c)