Mercurial Hosting > luan
comparison examples/blog/src/lib/Db.luan @ 1224:4416b9cbebf9
minor
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Tue, 27 Mar 2018 16:13:22 -0600 |
| parents | 4721c482c86b |
| children | 709f7498a363 |
comparison
equal
deleted
inserted
replaced
| 1223:c7adcdf79bf2 | 1224:4416b9cbebf9 |
|---|---|
| 2 local Io = require "luan:Io.luan" | 2 local Io = require "luan:Io.luan" |
| 3 | 3 |
| 4 | 4 |
| 5 local Db = {} | 5 local Db = {} |
| 6 | 6 |
| 7 function Db.new_db(lucene_dir) | 7 function Db.new(lucene_dir) |
| 8 local dir = Io.uri(lucene_dir).to_string() | 8 local dir = Io.uri(lucene_dir).to_string() |
| 9 local db = Lucene.index( dir, Lucene.type.english, {"subject","content"} ) | 9 local db = Lucene.index( dir, Lucene.type.english, {"subject","content"} ) |
| 10 | 10 |
| 11 -- this is how you index a field | 11 -- this is how you index a field |
| 12 -- db.indexed_fields.post_date = Lucene.type.long | 12 -- db.indexed_fields.post_date = Lucene.type.long |
| 13 | 13 |
| 14 return db | 14 return db |
| 15 end | 15 end |
| 16 | 16 |
| 17 Db.db = Db.new_db("site:/private/local/lucene") | 17 Db.db = Db.new("site:/private/local/lucene") |
| 18 | 18 |
| 19 return Db | 19 return Db |
