/** * Inserts the provided action */ public function insert() { if (!$this->shouldIndex()) { return; } throw new sfException(__CLASS__ . ' not implemented'); extract($this->getActionProperties()); $output = $this->executeAction($params); $content = $output->getContent(); $doc = Zend_Search_Lucene_Document_Html::loadHtml($content); $doc->addField('sfl_title', $output->getLastTitle(), 2); $doc->addField('sfl_uri', $this->getUri($params)); $doc->addField('sfl_description', $content); $doc->addField('sfl_type', 'action'); $categories = $this->getActionCategories(); if (count($categories)) { foreach ($categories as $category) { $this->addCategory($category); } $doc->addField('sfl_category', implode(', ', $categories)); } $doc->addField('sfl_categories_cache', serialize($categories)); $guid = $this->getGuid($params); $this->addDocument($doc, $guid, 'action'); $this->getSearch()->getEventDispatcher()->notify(new sfEvent($this, 'indexer.log', array('Inserted action "%s" of module "%s" to index', $this->getAction(), $this->getModule()))); return $this; }