Mercurial Hosting > luan
diff src/luan/modules/lucene/Lucene.luan @ 1716:b82767112d8e
add String.regex
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 24 Jul 2022 23:43:03 -0600 |
parents | 2958cf04d844 |
children | f8950d99f47d |
line wrap: on
line diff
--- a/src/luan/modules/lucene/Lucene.luan Sat Jul 23 21:53:04 2022 -0600 +++ b/src/luan/modules/lucene/Lucene.luan Sun Jul 24 23:43:03 2022 -0600 @@ -15,7 +15,7 @@ local Io = require "luan:Io.luan" local uri = Io.uri or error() local String = require "luan:String.luan" -local matches = String.matches or error() +local starts_with = String.starts_with or error() local Rpc = require "luan:Rpc.luan" local LuceneIndex = require "java:luan.modules.lucene.LuceneIndex" local NumberFieldParser = require "java:goodjava.lucene.queryparser.NumberFieldParser" @@ -64,7 +64,7 @@ local function get_file(f) type(f)=="table" or error "index_dir must be table" - f.to_uri_string and matches(f.to_uri_string(),"^file:") or error "index_dir must be file" + f.to_uri_string and starts_with(f.to_uri_string(),"file:") or error "index_dir must be file" return f.java.file or error() end