protected function _writeIndex( MW_Common_Criteria_Interface $search, array $domains, $size )
	{
		$manager = MShop_Factory::createManager( $this->_getContext(), 'product' );
		$start = 0;

		do
		{
			$search->setSlice( $start, $size );
			$products = $manager->searchItems( $search, $domains );

			try
			{
				$this->begin();

				$this->deleteItems( array_keys( $products ) );

				foreach ( $this->_getSubManagers() as $submanager ) {
					$submanager->rebuildIndex( $products );
				}

				$this->_saveSubProducts( $products );

				$this->commit();
			}
			catch( Exception $e )
			{
				$this->_rollback();
				throw $e;
			}

			$count = count( $products );
			$start += $count;
		}
		while( $count == $search->getSliceSize() );
	}
protected function _writeIndex( MW_Common_Criteria_Interface $search, array $domains, $size )
	{
		$manager = MShop_Factory::createManager( $this->_getContext(), 'product' );
		$start = 0;

		do
		{
			$search->setSlice( $start, $size );
			$products = $manager->searchItems( $search, $domains );

			try
			{
				$this->begin();

				$this->deleteItems( array_keys( $products ) );

				foreach ( $this->_getSubManagers() as $submanager ) {
					$submanager->rebuildIndex( $products );
				}

				$this->_saveSubProducts( $products );

				$this->commit();
			}
			catch( Exception $e )
			{
				$this->_rollback();
				throw $e;
			}

			$count = count( $products );
			$start += $count;
		}
		while( $count == $search->getSliceSize() );
	}
protected function _writeIndex ( MW_Common_Criteria_Interface $ search , array $ domains , $ size ) { $ manager = MShop_Factory :: createManager ( $ this -> _getContext ( ) , 'product' ) ; $ start = 0 ; do { $ search -> setSlice ( $ start , $ size ) ; $ products = $ manager -> searchItems ( $ search , $ domains ) ; try { $ this -> begin ( ) ; $ this -> deleteItems ( array_keys ( $ products ) ) ; foreach ( $ this -> _getSubManagers ( ) as $ submanager ) { $ submanager -> rebuildIndex ( $ products ) ; } $ this -> _saveSubProducts ( $ products ) ; $ this -> commit ( ) ; } catch ( Exception $ e ) { $ this -> _rollback ( ) ; throw $ e ; } $ count = count ( $ products ) ; $ start += $ count ; } while ( $ count == $ search -> getSliceSize ( ) ) ; }
Re-writes the index entries for all products that are search result of given criteria

@param MW_Common_Criteria_Interface $search Search criteria
@param array $domains List of domains to be
@param integer $size Size of a chunk of products to handle at a time
Re - writes the index entries for all products that are search result of given criteria