add function to recalculate counts for full-word search term

This commit is contained in:
Sarah Hoffmann
2017-10-28 18:34:22 +02:00
parent 35c7269bac
commit cbaabe7c24
2 changed files with 18 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ $aCMDOptions
array('index-instances', '', 0, 1, 1, 1, 'int', 'Number of indexing instances (threads)'),
array('deduplicate', '', 0, 1, 0, 0, 'bool', 'Deduplicate tokens'),
array('recompute-word-counts', '', 0, 1, 0, 0, 'bool', 'Compute frequency of full-word search terms'),
array('no-npi', '', 0, 1, 0, 0, 'bool', '(obsolete)'),
);
getCmdOpt($_SERVER['argv'], $aCMDOptions, $aResult, true, true);
@@ -237,6 +238,12 @@ if ($aResult['deduplicate']) {
}
}
if ($aResult['recompute-word-counts']) {
info('Recompute frequency of full-word search terms');
$sTemplate = file_get_contents(CONST_BasePath.'/sql/words_from_search_name.sql');
runSQLScript($sTemplate, true, true);
}
if ($aResult['index']) {
passthru(CONST_InstallPath.'/nominatim/nominatim -i -d '.$aDSNInfo['database'].' -P '.$aDSNInfo['port'].' -t '.$aResult['index-instances'].' -r '.$aResult['index-rank']);
}