0

I recently created around 700 attributes through script, all attributes look fine at backend. But when I reindex, I get following error:

exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.additional_information_s' in 'field list'' in /lib/Zend/Db/Statement/Pdo.php:228

Note: this attribtue exist in Database (eav_attribtue) table.

I would highly appreciate suggestion.

cspolton
  • 4,495
  • 4
  • 26
  • 34
Deepak Bhatta
  • 474
  • 4
  • 16
  • which reindex exactly ? If product flat, take a look here : http://stackoverflow.com/questions/12893772/magento-product-attributes-recommended-maximum – Jscti Nov 04 '12 at 19:34
  • Reindex got failed on catalog_fulltextsearch – Deepak Bhatta Nov 05 '12 at 03:04
  • For, I didn't set backend model for the attribute so I was getting such reindex fail error. When I corrected this, reindex works pretty well. – Deepak Bhatta Nov 18 '12 at 10:32

1 Answers1

1

The following will reindex each index.

for ($i = 1; $i <= 9; $i++) {
    $process = Mage::getModel('index/process')->load($i);
    $process->reindexAll();
}

You can also use the Magento collection model to load each index rather than hard coding the id in the for loop.

/* @var $indexCollection Mage_Index_Model_Resource_Process_Collection */
$indexCollection = Mage::getModel('index/process')->getCollection();
foreach ($indexCollection as $index) {
    /* @var $index Mage_Index_Model_Process */
    $index->reindexAll();
}

But if you want to reindex just the price the id is 2

$process = Mage::getModel('index/process')->load(2);
$process->reindexAll();

You could also call the function getProcessByCode as follows:

$process = Mage::getModel('index/indexer')->getProcessByCode('catalog_product_price');
$process->reindexAll();
FelixSFD
  • 6,052
  • 10
  • 43
  • 117