这个命令: - sudo php /var/www/shell/indexer.php -reindexall
在具有相同sql语法错误的2个索引上失败 目录搜索索引 然后 Lucene搜索索引
在目录搜索索引上,条件'ciss.website_id ='看起来像语法错误。这是令人讨厌的脚本: -
SELECT `main`.`linked_product_id`
FROM `catalog_product_link` AS `main`
INNER JOIN `cataloginventory_stock_status` AS `ciss`
ON ciss.product_id = main.product_id
AND ciss.website_id = WHERE (main.product_id = '5336')
AND (link_type_id=3) AND (ciss.stock_status = 1)'
如果我在MySQL Workbench中使用'ciss.website_id = 1'而不是'ciss.website_id ='运行下一个脚本,它运行正常! (为了在工作台中进行测试,我还删除了magento似乎在所有SQL中使用的单个引号。)
SELECT main.linked_product_id
FROM catalog_product_link AS main
INNER JOIN cataloginventory_stock_status AS ciss
ON ciss.product_id = main.product_id
AND ciss.website_id = 1 WHERE (main.product_id = '5336')
AND (link_type_id=3) AND (ciss.stock_status = 1);
问题是为什么它没有找到有效的website_id(我们的一个商店只有1个而且只有1个。)
任何人都可以对此嗤之以鼻吗? 我们最近从magento 1.7.0.2升级到1.9.3.2其他一切正常。 我们是否需要删除并重新创建这两个索引?
通过magento管理控制台,Reindex也无法进行目录搜索索引。
请参阅下面的堆栈跟踪 谢谢!
这里是指数错误的全面展望 用粗体表示有效的部分: -
prompt>sudo php /var/www/shell/indexer.php -reindexall
Product Attributes index was rebuilt successfully in 00:00:00
Product Prices index was rebuilt successfully in 00:00:01
Catalog URL Rewrites index was rebuilt successfully in 00:02:17
Category Products index was rebuilt successfully in 00:00:00
Catalog Search Index index process unknown error:
exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (main.product_id = '5336') AND (link_type_id=3) AND (ciss.stock_status = 1' at line 2' in /var/www/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /var/www/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main`.`...', Array)
#5 /var/www/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main`.`...', Array)
#6 /var/www/lib/Zend/Db/Adapter/Abstract.php(794): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#7 /var/www/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(609): Zend_Db_Adapter_Abstract->fetchCol(Object(Varien_Db_Select))
#8 /var/www/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(624): Mage_CatalogSearch_Model_Resource_Fulltext->_getProductChildrenIds('5336', 'grouped')
#9 /var/www/app/code/community/Php4u/BlastLuceneSearch/Model/Mysql4/Lucene.php(19) : eval()'d code(1) : eval()'d code(1) : eval()'d code(18): Mage_CatalogSearch_Model_Resource_Fulltext->_getProductChildIds('5336', 'grouped')
#10 /var/www/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(117): Php4u_BlastLuceneSearch_Model_Mysql4_Lucene->_rebuildStoreIndex(1, NULL)
#11 /var/www/app/code/core/Mage/CatalogSearch/Model/Fulltext.php(84): Mage_CatalogSearch_Model_Resource_Fulltext->rebuildIndex(NULL, NULL)
#12 /var/www/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php(455): Mage_CatalogSearch_Model_Fulltext->rebuildIndex()
#13 /var/www/app/code/core/Mage/Index/Model/Process.php(212): Mage_CatalogSearch_Model_Indexer_Fulltext->reindexAll()
#14 /var/www/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#15 /var/www/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything()
#16 /var/www/shell/indexer.php(216): Mage_Shell_Compiler->run()
#17 {main}
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (main.product_id = '5336') AND (link_type_id=3) AND (ciss.stock_status = 1' at line 2, query was: SELECT `main`.`linked_product_id` FROM `catalog_product_link` AS `main`
INNER JOIN `cataloginventory_stock_status` AS `ciss` ON ciss.product_id = main.product_id AND ciss.website_id = WHERE (main.product_id = '5336') AND (link_type_id=3) AND (ciss.stock_status = 1)' in /var/www/lib/Zend/Db/Statement/Pdo.php:235
Stack trace:
#0 /var/www/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main`.`...', Array)
#4 /var/www/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main`.`...', Array)
#5 /var/www/lib/Zend/Db/Adapter/Abstract.php(794): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /var/www/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(609): Zend_Db_Adapter_Abstract->fetchCol(Object(Varien_Db_Select))
#7 /var/www/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(624): Mage_CatalogSearch_Model_Resource_Fulltext->_getProductChildrenIds('5336', 'grouped')
#8 /var/www/app/code/community/Php4u/BlastLuceneSearch/Model/Mysql4/Lucene.php(19) : eval()'d code(1) : eval()'d code(1) : eval()'d code(18): Mage_CatalogSearch_Model_Resource_Fulltext->_getProductChildIds('5336', 'grouped')
#9 /var/www/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(117): Php4u_BlastLuceneSearch_Model_Mysql4_Lucene->_rebuildStoreIndex(1, NULL)
#10 /var/www/app/code/core/Mage/CatalogSearch/Model/Fulltext.php(84): Mage_CatalogSearch_Model_Resource_Fulltext->rebuildIndex(NULL, NULL)
#11 /var/www/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php(455): Mage_CatalogSearch_Model_Fulltext->rebuildIndex()
#12 /var/www/app/code/core/Mage/Index/Model/Process.php(212): Mage_CatalogSearch_Model_Indexer_Fulltext->reindexAll()
#13 /var/www/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#14 /var/www/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything()
#15 /var/www/shell/indexer.php(216): Mage_Shell_Compiler->run()
#16 {main}
Stock Status index was rebuilt successfully in 00:00:00
Tag Aggregation Data index was rebuilt successfully in 00:00:00
Lucene Search Index index process unknown error:
exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (main.product_id = '5336') AND (link_type_id=3) AND (ciss.stock_status = 1' at line 2' in /var/www/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /var/www/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main`.`...', Array)
#5 /var/www/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main`.`...', Array)
#6 /var/www/lib/Zend/Db/Adapter/Abstract.php(794): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#7 /var/www/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(609): Zend_Db_Adapter_Abstract->fetchCol(Object(Varien_Db_Select))
#8 /var/www/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(624): Mage_CatalogSearch_Model_Resource_Fulltext->_getProductChildrenIds('5336', 'grouped')
#9 /var/www/app/code/community/Php4u/BlastLuceneSearch/Model/Mysql4/Lucene.php(19) : eval()'d code(1) : eval()'d code(1) : eval()'d code(18): Mage_CatalogSearch_Model_Resource_Fulltext->_getProductChildIds('5336', 'grouped')
#10 /var/www/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(117): Php4u_BlastLuceneSearch_Model_Mysql4_Lucene->_rebuildStoreIndex(1, NULL)
#11 /var/www/app/code/community/Php4u/BlastLuceneSearch/Model/Lucene.php(19) : eval()'d code(1) : eval()'d code(1) : eval()'d code(18): Mage_CatalogSearch_Model_Resource_Fulltext->rebuildIndex(NULL, NULL)
#12 /var/www/app/code/community/Php4u/BlastLuceneSearch/Model/Indexer/Product.php(19) : eval()'d code(1) : eval()'d code(1) : eval()'d code(18): Php4u_BlastLuceneSearch_Model_Lucene->rebuildIndex()
#13 /var/www/app/code/core/Mage/Index/Model/Process.php(212): Php4u_BlastLuceneSearch_Model_Indexer_Product->reindexAll()
#14 /var/www/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#15 /var/www/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything()
#16 /var/www/shell/indexer.php(216): Mage_Shell_Compiler->run()
#17 {main}
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (main.product_id = '5336') AND (link_type_id=3) AND (ciss.stock_status = 1' at line 2, query was: SELECT `main`.`linked_product_id` FROM `catalog_product_link` AS `main`
INNER JOIN `cataloginventory_stock_status` AS `ciss` ON ciss.product_id = main.product_id AND ciss.website_id = WHERE (main.product_id = '5336') AND (link_type_id=3) AND (ciss.stock_status = 1)' in /var/www/lib/Zend/Db/Statement/Pdo.php:235
Stack trace:
#0 /var/www/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main`.`...', Array)
#4 /var/www/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main`.`...', Array)
#5 /var/www/lib/Zend/Db/Adapter/Abstract.php(794): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /var/www/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(609): Zend_Db_Adapter_Abstract->fetchCol(Object(Varien_Db_Select))
#7 /var/www/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(624): Mage_CatalogSearch_Model_Resource_Fulltext->_getProductChildrenIds('5336', 'grouped')
#8 /var/www/app/code/community/Php4u/BlastLuceneSearch/Model/Mysql4/Lucene.php(19) : eval()'d code(1) : eval()'d code(1) : eval()'d code(18): Mage_CatalogSearch_Model_Resource_Fulltext->_getProductChildIds('5336', 'grouped')
#9 /var/www/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(117): Php4u_BlastLuceneSearch_Model_Mysql4_Lucene->_rebuildStoreIndex(1, NULL)
#10 /var/www/app/code/community/Php4u/BlastLuceneSearch/Model/Lucene.php(19) : eval()'d code(1) : eval()'d code(1) : eval()'d code(18): Mage_CatalogSearch_Model_Resource_Fulltext->rebuildIndex(NULL, NULL)
#11 /var/www/app/code/community/Php4u/BlastLuceneSearch/Model/Indexer/Product.php(19) : eval()'d code(1) : eval()'d code(1) : eval()'d code(18): Php4u_BlastLuceneSearch_Model_Lucene->rebuildIndex()
#12 /var/www/app/code/core/Mage/Index/Model/Process.php(212): Php4u_BlastLuceneSearch_Model_Indexer_Product->reindexAll()
#13 /var/www/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#14 /var/www/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything()
#15 /var/www/shell/indexer.php(216): Mage_Shell_Compiler->run()
#16 {main}
提示> 提示>