X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/e467b956ffbe32acbec2ae0bf7ef029a66f2ede0..3475e1dfd6c1ef44b7e2cc046d62a6f50108b6a0:/lib/admin/update.php diff --git a/lib/admin/update.php b/lib/admin/update.php index 50f611d7..fe9658b5 100644 --- a/lib/admin/update.php +++ b/lib/admin/update.php @@ -105,25 +105,14 @@ if ($fPostgresVersion >= 11.0) { } -$oIndexCmd = (new \Nominatim\Shell(CONST_DataDir.'/nominatim/nominatim.py')) - ->addParams('--database', $aDSNInfo['database']) - ->addParams('--port', $aDSNInfo['port']) - ->addParams('--threads', $aResult['index-instances']); -if (!$aResult['quiet']) { - $oIndexCmd->addParams('--verbose'); +$oIndexCmd = (new \Nominatim\Shell(getSetting('NOMINATIM_TOOL'))) + ->addParams('index'); +if ($aResult['quiet']) { + $oIndexCmd->addParams('--quiet'); } if ($aResult['verbose']) { $oIndexCmd->addParams('--verbose'); } -if (isset($aDSNInfo['hostspec']) && $aDSNInfo['hostspec']) { - $oIndexCmd->addParams('--host', $aDSNInfo['hostspec']); -} -if (isset($aDSNInfo['username']) && $aDSNInfo['username']) { - $oIndexCmd->addParams('--username', $aDSNInfo['username']); -} -if (isset($aDSNInfo['password']) && $aDSNInfo['password']) { - $oIndexCmd->addEnvPair('PGPASSWORD', $aDSNInfo['password']); -} $sPyosmiumBin = getSetting('PYOSMIUM_BINARY'); $sBaseURL = getSetting('REPLICATION_URL'); @@ -288,15 +277,9 @@ if ($aResult['recompute-word-counts']) { } if ($aResult['index']) { - $oCmd = (clone $oIndexCmd) - ->addParams('--minrank', $aResult['index-rank'], '-b'); - $oCmd->run(); - $oCmd = (clone $oIndexCmd) ->addParams('--minrank', $aResult['index-rank']); $oCmd->run(); - - $oDB->exec('update import_status set indexed = true'); } if ($aResult['update-address-levels']) { @@ -438,15 +421,6 @@ if ($aResult['import-osmosis'] || $aResult['import-osmosis-all']) { if (!$aResult['no-index']) { $fCMDStartTime = time(); - $oThisIndexCmd = clone($oIndexCmd); - $oThisIndexCmd->addParams('-b'); - echo $oThisIndexCmd->escapedCmd()."\n"; - $iErrorLevel = $oThisIndexCmd->run(); - if ($iErrorLevel) { - echo "Error: $iErrorLevel\n"; - exit($iErrorLevel); - } - $oThisIndexCmd = clone($oIndexCmd); echo $oThisIndexCmd->escapedCmd()."\n"; $iErrorLevel = $oThisIndexCmd->run(); @@ -463,9 +437,6 @@ if ($aResult['import-osmosis'] || $aResult['import-osmosis-all']) { var_Dump($sSQL); $oDB->exec($sSQL); echo date('Y-m-d H:i:s')." Completed index step for $sBatchEnd in ".round((time()-$fCMDStartTime)/60, 2)." minutes\n"; - - $sSQL = 'update import_status set indexed = true'; - $oDB->exec($sSQL); } else { if ($aResult['import-osmosis-all']) { echo "Error: --no-index cannot be used with continuous imports (--import-osmosis-all).\n";