Example #1
0
 /**
  * After process search, we save count search resutls to query
  *
  * @return Mirasvit_SearchIndex_Model_Index_Catalog
  */
 protected function _processSearch($queryText, $storeId)
 {
     parent::_processSearch($queryText, $storeId);
     $query = Mage::helper('catalogsearch')->getQuery();
     $query->setNumResults(count($this->_matchedIds[$queryText]))->setIsProcessed(1)->save();
     return $this;
 }
Example #2
0
 public function getConnection()
 {
     if ($this->getProperty('db_connection_name')) {
         $connName = $this->getProperty('db_connection_name');
         return Mage::getSingleton('core/resource')->getConnection($connName);
     }
     return parent::getConnection();
 }
Example #3
0
 public function getConnection()
 {
     $uid = Mage::helper('mstcore/debug')->start();
     if ($this->getProperty('db_connection_name')) {
         $connName = $this->getProperty('db_connection_name');
         $connection = Mage::getSingleton('core/resource')->getConnection($connName);
         Mage::helper('mstcore/debug')->dump($uid, array('$connName' => $connName, '$connection' => print_r($connection, true)));
         return $connection;
     }
     Mage::helper('mstcore/debug')->end($uid);
     return parent::getConnection();
 }
 public function getCountResults()
 {
     if (Mage::app()->getStore()->getId() == $this->getStoreId()) {
         if (Mage::registry('current_layer')) {
             return Mage::registry('current_layer')->getProductCollection()->getSize();
         } else {
             return parent::getCountResults();
         }
     } else {
         $matchedIds = $this->getMatchedIds(null, $this->getStoreId());
         return count($matchedIds);
     }
 }