Ver Mensaje Individual
  #5 (permalink)  
Antiguo 18/08/2010, 03:24
jspcat
 
Fecha de Ingreso: junio-2005
Ubicación: Barcelona
Mensajes: 458
Antigüedad: 18 años, 11 meses
Puntos: 4
Respuesta: AYuda Lucene!

Ya lo consegui y creo que ya funciona bien:

Código PHP:
public function  deleteBookFromSearch($idBook){
        
       
            
$index $this->indexBaseDir.DIRECTORY_SEPARATOR.'book-index';
            
               if (!
file_exists($index)){
                return 
0;
            }
            
            
$hadle Zend_Search_Lucene::open($index);
            
            
//$this->openIndex($index);
            
$query "idBook:$idBook";
            
            
$hits =  $hadle->find($query);

            
$num 0;
            foreach (
$hits as $hit){
                
$hadle->delete($hit->idBook-1);
                
$hadle->commit(); 
                  
$num++;    
                  
            }
            return 
$num;
        
    } 
__________________
La ficción es y será mi única realidad