public function rebuildStoreIndex($storeId, $productIds = null)
    {
        $productId = 0;

        // Magento is only sending children ids here. Ensure to reindex also the parents product ids, if any.
        if (!empty($productIds)) {
            $productIds = array_unique(array_merge($productIds, $this->resourceModel->getRelationsByChild($productIds)));
        }

        do {
            $products = $this->getSearchableProducts($storeId, $productIds, $productId);

            foreach ($products as $productData) {
                $productId = (int) $productData['entity_id'];
                $productData['has_options']      = (bool) $productData['has_options'];
                $productData['required_options'] = (bool) $productData['required_options'];
                yield $productId => $productData;
            }
        } while (!empty($products));
    }
public function rebuildStoreIndex($storeId, $productIds = null)
    {
        $productId = 0;

        // Magento is only sending children ids here. Ensure to reindex also the parents product ids, if any.
        if (!empty($productIds)) {
            $productIds = array_unique(array_merge($productIds, $this->resourceModel->getRelationsByChild($productIds)));
        }

        do {
            $products = $this->getSearchableProducts($storeId, $productIds, $productId);

            foreach ($products as $productData) {
                $productId = (int) $productData['entity_id'];
                $productData['has_options']      = (bool) $productData['has_options'];
                $productData['required_options'] = (bool) $productData['required_options'];
                yield $productId => $productData;
            }
        } while (!empty($products));
    }
public function rebuildStoreIndex ( $ storeId , $ productIds = null ) { $ productId = 0 ; // Magento is only sending children ids here. Ensure to reindex also the parents product ids, if any. if ( ! empty ( $ productIds ) ) { $ productIds = array_unique ( array_merge ( $ productIds , $ this -> resourceModel -> getRelationsByChild ( $ productIds ) ) ) ; } do { $ products = $ this -> getSearchableProducts ( $ storeId , $ productIds , $ productId ) ; foreach ( $ products as $ productData ) { $ productId = ( int ) $ productData [ 'entity_id' ] ; $ productData [ 'has_options' ] = ( bool ) $ productData [ 'has_options' ] ; $ productData [ 'required_options' ] = ( bool ) $ productData [ 'required_options' ] ; yield $ productId => $ productData ; } } while ( ! empty ( $ products ) ) ; }
Get data for a list of product in a store id.
If the product list ids is null, all products data will be loaded.

@param integer    $storeId    Store id.
@param array|null $productIds List of product ids.

@return array
Get data for a list of product in a store id . If the product list ids is null all products data will be loaded .