public function GetNumberOfHitsForSearchCacheId($iShopSearchCacheId, $bApplyActiveFilter = false)
    {
        $iNumHits = 0;

        if ($bApplyActiveFilter) {
            $query = "SELECT COUNT(DISTINCT `shop_search_cache_item`.`id`) AS hits
                    FROM `shop_search_cache_item`
              INNER JOIN `shop_article` ON `shop_search_cache_item`.`shop_article_id` = `shop_article`.`id`
               LEFT JOIN `shop_article_shop_category_mlt` ON `shop_article`.`id` = `shop_article_shop_category_mlt`.`source_id`
                   WHERE `shop_search_cache_item`.`shop_search_cache_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($iShopSearchCacheId)."'
                     AND `shop_article`.`shop_manufacturer_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."'
                  ";
            $sFilter = TdbShop::GetActiveFilterString(TdbShopManufacturer::FILTER_KEY_NAME);
            if (!empty($sFilter)) {
                $query .= " AND {$sFilter}";
            }

            $query .= ' GROUP BY `shop_article`.`shop_manufacturer_id`';
        //        echo "<pre>".$query."</pre><br>";
        } else {
            $query = "SELECT COUNT(DISTINCT `shop_search_cache_item`.`id`) AS hits
                    FROM `shop_search_cache_item`
              INNER JOIN `shop_article` ON `shop_search_cache_item`.`shop_article_id` = `shop_article`.`id`
                   WHERE `shop_search_cache_item`.`shop_search_cache_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($iShopSearchCacheId)."'
                     AND `shop_article`.`shop_manufacturer_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."'
                GROUP BY `shop_article`.`shop_manufacturer_id`
                 ";
        }
        if ($row = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query))) {
            $iNumHits = $row['hits'];
        }

        return $iNumHits;
    }