mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
move index creation for word table to tokenizer
This introduces a finalization routing for the tokenizer where it can post-process the import if necessary.
This commit is contained in:
@@ -135,6 +135,7 @@ class SetupAll:
|
||||
LOG.warning('Create search index for default country names.')
|
||||
database_import.create_country_names(conn, tokenizer,
|
||||
args.config.LANGUAGES)
|
||||
tokenizer.finalize_import(args.config)
|
||||
|
||||
webdir = args.project_dir / 'website'
|
||||
LOG.warning('Setup website at %s', webdir)
|
||||
|
||||
@@ -119,6 +119,15 @@ class LegacyTokenizer:
|
||||
self.normalization = properties.get_property(conn, DBCFG_NORMALIZATION)
|
||||
|
||||
|
||||
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):
|
||||
""" Reimport the SQL functions for this tokenizer.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user