예제 #1
0
파일: Group.php 프로젝트: bix0r/Stjornvisi
 /**
  * @param $data
  * @param SearchIndexInterface $index
  *
  * @return IndexInterface
  */
 public function unindex($data, SearchIndexInterface $index)
 {
     $hits = $index->find('group_id:' . $data->id);
     foreach ($hits as $hit) {
         $index->delete($hit->id);
     }
     return $this;
 }
예제 #2
0
파일: Exam.php 프로젝트: ubc/examdb
 /**
  * Delete index for the current exam entity
  *
  * @param \ZendSearch\Lucene\SearchIndexInterface $indexer
  */
 public function deleteIndex($indexer)
 {
     $hits = $indexer->find('pk:' . $this->getId());
     // there should be only one, but just in case
     foreach ($hits as $hit) {
         $indexer->delete($hit);
     }
     $indexer->commit();
 }
예제 #3
0
 public function find($query)
 {
     return $this->index->find($query);
 }