mirror of
				https://git.code.sf.net/p/seeddms/code
				synced 2025-10-31 05:11:27 +00:00 
			
		
		
		
	- update full text index when document is removed
This commit is contained in:
		
							parent
							
								
									617654060e
								
							
						
					
					
						commit
						c91178d89e
					
				|  | @ -51,6 +51,23 @@ $nl =	$document->getNotifyList(); | ||||||
| if (!$document->remove()) { | if (!$document->remove()) { | ||||||
| 	UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("error_occured")); | 	UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("error_occured")); | ||||||
| } else { | } else { | ||||||
|  | 
 | ||||||
|  | 	/* Remove the document from the fulltext index */ | ||||||
|  | 	if($settings->_enableFullSearch) { | ||||||
|  | 		if(!empty($settings->_luceneClassDir)) | ||||||
|  | 			require_once($settings->_luceneClassDir.'/Lucene.php'); | ||||||
|  | 		else | ||||||
|  | 			require_once('LetoDMS/Lucene.php'); | ||||||
|  | 
 | ||||||
|  | 		$index = LetoDMS_Lucene_Indexer::open($settings->_luceneDir); | ||||||
|  | 		if($hits = $index->find('document_id:'.$documentid)) { | ||||||
|  | 			$hit = $hits[0]; | ||||||
|  | 			echo $hit->id; | ||||||
|  | 			$index->delete($hit->id); | ||||||
|  | 			$index->commit(); | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	if ($notifier){ | 	if ($notifier){ | ||||||
| 		$path = ""; | 		$path = ""; | ||||||
| 		$folderPath = $folder->getPath(); | 		$folderPath = $folder->getPath(); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 steinm
						steinm