aboutsummaryrefslogtreecommitdiff
path: root/backend/hist_data/gen_events_data.py
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2023-01-05 17:13:03 +1100
committerTerry Truong <terry06890@gmail.com>2023-01-05 17:23:39 +1100
commit442c0bbffc5c372c7ec3510914968f75ab6e4a4f (patch)
treebc3ae52ec3954ce574961bce9d64f2d02516d18b /backend/hist_data/gen_events_data.py
parenta3b13e700d8d65e27c1d90960b6ab6292e433c2c (diff)
Add partially-complete search modal
For now, use placeholder code for jumping to a search result. Add db index for case-insensitive event title searching. Make type=info requests accept title instead of ID (for looking up a searched-for title). Make EventInfo contain an Event field (for showing info in search suggestions). Add titleToEvent map in App, for use by SearchModal to look up searched-for titles. Add keyboard shortcuts to open/close search and info modals.
Diffstat (limited to 'backend/hist_data/gen_events_data.py')
-rwxr-xr-xbackend/hist_data/gen_events_data.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/backend/hist_data/gen_events_data.py b/backend/hist_data/gen_events_data.py
index ee2fdc1..118b40c 100755
--- a/backend/hist_data/gen_events_data.py
+++ b/backend/hist_data/gen_events_data.py
@@ -178,6 +178,7 @@ def genData(wikidataFile: str, offsetsFile: str, dbFile: str, nProcs: int) -> No
dbCur.execute('CREATE TABLE events (id INT PRIMARY KEY, title TEXT UNIQUE, ' \
'start INT, start_upper INT, end INT, end_upper INT, fmt INT, ctg TEXT)')
dbCur.execute('CREATE INDEX events_id_start_idx ON events(id, start)')
+ dbCur.execute('CREATE INDEX events_title_nocase_idx ON events(title COLLATE NOCASE)')
if nProcs == 1:
with bz2.open(wikidataFile, mode='rb') as file:
for lineNum, line in enumerate(file, 1):