view src/lib/Db.luan @ 47:7ef9222474e2

add more button
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 14 Nov 2022 23:01:29 -0700
parents 0edde02b908c
children 7ce54f6d93f2
line wrap: on
line source

local Luan = require "luan:Luan.luan"
local error = Luan.error
local new_error = Luan.new_error or error()
local Lucene = require "luan:lucene/Lucene.luan"
local Io = require "luan:Io.luan"
local uri = Io.uri or error()
local Logging = require "luan:logging/Logging.luan"
local logger = Logging.logger "Db"


local dir = uri("site:/private/local/lucene")

local Db = Lucene.index( dir, {} )

Db.indexed_fields.user_email = Lucene.type.lowercase
Db.indexed_fields.user_name = Lucene.type.lowercase

Db.indexed_fields.post_author_name = Lucene.type.string
Db.indexed_fields.post_is_root = Lucene.type.string
Db.indexed_fields.post_root_id = Lucene.type.long

function Db.not_in_transaction()
	logger.error(new_error("not in transaction"))
end

return Db