comparison examples/blog/src/lib/Db_mod.luan @ 1088:bae2d0c2576c

change module naming convention
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 26 Dec 2016 22:29:36 -0700
parents c38f6619feb9
children
comparison
equal deleted inserted replaced
1087:4aab4dd3ac9c 1088:bae2d0c2576c
1 local Lucene = require "luan:lucene/Lucene.luan" 1 local Lucene = require "luan:lucene/Lucene.luan"
2 local Io = require "luan:Io.luan" 2 local Io = require "luan:Io.luan"
3 3
4 4
5 local M = {} 5 local Db_mod = {}
6 6
7 M.lucene_dir = "site:/private/local/lucene" 7 Db_mod.lucene_dir = "site:/private/local/lucene"
8 8
9 function M.new_db() 9 function Db_mod.new_db()
10 local dir = Io.uri(M.lucene_dir).to_string() 10 local dir = Io.uri(Db_mod.lucene_dir).to_string()
11 local db = Lucene.index( dir, Lucene.type.english, {"subject","content"} ) 11 local db = Lucene.index( dir, Lucene.type.english, {"subject","content"} )
12 12
13 -- this is how you index a field 13 -- this is how you index a field
14 -- db.indexed_fields.post_date = Lucene.type.long 14 -- db.indexed_fields.post_date = Lucene.type.long
15 15
16 return db 16 return db
17 end 17 end
18 18
19 return M 19 return Db_mod