aboutsummaryrefslogtreecommitdiff
path: root/sources/master/search.sql
blob: 7cc8643bcde8d8f187457772a7bd3ea93e997625 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- ============================================================================
--
--  Taginfo
--
--  search.sql
--
-- ============================================================================

.bail ON

PRAGMA journal_mode  = OFF;
PRAGMA synchronous   = OFF;
PRAGMA temp_store    = MEMORY;
PRAGMA cache_size    = 5000000;

ATTACH DATABASE '__DIR__/db/taginfo-db.db' AS db;

DROP TABLE IF EXISTS ftsearch;
CREATE VIRTUAL TABLE ftsearch USING fts3 (
    tokenize=__TOKENIZER__,
    key       TEXT,
    value     TEXT,
    count_all INTEGER
);

INSERT INTO ftsearch (key, value, count_all) SELECT key, value, count_all FROM db.tags;

ANALYZE;