mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	force update of search index if out of date
This commit is contained in:
		@@ -68,6 +68,17 @@ migrations() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					search_index() {
 | 
				
			||||||
 | 
						index_version=1
 | 
				
			||||||
 | 
						index_version_file=/usr/src/paperless/data/.index_version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if [[ (! -f "$index_version_file") || $(< $index_version_file) != "$index_version" ]]; then
 | 
				
			||||||
 | 
							echo "Search index out of date. Updating..."
 | 
				
			||||||
 | 
							sudo -HEu paperless python3 manage.py document_index reindex
 | 
				
			||||||
 | 
							echo $index_version | sudo -HEu paperless tee $index_version_file >/dev/null
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
initialize() {
 | 
					initialize() {
 | 
				
			||||||
	map_uidgid
 | 
						map_uidgid
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -87,6 +98,7 @@ initialize() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	migrations
 | 
						migrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						search_index
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
install_languages() {
 | 
					install_languages() {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user