ICU: add an index over word_ids

Needed for keyword lookup in the details response.
This commit is contained in:
Sarah Hoffmann 2021-10-25 21:33:27 +02:00
parent 8e439d3dd9
commit 85797acf1e
2 changed files with 5 additions and 1 deletions

View File

@ -1,2 +1,3 @@
-- Required for details lookup.
CREATE INDEX IF NOT EXISTS idx_word_word_id
ON word USING BTREE (word_id) {{db.tablespace.search_index}};

View File

@ -67,10 +67,13 @@ class LegacyICUTokenizer(AbstractTokenizer):
self.term_normalization = get_property(conn, DBCFG_TERM_NORMALIZATION)
def finalize_import(self, _):
def finalize_import(self, config):
""" Do any required postprocessing to make the tokenizer data ready
for use.
"""
with connect(self.dsn) as conn:
sqlp = SQLPreprocessor(conn, config)
sqlp.run_sql_file(conn, 'tokenizer/legacy_tokenizer_indices.sql')
def update_sql_functions(self, config):