gpt4 book ai didi

php - Magento 目录搜索索引,无法初始化索引器进程

转载 作者:行者123 更新时间:2023-11-29 06:42:10 25 4
gpt4 key购买 nike

我在这里需要一些帮助,Magento 1.7.0.1 抛出错误“无法初始化索引器进程”。当我们尝试重新索引目录搜索索引时。所有其他索引都运行良好。

2013-11-28T21:32:38+00:00 DEBUG (7): Exception message: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.category_ids' in 'field list'
Trace: #0 /path_to_root/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /path_to_root/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /path_to_root/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /path_to_root/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT STRAIGHT...', Array)
#4 /path_to_root/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SELECT STRAIGHT...', Array)
#5 /path_to_root/lib/Zend/Db/Adapter/Abstract.php(734): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /path_to_root/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(265): Zend_Db_Adapter_Abstract->fetchAll(Object(Varien_Db_Select))
#7 /path_to_root/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(157): Mage_CatalogSearch_Model_Resource_Fulltext->_getSearchableProducts(1, Array, NULL, 0)
#8 /path_to_root/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(116): Mage_CatalogSearch_Model_Resource_Fulltext->_rebuildStoreIndex(1, NULL)
#9 /path_to_root/app/code/core/Mage/CatalogSearch/Model/Fulltext.php(84): Mage_CatalogSearch_Model_Resource_Fulltext->rebuildIndex(NULL, NULL)
#10 /path_to_root/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php(446): Mage_CatalogSearch_Model_Fulltext->rebuildIndex()
#11 /path_to_root/app/code/core/Mage/Index/Model/Process.php(209): Mage_CatalogSearch_Model_Indexer_Fulltext->reindexAll()
#12 /path_to_root/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#13 /path_to_root/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(178): Mage_Index_Model_Process->reindexEverything()
#14 /path_to_root/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Index_Adminhtml_ProcessController->massReindexAction()
#15 /path_to_root/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('massReindex')
#16 /path_to_root/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#17 /path_to_root/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#18 /path_to_root/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#19 /path_to_root/index.php(87): Mage::run('', 'store')
#20 {main}

我们已经尝试了数据库修复工具并禁用了所有扩展,但我们没有收到任何回应。

我很确定它正在某处的表中寻找 e.category_ids,但不知道是哪个。

这里的任何帮助都会很热!

最佳答案

PHP/Magento 已为您提供了自行调试所需的所有信息。具体来说,调用堆栈中的第 7 行——紧接在调用 fetchAll

之前的那一行
#7 /path_to_root/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(157): 
Mage_CatalogSearch_Model_Resource_Fulltext->_getSearchableProducts(1, Array, NULL, 0)

看起来由 _getSearchableProducts 构建的查询是您的罪魁祸首。在标准的 Magento 系统中,此查询如下所示

SELECT STRAIGHT_JOIN `e`.`entity_id`, `e`.`type_id`, `e`.`sku`, `stock_status`.`stock_status` AS `in_stock` 
FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_product_website` AS `website`
ON website.product_id=e.entity_id AND website.website_id='1'
INNER JOIN `cataloginventory_stock_status` AS `stock_status`
ON stock_status.product_id=e.entity_id AND stock_status.website_id='1'
WHERE (e.entity_id>0) ORDER BY `e`.`entity_id` ASC LIMIT 100

也就是说,没有提到 category_ids 字段。这意味着您的特定系统中有自定义代码(核心 hack、监听器、重写等)某处已向此查询添加了额外的 WHEREON 子句。

你可以在自己的系统中调试这个,临时在你的系统中加入如下调试

#File: app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php
protected function _getSearchableProducts($storeId, array $staticFields, $productIds = null, $lastProductId = 0,
$limit = 100)
{
//...
echo (string) $select;
exit;
$result = $writeAdapter->fetchAll($select);
}

这将输出您的系统生成的 SQL 查询,您可以从那里回溯。

关于php - Magento 目录搜索索引,无法初始化索引器进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20818678/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com