annotate src/lib/Db.luan @ 8:be36282b556a

add new_thread
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 29 Jun 2022 00:04:09 -0600
parents fc3ee39d7764
children de0cbf515ef5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
fc2383eb48a9 set config
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Luan = require "luan:Luan.luan"
fc2383eb48a9 set config
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local error = Luan.error
fc2383eb48a9 set config
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 local Lucene = require "luan:lucene/Lucene.luan"
fc2383eb48a9 set config
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 local Io = require "luan:Io.luan"
fc2383eb48a9 set config
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 local uri = Io.uri or error()
fc2383eb48a9 set config
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6
fc2383eb48a9 set config
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7
fc2383eb48a9 set config
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 local dir = uri("site:/private/local/lucene")
fc2383eb48a9 set config
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9
fc2383eb48a9 set config
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 local Db = Lucene.index( dir, {} )
fc2383eb48a9 set config
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11
3
Franklin Schmidt <fschmidt@gmail.com>
parents: 2
diff changeset
12 Db.indexed_fields.user_email = Lucene.type.lowercase
Franklin Schmidt <fschmidt@gmail.com>
parents: 2
diff changeset
13 Db.indexed_fields.user_name = Lucene.type.lowercase
Franklin Schmidt <fschmidt@gmail.com>
parents: 2
diff changeset
14
8
be36282b556a add new_thread
Franklin Schmidt <fschmidt@gmail.com>
parents: 3
diff changeset
15 Db.indexed_fields.post_author_id = Lucene.type.long
be36282b556a add new_thread
Franklin Schmidt <fschmidt@gmail.com>
parents: 3
diff changeset
16 Db.indexed_fields.post_author_name = Lucene.type.string
be36282b556a add new_thread
Franklin Schmidt <fschmidt@gmail.com>
parents: 3
diff changeset
17 Db.indexed_fields.post_is_root = Lucene.type.string
be36282b556a add new_thread
Franklin Schmidt <fschmidt@gmail.com>
parents: 3
diff changeset
18 Db.indexed_fields.post_root_id = Lucene.type.long
be36282b556a add new_thread
Franklin Schmidt <fschmidt@gmail.com>
parents: 3
diff changeset
19
2
fc2383eb48a9 set config
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 return Db