$this->iCacheMemory = getCacheMemoryMB();
}
- $this->sModulePath = getSetting('DATABASE_MODULE_PATH', CONST_InstallDir.'/module');
+ $this->sModulePath = getSetting('DATABASE_MODULE_PATH');
+ if (!$this->sModulePath) {
+ $this->sModulePath = CONST_Default_ModulePath;
+ }
info('module path: ' . $this->sModulePath);
// parse database string
{
$this->checkModulePresence(); // raises exception on failure
- $oBaseCmd = (new \Nominatim\Shell(CONST_DataDir.'/nominatim/nominatim.py'))
- ->addParams('--database', $this->aDSNInfo['database'])
- ->addParams('--port', $this->aDSNInfo['port'])
- ->addParams('--threads', $this->iInstances);
+ $oBaseCmd = (new \Nominatim\Shell(getSetting('NOMINATIM_TOOL')))
+ ->addParams('index');
- if (!$this->bQuiet) {
- $oBaseCmd->addParams('-v');
+ if ($this->bQuiet) {
+ $oBaseCmd->addParams('-q');
}
if ($this->bVerbose) {
$oBaseCmd->addParams('-v');
}
- if (isset($this->aDSNInfo['hostspec'])) {
- $oBaseCmd->addParams('--host', $this->aDSNInfo['hostspec']);
- }
- if (isset($this->aDSNInfo['username'])) {
- $oBaseCmd->addParams('--user', $this->aDSNInfo['username']);
- }
- if (isset($this->aDSNInfo['password'])) {
- $oBaseCmd->addEnvPair('PGPASSWORD', $this->aDSNInfo['password']);
- }
info('Index ranks 0 - 4');
$oCmd = (clone $oBaseCmd)->addParams('--maxrank', 4);
if (!$bIndexNoanalyse) $this->pgsqlRunScript('ANALYSE');
info('Index administrative boundaries');
- $oCmd = (clone $oBaseCmd)->addParams('-b');
+ $oCmd = (clone $oBaseCmd)->addParams('--boundaries-only');
$iStatus = $oCmd->run();
if ($iStatus != 0) {
fail('error status ' . $iStatus . ' running nominatim!');
}
info('Index ranks 5 - 25');
- $oCmd = (clone $oBaseCmd)->addParams('--minrank', 5, '--maxrank', 25);
+ $oCmd = (clone $oBaseCmd)->addParams('--no-boundaries', '--minrank', 5, '--maxrank', 25);
$iStatus = $oCmd->run();
if ($iStatus != 0) {
fail('error status ' . $iStatus . ' running nominatim!');
if (!$bIndexNoanalyse) $this->pgsqlRunScript('ANALYSE');
info('Index ranks 26 - 30');
- $oCmd = (clone $oBaseCmd)->addParams('--minrank', 26);
+ $oCmd = (clone $oBaseCmd)->addParams('--no-boundaries', '--minrank', 26);
$iStatus = $oCmd->run();
if ($iStatus != 0) {
fail('error status ' . $iStatus . ' running nominatim!');
fwriteConstDef($rFile, 'LibDir', CONST_LibDir);
fwriteConstDef($rFile, 'DataDir', CONST_DataDir);
fwriteConstDef($rFile, 'InstallDir', CONST_InstallDir);
-
- fwrite($rFile, "if (file_exists(getenv('NOMINATIM_SETTINGS'))) require_once(getenv('NOMINATIM_SETTINGS'));\n\n");
-
fwriteConstDef($rFile, 'Database_DSN', getSetting('DATABASE_DSN'));
fwriteConstDef($rFile, 'Default_Language', getSetting('DEFAULT_LANGUAGE'));
fwriteConstDef($rFile, 'Log_DB', getSettingBool('LOG_DB'));