Mercurial Hosting > luan
diff blog/src/lib/Db_mod.luan @ 596:6bb0c83116e9
add blog sample app
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 15 Sep 2015 21:30:33 -0600 |
parents | |
children | 50540f0813e2 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blog/src/lib/Db_mod.luan Tue Sep 15 21:30:33 2015 -0600 @@ -0,0 +1,19 @@ +local Lucene = require "luan:lucene/Lucene" +local Io = require "luan:Io" + + +local M = {} + +M.lucene_dir = "site:/private/local/lucene" + +function M.new_db() + local dir = Io.uri(M.lucene_dir).to_string() + local db = Lucene.index(dir) + +-- this is how you index a field +-- db.indexed_fields.post_date = Lucene.type.long + + return db +end + +return M