src/SearchBundle/objects/db/TShopSearchQuery.class.php
public function CreateIndexTick($iNumberOfRowsToProcess)
    {
        $iRealNumberProcessed = 0;
        $oFields = &TdbShopSearchFieldWeightList::GetListForShopSearchQueryId($this->id);
        if (CMS_SHOP_INDEX_LOAD_DELAY_MILLISECONDS > 0) {
            usleep(CMS_SHOP_INDEX_LOAD_DELAY_MILLISECONDS * 1000);
        }

        // fetch as many rows as we can....
        $sLimit = " LIMIT 0,{$iNumberOfRowsToProcess}";
        if ($iNumberOfRowsToProcess < 0) {
            $sLimit = '';
        }
        $query = 'SELECT * FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($this->GetIndexRawTableName())."` {$sLimit}";
        $tres = MySqlLegacySupport::getInstance()->query($query);
        $sError = MySqlLegacySupport::getInstance()->error();
        if (!empty($sError)) {
            trigger_error('SQL Error: '.$sError, E_USER_WARNING);
        } else {
            while ($aRow = MySqlLegacySupport::getInstance()->fetch_assoc($tres)) {
                $oFields->GoToStart();
                while ($oField = &$oFields->Next()) {
                    $oField->CreateIndexTick($aRow);
                }
                $query = 'DELETE FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($this->GetIndexRawTableName())."` WHERE `sysid` = '".MySqlLegacySupport::getInstance()->real_escape_string($aRow['sysid'])."'";
                MySqlLegacySupport::getInstance()->query($query);
                ++$iRealNumberProcessed;
            }
        }

        if (($iRealNumberProcessed < $iNumberOfRowsToProcess) || ($iNumberOfRowsToProcess < 0)) {
            $query = 'DROP TABLE `'.MySqlLegacySupport::getInstance()->real_escape_string($this->GetIndexRawTableName()).'`';
            MySqlLegacySupport::getInstance()->query($query);
        }

        return $iRealNumberProcessed;
    }
public function CreateIndexTick($iNumberOfRowsToProcess)
    {
        $iRealNumberProcessed = 0;
        $oFields = &TdbShopSearchFieldWeightList::GetListForShopSearchQueryId($this->id);
        if (CMS_SHOP_INDEX_LOAD_DELAY_MILLISECONDS > 0) {
            usleep(CMS_SHOP_INDEX_LOAD_DELAY_MILLISECONDS * 1000);
        }

        // fetch as many rows as we can....
        $sLimit = " LIMIT 0,{$iNumberOfRowsToProcess}";
        if ($iNumberOfRowsToProcess < 0) {
            $sLimit = '';
        }
        $query = 'SELECT * FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($this->GetIndexRawTableName())."` {$sLimit}";
        $tres = MySqlLegacySupport::getInstance()->query($query);
        $sError = MySqlLegacySupport::getInstance()->error();
        if (!empty($sError)) {
            trigger_error('SQL Error: '.$sError, E_USER_WARNING);
        } else {
            while ($aRow = MySqlLegacySupport::getInstance()->fetch_assoc($tres)) {
                $oFields->GoToStart();
                while ($oField = &$oFields->Next()) {
                    $oField->CreateIndexTick($aRow);
                }
                $query = 'DELETE FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($this->GetIndexRawTableName())."` WHERE `sysid` = '".MySqlLegacySupport::getInstance()->real_escape_string($aRow['sysid'])."'";
                MySqlLegacySupport::getInstance()->query($query);
                ++$iRealNumberProcessed;
            }
        }

        if (($iRealNumberProcessed < $iNumberOfRowsToProcess) || ($iNumberOfRowsToProcess < 0)) {
            $query = 'DROP TABLE `'.MySqlLegacySupport::getInstance()->real_escape_string($this->GetIndexRawTableName()).'`';
            MySqlLegacySupport::getInstance()->query($query);
        }

        return $iRealNumberProcessed;
    }
public function CreateIndexTick ( $ iNumberOfRowsToProcess ) { $ iRealNumberProcessed = 0 ; $ oFields = & TdbShopSearchFieldWeightList :: GetListForShopSearchQueryId ( $ this -> id ) ; if ( CMS_SHOP_INDEX_LOAD_DELAY_MILLISECONDS > 0 ) { usleep ( CMS_SHOP_INDEX_LOAD_DELAY_MILLISECONDS * 1000 ) ; } // fetch as many rows as we can.... $ sLimit = " LIMIT 0,{$iNumberOfRowsToProcess}" ; if ( $ iNumberOfRowsToProcess < 0 ) { $ sLimit = '' ; } $ query = 'SELECT * FROM `' . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ this -> GetIndexRawTableName ( ) ) . "` {$sLimit}" ; $ tres = MySqlLegacySupport :: getInstance ( ) -> query ( $ query ) ; $ sError = MySqlLegacySupport :: getInstance ( ) -> error ( ) ; if ( ! empty ( $ sError ) ) { trigger_error ( 'SQL Error: ' . $ sError , E_USER_WARNING ) ; } else { while ( $ aRow = MySqlLegacySupport :: getInstance ( ) -> fetch_assoc ( $ tres ) ) { $ oFields -> GoToStart ( ) ; while ( $ oField = & $ oFields -> Next ( ) ) { $ oField -> CreateIndexTick ( $ aRow ) ; } $ query = 'DELETE FROM `' . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ this -> GetIndexRawTableName ( ) ) . "` WHERE `sysid` = '" . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ aRow [ 'sysid' ] ) . "'" ; MySqlLegacySupport :: getInstance ( ) -> query ( $ query ) ; ++ $ iRealNumberProcessed ; } } if ( ( $ iRealNumberProcessed < $ iNumberOfRowsToProcess ) || ( $ iNumberOfRowsToProcess < 0 ) ) { $ query = 'DROP TABLE `' . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ this -> GetIndexRawTableName ( ) ) . '`' ; MySqlLegacySupport :: getInstance ( ) -> query ( $ query ) ; } return $ iRealNumberProcessed ; }
creates index for the number of rows requested. returns the real number of rows processed.

@param int $iNumberOfRowsToProcess - if set to -1 we will process all rows

@return int
creates index for the number of rows requested . returns the real number of rows processed .