Mercurial Hosting > luan
diff examples/blog/src/lib/Db_mod.luan @ 779:c38f6619feb9
move blog into examples
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 28 Aug 2016 14:50:47 -0600 |
parents | blog/src/lib/Db_mod.luan@ca169567ce07 |
children | bae2d0c2576c |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/blog/src/lib/Db_mod.luan Sun Aug 28 14:50:47 2016 -0600 @@ -0,0 +1,19 @@ +local Lucene = require "luan:lucene/Lucene.luan" +local Io = require "luan:Io.luan" + + +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, Lucene.type.english, {"subject","content"} ) + +-- this is how you index a field +-- db.indexed_fields.post_date = Lucene.type.long + + return db +end + +return M