getTable()->getLuceneIndex(); // remove existing entries foreach ($index->find('pk:'.$this->getId()) as $hit) { $index->delete($hit->id); } $doc = new Zend_Search_Lucene_Document(); // store job primary key to identify it in the search results $doc->addField(Zend_Search_Lucene_Field::Keyword('pk', $this->getId())); // index job fields $doc->addField(Zend_Search_Lucene_Field::UnStored('name', $this->name, 'UTF-8')); $doc->addField(Zend_Search_Lucene_Field::UnStored('description', $this->description, 'UTF-8')); // add job to the index $index->addDocument($doc); $index->commit(); } // pretizeni ukladani pro zpracovani indexu public function save(Doctrine_Connection $conn = null){ $ret = parent::save($conn); $this->updateLuceneIndex(); return $ret; } }