]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/tokenizer/icu_tokenizer.py
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / nominatim / tokenizer / icu_tokenizer.py
index 4b9dac69e18eb63760c07ff71a981f1343ab6ac3..70273b90e0af59e43a6a58108ffb427b31b5a654 100644 (file)
@@ -163,6 +163,8 @@ class ICUTokenizer(AbstractTokenizer):
                 else:
                     LOG.info('Computing word frequencies')
                     cur.drop_table('word_frequencies')
+                    cur.execute('ANALYSE search_name')
+                    cur.execute('ANALYSE word')
                     cur.execute("""
                       CREATE TEMP TABLE word_frequencies AS
                       WITH word_freq AS MATERIALIZED (
@@ -190,6 +192,7 @@ class ICUTokenizer(AbstractTokenizer):
                                             END) as info
                                     FROM word LEFT JOIN word_frequencies wf
                                          ON word.word_id = wf.id
+                                    ORDER BY word_id
                                 """)
                     cur.drop_table('word_frequencies')