# HG changeset patch # User ymh # Date 1271263982 -7200 # Node ID 0851f98246af84cc19e004a0c11b5b92dface7da # Parent 86c5f68fbaa83cd170af4f249f29a9da5f529b8c plug tag search diff -r 86c5f68fbaa8 -r 0851f98246af web/thdProject/apps/frontend/modules/search/actions/viewSearchListAction.class.php --- a/web/thdProject/apps/frontend/modules/search/actions/viewSearchListAction.class.php Wed Apr 14 18:21:01 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/search/actions/viewSearchListAction.class.php Wed Apr 14 18:53:02 2010 +0200 @@ -13,14 +13,6 @@ $this->indexNbItems = 2; $this->videoPath = sfConfig::get('app_player_videoPath'); - /*$query = Doctrine_Query::create() - ->from('ThdFilm F') - ->leftJoin('F.images I ') - ->leftJoin('F.videos V') - //->where("cu.code='{$culture}' AND mo.code='{$module}' AND ms.code='{$section}'") - ->orderBy('F.id DESC') - ->limit(0,10);*/ - $solr = uvmcSolrServicesManager::getInstance()->getService(); $response = $solr->search($this->text, $this->pageIndex * $this->pageNbItems, $this->pageNbItems); diff -r 86c5f68fbaa8 -r 0851f98246af web/thdProject/apps/frontend/modules/tag/actions/viewTagListAction.class.php --- a/web/thdProject/apps/frontend/modules/tag/actions/viewTagListAction.class.php Wed Apr 14 18:21:01 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/tag/actions/viewTagListAction.class.php Wed Apr 14 18:53:02 2010 +0200 @@ -3,6 +3,7 @@ class viewTagListAction extends sfAction { public function execute($request) { + // Parse request parameters $format = $request->getRequestFormat(); $this->tag = (string) $request->getParameter('tag'); @@ -12,6 +13,26 @@ $this->indexNbItems = 2; + $solr = uvmcSolrServicesManager::getInstance()->getService(); + $response = $solr->search("tags:".$this->tag, $this->pageIndex * $this->pageNbItems, $this->pageNbItems); + + $results = unserialize($response->getRawResponse()); + + $primaryKeys = array(); + foreach($results['response']['docs'] as $doc) + { + $primaryKeys[] = $doc['id']; + } + + if(!empty($primaryKeys)) + { + $this->mostTaggedFilms = Doctrine::getTable('ThdFilm')->findByScoredId($primaryKeys); + } + else + { + $this->mostTaggedFilms = array(); + } + return sfView::SUCCESS; } } \ No newline at end of file diff -r 86c5f68fbaa8 -r 0851f98246af web/thdProject/config/ProjectConfiguration.class.php --- a/web/thdProject/config/ProjectConfiguration.class.php Wed Apr 14 18:21:01 2010 +0200 +++ b/web/thdProject/config/ProjectConfiguration.class.php Wed Apr 14 18:53:02 2010 +0200 @@ -1,13 +1,20 @@ enableAllPluginsExcept(array('sfPropelPlugin', 'sfCompat10Plugin', 'iriSonyenginePlugin', 'uvmcSolrSearchPlugin')); + $this->enableAllPluginsExcept(array('sfPropelPlugin', 'sfCompat10Plugin')); } public function configureDoctrineConnection(Doctrine_Connection $conn) {