Пример #1
0
 /**
  * Remove an entry from the index
  *
  * @param Searchable $item	Model to remove
  * @return Search		return this instance for method chaining
  */
 public function remove($item)
 {
     // now we have the identifier, find it
     $hits = $this->find('uid:' . $item->get_unique_identifier());
     if (sizeof($hits) == 0) {
         Kohana::log("error", "No index entry found for id " . $item->get_unique_identifier());
     } else {
         if (sizeof($hits) > 1) {
             Kohana::log("error", "Non-unique Identifier - More than one record was returned");
         }
     }
     if (sizeof($hits) > 0) {
         $this->open_index()->delete($hits[0]->id);
     }
     // return this so we can have chainable methods
     return $this;
 }