]> git.openstreetmap.org Git - nominatim.git/commitdiff
make index work and remove more hard-coded DB names
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 22 May 2012 19:05:31 +0000 (21:05 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 23 May 2012 21:32:12 +0000 (23:32 +0200)
utils/update.php

index a3b361b1a14df83669a6bbf9cf807b3a1e5384a4..21ac524d3d64cd8a4a5e0ce95c71eae91e5e9be0 100755 (executable)
@@ -46,6 +46,7 @@
        }
 
        if (!isset($aResult['index-instances'])) $aResult['index-instances'] = 1;
        }
 
        if (!isset($aResult['index-instances'])) $aResult['index-instances'] = 1;
+       if (!isset($aResult['index-rank'])) $aResult['index-rank'] = 0;
 /*
        // Lock to prevent multiple copies running
        if (exec('/bin/ps uww | grep '.basename(__FILE__).' | grep -v /dev/null | grep -v grep -c', $aOutput2, $iResult) > 1)
 /*
        // Lock to prevent multiple copies running
        if (exec('/bin/ps uww | grep '.basename(__FILE__).' | grep -v /dev/null | grep -v grep -c', $aOutput2, $iResult) > 1)
 
        if ($aResult['index'])
        {
 
        if ($aResult['index'])
        {
-               index($aResult, $sDatabaseDSN);
+               passthru(CONST_BasePath.'/nominatim/nominatim -i -d '.$aDSNInfo['database'].' -t '.$aResult['index-instances'].' -r '.$aResult['index-rank']);
        }
 
        if ($aResult['import-osmosis'] || $aResult['import-osmosis-all'])
        }
 
        if ($aResult['import-osmosis'] || $aResult['import-osmosis-all'])
                $sImportFile = CONST_BasePath.'/data/osmosischange.osc';
                $sOsmosisCMD = CONST_Osmosis_Binary;
                $sOsmosisConfigDirectory = CONST_BasePath.'/settings';
                $sImportFile = CONST_BasePath.'/data/osmosischange.osc';
                $sOsmosisCMD = CONST_Osmosis_Binary;
                $sOsmosisConfigDirectory = CONST_BasePath.'/settings';
-               $sDatabaseName = 'nominatim';
                $sCMDDownload = $sOsmosisCMD.' --read-replication-interval workingDirectory='.$sOsmosisConfigDirectory.' --simplify-change --write-xml-change '.$sImportFile;
                $sCMDDownload = $sOsmosisCMD.' --read-replication-interval workingDirectory='.$sOsmosisConfigDirectory.' --simplify-change --write-xml-change '.$sImportFile;
-               $sCMDImport = CONST_Osm2pgsql_Binary.' -klas -C 2000 -O gazetteer -d '.$sDatabaseName.' '.$sImportFile;
-               $sCMDIndex = $sBasePath.'/nominatim/nominatim -i -t '.$aResult['index-instances'];
+               $sCMDImport = CONST_Osm2pgsql_Binary.' -klas -C 2000 -O gazetteer -d '.$aDSNInfo['database'].' '.$sImportFile;
+               $sCMDIndex = $sBasePath.'/nominatim/nominatim -i -d '.$aDSNInfo['database'].' -t '.$aResult['index-instances'];
                if (!$aResult['no-npi']) {
                        $sCMDIndex .= '-F ';
                }
                if (!$aResult['no-npi']) {
                        $sCMDIndex .= '-F ';
                }