コード例 #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
ファイル: index.php プロジェクト: ntvis/search_lucene
 /**
  * removes a file from the lucene index
  * 
  * @param int $fileId file id to remove from the index
  * 
  * @return int count of deleted documents in the index
  */
 public function deleteFile($fileId)
 {
     $hits = $this->index->find('fileId:' . $fileId);
     $this->logger->debug('found ' . count($hits) . ' hits for file id ' . $fileId);
     foreach ($hits as $hit) {
         $this->logger->debug('removing ' . $hit->id . ':' . $hit->path . ' from index');
         $this->index->delete($hit);
     }
     return count($hits);
 }
コード例 #3
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();
 }