Mercurial Hosting > luan
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 595:8370c4009cce | 596:6bb0c83116e9 |
|---|---|
| 1 local Lucene = require "luan:lucene/Lucene" | |
| 2 local Io = require "luan:Io" | |
| 3 | |
| 4 | |
| 5 local M = {} | |
| 6 | |
| 7 M.lucene_dir = "site:/private/local/lucene" | |
| 8 | |
| 9 function M.new_db() | |
| 10 local dir = Io.uri(M.lucene_dir).to_string() | |
| 11 local db = Lucene.index(dir) | |
| 12 | |
| 13 -- this is how you index a field | |
| 14 -- db.indexed_fields.post_date = Lucene.type.long | |
| 15 | |
| 16 return db | |
| 17 end | |
| 18 | |
| 19 return M |
