]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 18 Apr 2017 20:45:34 +0000 (22:45 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 18 Apr 2017 20:45:34 +0000 (22:45 +0200)
data/words.sql
sql/words.sql
utils/setup.php

index b15686d7a53af5f5ef065afb8d663e9e4dbfb08f..fb7cd61bb1c81f7bafaab204571f94e31cb8b3fe 100644 (file)
@@ -49636,8 +49636,8 @@ kein    100
 -- prefill word table
 
 select count(make_keywords(v)) from (select distinct svals(name) as v from place) as w where v is not null;
-select count(make_keywords(v)) from (select distinct postcode as v from place) as w where v is not null;
-select count(getorcreate_housenumber_id(make_standard_name(v))) from (select distinct housenumber as v from place where housenumber is not null) as w;
+select count(make_keywords(v)) from (select distinct address->'postcode' as v from place where address ? 'postcode') as w where v is not null;
+select count(getorcreate_housenumber_id(make_standard_name(v))) from (select distinct address->'housenumber' as v from place where address ? 'housenumber') as w;
 
 -- copy the word frequencies
 update word set search_name_count = count from word_frequencies wf where wf.word_token = word.word_token;
index 9c2f30688752ab984cd776d5152f93b05737a25c..654fee70639e12035b5892e567c970c10057f0d8 100644 (file)
@@ -4,8 +4,8 @@ CREATE TABLE word_frequencies AS
     WHERE v is not null
  GROUP BY id);
 
-select count(make_keywords(v)) from (select distinct postcode as v from place) as w where v is not null;
-select count(getorcreate_housenumber_id(make_standard_name(v))) from (select distinct housenumber as v from place where housenumber is not null) as w;
+select count(make_keywords(v)) from (select distinct address->'postcode' as v from place where address ? 'postcode') as w where v is not null;
+select count(getorcreate_housenumber_id(make_standard_name(v))) from (select distinct address->'housenumber' as v from place where address ? 'housenumber') as w;
 
 -- copy the word frequencies
 update word set search_name_count = count from word_frequencies wf where wf.id = word.word_id;
index 0814794fc34722a2517ba2fec19381606226ba66..fae200cc71fa92f2659c1ee01822bba8673f800d 100755 (executable)
@@ -369,7 +369,9 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) {
         $sSQL .= 'select * from place where osm_id % '.$iLoadThreads.' = '.$i;
         $sSQL .= " and not (class='place' and type='houses' and osm_type='W' and ST_GeometryType(geometry) = 'ST_LineString')";
         if ($aCMDResult['verbose']) echo "$sSQL\n";
-        if (!pg_send_query($aDBInstances[$i]->connection, $sSQL)) fail(pg_last_error($oDB->connection));
+        if (!pg_send_query($aDBInstances[$i]->connection, $sSQL)) {
+            fail(pg_last_error($aDBInstances[$i]->connection));
+        }
     }
     // last thread for interpolation lines
     $aDBInstances[$iLoadThreads] =& getDB(true);
@@ -378,7 +380,9 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) {
     $sSQL .= ' SELECT osm_id, address, geometry from place where ';
     $sSQL .= "class='place' and type='houses' and osm_type='W' and ST_GeometryType(geometry) = 'ST_LineString'";
     if ($aCMDResult['verbose']) echo "$sSQL\n";
-    if (!pg_send_query($aDBInstances[$i]->connection, $sSQL)) fail(pg_last_error($oDB->connection));
+    if (!pg_send_query($aDBInstances[$iLoadThreads]->connection, $sSQL)) {
+        fail(pg_last_error($aDBInstances[$iLoadThreads]->connection));
+    }
 
     $bAnyBusy = true;
     while ($bAnyBusy) {