Exemple #1
0
 public function execute($data)
 {
     $this->_loadModels();
     $resource = $this->Resource->findById($data['resource_id']);
     if (!$resource) {
         return false;
     }
     # Populate collections
     $cids = $this->Resource->Membership->memberships($data['resource_id']);
     $resource['Collection'] = $this->Collection->find('list', array('fields' => 'Collection.title', 'conditions' => array('Collection.id' => $cids)));
     $indexer = new \Arcs\SolrIndexer();
     $indexer->addResource($resource);
 }
Exemple #2
0
 public function delete_all()
 {
     $indexer = new \Arcs\SolrIndexer();
     $offset = 0;
     while (true) {
         $resources = $this->Resource->find('all', array('limit' => 50, 'offset' => $offset));
         if (!$resources) {
             break;
         }
         foreach ($resources as $r) {
             $id = $r['Resource']['id'];
             $this->out("DELETE {$id}");
             $indexer->deleteResource($id);
         }
         $offset += 50;
     }
 }
Exemple #3
0
 public function execute($data)
 {
     $this->_loadModels();
     $indexer = new \Arcs\SolrIndexer();
     $indexer->deleteResource($data['resource_id']);
 }