diff src/luan/modules/lucene/Lucene.luan @ 1387:bc40bc9aab3a

start postgres backup
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 02 Sep 2019 22:23:12 -0600
parents 87a3738d7cc5
children 2024d23ddd64
line wrap: on
line diff
--- a/src/luan/modules/lucene/Lucene.luan	Thu Aug 22 12:32:20 2019 -0600
+++ b/src/luan/modules/lucene/Lucene.luan	Mon Sep 02 22:23:12 2019 -0600
@@ -35,12 +35,12 @@
 
 Lucene.literal = SaneQueryParser.literal
 
-function Lucene.index(index_dir,default_type,default_fields)
+function Lucene.index(index_dir,default_type,default_fields,postgres_backup)
 	type(index_dir)=="table" or error "index_dir must be table"
 	index_dir.to_uri_string and matches(index_dir.to_uri_string(),"^file:") or error "must be file"
 	local index = {}
 	index.dir = index_dir
-	local java_index, closer = LuceneIndex.getLuceneIndex(index_dir.java.file,default_type,default_fields)
+	local java_index, closer = LuceneIndex.getLuceneIndex(index_dir.java.file,default_type,default_fields,postgres_backup)
 	index.java = java_index
 	index.closer = closer or error()
 
@@ -69,6 +69,9 @@
 	index.count_tokens = java_index.count_tokens
 	index.close = closer.close
 
+	index.has_postgres_backup = java_index.hasPostgresBackup()
+	index.rebuild_postgres_backup = java_index.rebuild_postgres_backup
+
 	function index.search( query, from, to, options )
 		from or error "missing 'from' parameter"
 		to or error "missing 'to' parameter"