Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not reindex after upgrading from 2.3.5 to 2.3.7/8 #565

Closed
srenon opened this issue Oct 17, 2017 · 4 comments
Closed

Can not reindex after upgrading from 2.3.5 to 2.3.7/8 #565

srenon opened this issue Oct 17, 2017 · 4 comments

Comments

@srenon
Copy link

srenon commented Oct 17, 2017

Preconditions

Magento Version : 2.1.9 EE

ElasticSuite Version : 2.3.7

Environment : Both

Can not longer add or remove a product from category etc because of error in reindexing, after upgrading from Magento 2.1.7EE / ElasticSuite 2.3.5 to Magento 2.1.9EE / ElasticSuite 2.3.8 (or 2.3.7) with same exact product data.

Catalog Search indexer process unknown error:
Notice: Undefined index: status in vendor/smile/elasticsuite/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php on line 51
Product/Target Rule index has been rebuilt successfully in 00:00:00
Target Rule/Product index has been rebuilt successfully in 00:00:00
Sales Rule index has been rebuilt successfully in 00:00:01

##Possible solution
vendor/smile/elasticsuite/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php

        foreach ($childrenIndexData as $childrenId => $childrenData) {
             //check if array key exist
            if(array_key_exists('status', $childrenData)){
                $enabled = current($childrenData['status']) == 1;
                if ($enabled === false) {
                    unset($childrenIndexData[$childrenId]);
                }
            }
        }

Output of print_r($childrenData) in foreach loop

....
Array
(
    [product_size] => Array
        (
            [0] => 573
        )

    [option_text_product_size] => Array
        (
            [0] => L
        )

    [name] => Array
        (
            [0] => Product 1
        )

)

Array
(
    [product_size] => Array
        (
            [0] => 572
        )

    [option_text_product_size] => Array
        (
            [0] => M
        )

    [name] => Array
        (
            [0] => Product 2
        )

)
.....

@afoucret
Copy link
Contributor

I don't see how it is possible to have products without the status attribute filled.
Maybe a corruption in your data ?

I will try to make the process of indexing more secure but you should check why simple product have no status attribute filled.

@Koc
Copy link
Contributor

Koc commented Oct 17, 2017

Have same issue after migrating from Magento 1.9.3.4 to 2.1.9. Looks like data-migrator tool bug.

@srenon
Copy link
Author

srenon commented Oct 17, 2017

@Koc ... we are using a third-party extension to add/update products/attributes but this was build from ground up on Magento 2.x (starting with 2.1.4), so no data-migrator tool was used.

@afoucret
Copy link
Contributor

Release 2.3.10 contains the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants