comparison blog/src/lib/Db_mod.luan @ 599:50540f0813e2

support default search fields in lucene; add search to blog;
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 16 Sep 2015 20:55:49 -0600
parents 6bb0c83116e9
children ca169567ce07
comparison
equal deleted inserted replaced
598:e930f92d0f61 599:50540f0813e2
6 6
7 M.lucene_dir = "site:/private/local/lucene" 7 M.lucene_dir = "site:/private/local/lucene"
8 8
9 function M.new_db() 9 function M.new_db()
10 local dir = Io.uri(M.lucene_dir).to_string() 10 local dir = Io.uri(M.lucene_dir).to_string()
11 local db = Lucene.index(dir) 11 local db = Lucene.index( dir, Lucene.type.english, {"subject","content"} )
12 12
13 -- this is how you index a field 13 -- this is how you index a field
14 -- db.indexed_fields.post_date = Lucene.type.long 14 -- db.indexed_fields.post_date = Lucene.type.long
15 15
16 return db 16 return db