comparison examples/blog/src/lib/Db.luan @ 1387:bc40bc9aab3a

start postgres backup
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 02 Sep 2019 22:23:12 -0600
parents 709f7498a363
children 2024d23ddd64
comparison
equal deleted inserted replaced
1386:dc36dd8bf839 1387:bc40bc9aab3a
2 local Io = require "luan:Io.luan" 2 local Io = require "luan:Io.luan"
3 3
4 4
5 local Db = {} 5 local Db = {}
6 6
7 local function completer(doc)
8 return doc
9 end
10
7 function Db.new(lucene_dir) 11 function Db.new(lucene_dir)
8 local dir = Io.uri(lucene_dir) 12 local dir = Io.uri(lucene_dir)
9 local db = Lucene.index( dir, Lucene.type.english, {"subject","content"} ) 13 local db = Lucene.index( dir, Lucene.type.english, {"subject","content"}, completer )
10 14
11 -- this is how you index a field 15 -- this is how you index a field
12 -- db.indexed_fields.post_date = Lucene.type.long 16 -- db.indexed_fields.post_date = Lucene.type.long
13 17
14 return db 18 return db