0

I am very new to magento and am finding it ok to use (after overcomming a lot of issues it has) however i am now at one spot cdwhere i cant seem to resolved an issue i have with the Product EAV Indexer

/opt/plesk/php/7.0/bin/php bin/magento index:reindex catalog_product_attribute

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'mage_catalog_product_index_eav_idx.source_id' in 'field list', query

was: INSERT INTO mage_catalog_product_index_eav (entity_id, attribute_id, store_id, value, source_id) SELECT mage_catalog_product_index_eav_idx.entity_id, mage_catalog_product_index_eav_idx.attribute_id, mage_catalog_product_index_eav_idx.store_id, mage_catalog_product_index_eav_idx.value, mage_catalog_product_index_eav_idx.source_id FROM mage_catalog_product_index_eav_idx ON DUPLICATE KEY UPDATE entity_id = VALUES(entity_id), attribute_id = VALUES(attribute_id), store_id = VALUES(store_id), value = VALUES(value), source_id = VALUES(source_id)

Which if am correct states that i need the column source_id in catalog_product_index_eav_idx.source_id, However, When i add this column in and set the value to 0 for each row (i created a test database to see and that filled all the values with 0) i then get this error when running the same command

SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1, query was: INSERT INTO mage_catalog_product_index_eav_idx SELECT DISTINCT pid.entity_id, pid.attribute_id, pid.store_id, IFNULL(pis.value, pid.value) AS value FROM (SELECT DISTINCT s.store_id, s.website_id, dd.attribute_id, COALESCE(ds.value, dd.value) AS value, cpe.entity_id FROM mage_store AS s LEFT JOIN mage_catalog_product_entity_int AS dd ON dd.store_id = 0 LEFT JOIN mage_catalog_product_entity_int AS ds ON ds.store_id = s.store_id AND ds.attribute_id = dd.attribute_id AND ds.entity_id = dd.entity_id LEFT JOIN mage_catalog_product_entity_int AS d2d ON d2d.store_id = 0 AND d2d.entity_id = dd.entity_id AND d2d.attribute_id = 94 LEFT JOIN mage_catalog_product_entity_int AS d2s ON d2s.store_id = s.store_id AND d2s.attribute_id = d2d.attribute_id AND d2s.entity_id = d2d.entity_id LEFT JOIN mage_catalog_product_entity AS cpe ON cpe.entity_id = dd.entity_id WHERE (s.store_id != 0) AND ((ds.value IS NOT NULL OR dd.value IS NOT NULL)) AND (COALESCE(d2s.value, d2d.value) = 1)) AS pid LEFT JOIN mage_catalog_product_entity_int AS pis ON pis.entity_id = pid.entity_id AND pis.attribute_id = pid.attribute_id AND pis.store_id = pid.store_id WHERE (pid.attribute_id IN('136', '139', '149', '161', '167', '169', '170', '171', '231')) AND (IFNULL(pis.value, pid.value) IS NOT NULL) AND (NOT(pis.value IS NULL AND pis.value_id IS NOT NULL))

I have been trying to solve this issue for quite a while now but am not having any luck.

I think I need to replace the core code which is used for the re-indexer but i cannot seem to find this.

Any chance someone could point me in the right direction on where Magento stores these files or how to resolve the issue using a different method?

1

I successfully solved this issue, by replacing the magento_indexer folder with a new version which I took from a new download of my Magento version. I then cleared the cache and did the Magento upgrade command. (i made sure I took a backup of the files I was replacing and the database before doing any of this).

The canceled all indexer process that was running, and re-run the indexer command and got the response I wanted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.