src/SearchBundle/objects/db/TShopSearchIndexer.class.php
protected static function IsIgnoreWord($sWord)
    {
        static $aIgnoreWordCache;
        static $bCompleteLoad = null;
        // first try to cache all... if we have to many (more than 500) then work an a word base system instead
        if (!isset($aIgnoreWordCache)) {
            $aIgnoreWordCache = array();
            $oShop = &TdbShopSearchIndexer::GetShopConfigForIndexer();
            $query = "SELECT DISTINCT `name` FROM `shop_search_ignore_word` WHERE `shop_id`='".MySqlLegacySupport::getInstance()->real_escape_string($oShop->id)."'";
            $tres = MySqlLegacySupport::getInstance()->query($query);
            if (MySqlLegacySupport::getInstance()->num_rows($tres) <= 500) {
                $bCompleteLoad = true;
            } else {
                $bCompleteLoad = false;
            }
            $count = 0;
            while ($count < 500 && ($aRow = MySqlLegacySupport::getInstance()->fetch_row($tres))) {
                $aIgnoreWordCache[mb_strtolower($aRow[0])] = 1; // store as assoc so we later have a quick lookup
                ++$count;
            }
        }

        $sTmpWord = mb_strtolower($sWord);
        $bIgnore = false;
        if (array_key_exists($sTmpWord, $aIgnoreWordCache)) {
            $bIgnore = true;
        } elseif (!$bCompleteLoad) {
            // check if we find it in the db
            $oShop = &TdbShopSearchIndexer::GetShopConfigForIndexer();
            $query = "SELECT DISTINCT `name` FROM `shop_search_ignore_word` WHERE `shop_id`='".MySqlLegacySupport::getInstance()->real_escape_string($oShop->id)."' AND `name` = '".MySqlLegacySupport::getInstance()->real_escape_string($sWord)."'";
            $tres = MySqlLegacySupport::getInstance()->query($query);
            if (MySqlLegacySupport::getInstance()->num_rows($tres) > 0) {
                $aIgnoreWordCache[$sTmpWord] = 1;
                $bIgnore = true;
            }
        }

        return $bIgnore;
    }
protected static function IsIgnoreWord($sWord)
    {
        static $aIgnoreWordCache;
        static $bCompleteLoad = null;
        // first try to cache all... if we have to many (more than 500) then work an a word base system instead
        if (!isset($aIgnoreWordCache)) {
            $aIgnoreWordCache = array();
            $oShop = &TdbShopSearchIndexer::GetShopConfigForIndexer();
            $query = "SELECT DISTINCT `name` FROM `shop_search_ignore_word` WHERE `shop_id`='".MySqlLegacySupport::getInstance()->real_escape_string($oShop->id)."'";
            $tres = MySqlLegacySupport::getInstance()->query($query);
            if (MySqlLegacySupport::getInstance()->num_rows($tres) <= 500) {
                $bCompleteLoad = true;
            } else {
                $bCompleteLoad = false;
            }
            $count = 0;
            while ($count < 500 && ($aRow = MySqlLegacySupport::getInstance()->fetch_row($tres))) {
                $aIgnoreWordCache[mb_strtolower($aRow[0])] = 1; // store as assoc so we later have a quick lookup
                ++$count;
            }
        }

        $sTmpWord = mb_strtolower($sWord);
        $bIgnore = false;
        if (array_key_exists($sTmpWord, $aIgnoreWordCache)) {
            $bIgnore = true;
        } elseif (!$bCompleteLoad) {
            // check if we find it in the db
            $oShop = &TdbShopSearchIndexer::GetShopConfigForIndexer();
            $query = "SELECT DISTINCT `name` FROM `shop_search_ignore_word` WHERE `shop_id`='".MySqlLegacySupport::getInstance()->real_escape_string($oShop->id)."' AND `name` = '".MySqlLegacySupport::getInstance()->real_escape_string($sWord)."'";
            $tres = MySqlLegacySupport::getInstance()->query($query);
            if (MySqlLegacySupport::getInstance()->num_rows($tres) > 0) {
                $aIgnoreWordCache[$sTmpWord] = 1;
                $bIgnore = true;
            }
        }

        return $bIgnore;
    }
protected static function IsIgnoreWord ( $ sWord ) { static $ aIgnoreWordCache ; static $ bCompleteLoad = null ; // first try to cache all... if we have to many (more than 500) then work an a word base system instead if ( ! isset ( $ aIgnoreWordCache ) ) { $ aIgnoreWordCache = array ( ) ; $ oShop = & TdbShopSearchIndexer :: GetShopConfigForIndexer ( ) ; $ query = "SELECT DISTINCT `name` FROM `shop_search_ignore_word` WHERE `shop_id`='" . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ oShop -> id ) . "'" ; $ tres = MySqlLegacySupport :: getInstance ( ) -> query ( $ query ) ; if ( MySqlLegacySupport :: getInstance ( ) -> num_rows ( $ tres ) <= 500 ) { $ bCompleteLoad = true ; } else { $ bCompleteLoad = false ; } $ count = 0 ; while ( $ count < 500 && ( $ aRow = MySqlLegacySupport :: getInstance ( ) -> fetch_row ( $ tres ) ) ) { $ aIgnoreWordCache [ mb_strtolower ( $ aRow [ 0 ] ) ] = 1 ; // store as assoc so we later have a quick lookup ++ $ count ; } } $ sTmpWord = mb_strtolower ( $ sWord ) ; $ bIgnore = false ; if ( array_key_exists ( $ sTmpWord , $ aIgnoreWordCache ) ) { $ bIgnore = true ; } elseif ( ! $ bCompleteLoad ) { // check if we find it in the db $ oShop = & TdbShopSearchIndexer :: GetShopConfigForIndexer ( ) ; $ query = "SELECT DISTINCT `name` FROM `shop_search_ignore_word` WHERE `shop_id`='" . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ oShop -> id ) . "' AND `name` = '" . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ sWord ) . "'" ; $ tres = MySqlLegacySupport :: getInstance ( ) -> query ( $ query ) ; if ( MySqlLegacySupport :: getInstance ( ) -> num_rows ( $ tres ) > 0 ) { $ aIgnoreWordCache [ $ sTmpWord ] = 1 ; $ bIgnore = true ; } } return $ bIgnore ; }
return true if the word is in the ignore list.

@param string $sWord

@return bool
return true if the word is in the ignore list .