Mercurial Hosting > luan
comparison 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 |
comparison
equal
deleted
inserted
replaced
778:305ffb00ebc1 | 779:c38f6619feb9 |
---|---|
1 local Lucene = require "luan:lucene/Lucene.luan" | |
2 local Io = require "luan:Io.luan" | |
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, Lucene.type.english, {"subject","content"} ) | |
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 |