comparison src/luan/modules/lucene/Lucene.luan @ 1459:b04b8fc5f4f4

GoodQueryParser
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 20 Mar 2020 11:06:53 -0600
parents 6b6c11c9164e
children 13cbce740e1e
comparison
equal deleted inserted replaced
1458:6b6c11c9164e 1459:b04b8fc5f4f4
14 local String = require "luan:String.luan" 14 local String = require "luan:String.luan"
15 local matches = String.matches or error() 15 local matches = String.matches or error()
16 local Rpc = require "luan:Rpc.luan" 16 local Rpc = require "luan:Rpc.luan"
17 local LuceneIndex = require "java:luan.modules.lucene.LuceneIndex" 17 local LuceneIndex = require "java:luan.modules.lucene.LuceneIndex"
18 local NumberFieldParser = require "java:goodjava.lucene.queryparser.NumberFieldParser" 18 local NumberFieldParser = require "java:goodjava.lucene.queryparser.NumberFieldParser"
19 local SaneQueryParser = require "java:goodjava.lucene.queryparser.SaneQueryParser" 19 local GoodQueryParser = require "java:goodjava.lucene.queryparser.GoodQueryParser"
20 local Logging = require "luan:logging/Logging.luan" 20 local Logging = require "luan:logging/Logging.luan"
21 local logger = Logging.logger "Lucene" 21 local logger = Logging.logger "Lucene"
22 22
23 23
24 local Lucene = {} 24 local Lucene = {}
29 integer = NumberFieldParser.INT 29 integer = NumberFieldParser.INT
30 long = NumberFieldParser.LONG 30 long = NumberFieldParser.LONG
31 double = NumberFieldParser.DOUBLE 31 double = NumberFieldParser.DOUBLE
32 } 32 }
33 33
34 Lucene.quote = SaneQueryParser.quote 34 Lucene.quote = GoodQueryParser.quote
35 35
36 function Lucene.index(index_dir,options) 36 function Lucene.index(index_dir,options)
37 type(index_dir)=="table" or error "index_dir must be table" 37 type(index_dir)=="table" or error "index_dir must be table"
38 index_dir.to_uri_string and matches(index_dir.to_uri_string(),"^file:") or error "must be file" 38 index_dir.to_uri_string and matches(index_dir.to_uri_string(),"^file:") or error "must be file"
39 options = options or {} 39 options = options or {}