Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function updateLuceneIndex() {
- $index = ArticleTable::getLuceneIndex();
- foreach ($index->find('pk:' . $this->getId()) as $hit) {
- $index->delete($hit->id);
- }
- print_r ($this->getId());
- $doc = new Zend_Search_Lucene_Document();
- $doc->addField(Zend_Search_Lucene_Field::Keyword('pk', $this->getId()));
- // индексируем поля вакансии
- $doc->addField(Zend_Search_Lucene_Field::UnStored('title', $this->getTitle(), 'utf-8'));
- $doc->addField(Zend_Search_Lucene_Field::UnStored('body', $this->getBody(), 'utf-8'));
- // добавляем работу в индекс
- $index->addDocument($doc);
- $index->commit();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement