From: Sarah Hoffmann Date: Wed, 21 Jul 2021 08:52:34 +0000 (+0200) Subject: adapt special terms lookup to new word table X-Git-Tag: v4.0.0~45^2~7 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/6ad35aca4aadbf436e9dce776134f9ce4d2e69c6?hp=70f154be8b69d3b57eebd25eff225ee29ccc97ba adapt special terms lookup to new word table --- diff --git a/lib-php/tokenizer/legacy_icu_tokenizer.php b/lib-php/tokenizer/legacy_icu_tokenizer.php index 314bd27e..796635ee 100644 --- a/lib-php/tokenizer/legacy_icu_tokenizer.php +++ b/lib-php/tokenizer/legacy_icu_tokenizer.php @@ -19,7 +19,7 @@ class Tokenizer public function checkStatus() { - $sSQL = "SELECT word_id FROM word WHERE word_token IN (' a')"; + $sSQL = "SELECT word_id FROM word WHERE word_token == 'a'"; $iWordID = $this->oDB->getOne($sSQL); if ($iWordID === false) { throw new Exception('Query failed', 703); @@ -55,9 +55,8 @@ class Tokenizer { $aResults = array(); - $sSQL = 'SELECT word_id, class, type FROM word '; - $sSQL .= ' WHERE word_token = \' \' || :term'; - $sSQL .= ' AND class is not null AND class not in (\'place\')'; + $sSQL = "SELECT word_id, info->>'class' as class, info->>'type' as type "; + $sSQL .= ' FROM word WHERE word_token = :term and type = \'S\''; Debug::printVar('Term', $sTerm); Debug::printSQL($sSQL);