comparison src/luan/modules/lucene/Lucene.luan @ 1685:46cf5137cb6b

misc fixes
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 08 Jun 2022 20:13:54 -0600
parents 8dd8c556c449
children f48db13ae2d9
comparison
equal deleted inserted replaced
1684:cfbecf7af56f 1685:46cf5137cb6b
60 } 60 }
61 61
62 Lucene.quote = GoodQueryParser.quote 62 Lucene.quote = GoodQueryParser.quote
63 Lucene.escape = GoodQueryParser.escape 63 Lucene.escape = GoodQueryParser.escape
64 64
65 local function get_file(f,name) 65 local function get_file(f)
66 type(f)=="table" or error(name.." must be table") 66 type(f)=="table" or error "index_dir must be table"
67 f.to_uri_string and matches(f.to_uri_string(),"^file:") or error(name.." must be file") 67 f.to_uri_string and matches(f.to_uri_string(),"^file:") or error "index_dir must be file"
68 return f.java.file or error() 68 return f.java.file or error()
69 end 69 end
70 70
71 function Lucene.index(index_dir,options) 71 function Lucene.index(index_dir,options)
72 options = options or {}
72 local index = {} 73 local index = {}
73 local options_name = options.name 74 local options_name = options.name
74 index.dir = index_dir 75 index.dir = index_dir
75 index_dir = get_file(index_dir) 76 index_dir = get_file(index_dir)
76 options = options or {} 77 options = options or {}