comparison src/lib/Db.luan @ 15:0edde02b908c

edit in place
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 05 Jul 2022 23:27:54 -0600
parents de0cbf515ef5
children 7ce54f6d93f2
comparison
equal deleted inserted replaced
14:7d0c96408abf 15:0edde02b908c
1 local Luan = require "luan:Luan.luan" 1 local Luan = require "luan:Luan.luan"
2 local error = Luan.error 2 local error = Luan.error
3 local new_error = Luan.new_error or error()
3 local Lucene = require "luan:lucene/Lucene.luan" 4 local Lucene = require "luan:lucene/Lucene.luan"
4 local Io = require "luan:Io.luan" 5 local Io = require "luan:Io.luan"
5 local uri = Io.uri or error() 6 local uri = Io.uri or error()
7 local Logging = require "luan:logging/Logging.luan"
8 local logger = Logging.logger "Db"
6 9
7 10
8 local dir = uri("site:/private/local/lucene") 11 local dir = uri("site:/private/local/lucene")
9 12
10 local Db = Lucene.index( dir, {} ) 13 local Db = Lucene.index( dir, {} )
14 17
15 Db.indexed_fields.post_author_name = Lucene.type.string 18 Db.indexed_fields.post_author_name = Lucene.type.string
16 Db.indexed_fields.post_is_root = Lucene.type.string 19 Db.indexed_fields.post_is_root = Lucene.type.string
17 Db.indexed_fields.post_root_id = Lucene.type.long 20 Db.indexed_fields.post_root_id = Lucene.type.long
18 21
22 function Db.not_in_transaction()
23 logger.error(new_error("not in transaction"))
24 end
25
19 return Db 26 return Db