From 27753fb8dbce6bb595f95bad637078ab2106d794 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Tue, 28 Apr 2015 21:37:51 +0200 Subject: [PATCH] remove check for class/type shortcuts which were never implemented fixes #266 --- lib/Geocode.php | 13 ------------- tests/features/api/search.feature | 6 ++++++ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/lib/Geocode.php b/lib/Geocode.php index 7bd4f552..5f4a0174 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -578,18 +578,6 @@ else $aSearch['sOperator'] = 'near'; // near = in for the moment if (strlen($aSearchTerm['operator']) == 0) $aSearch['iSearchRank'] += 1; - // Do we have a shortcut id? - if ($aSearch['sOperator'] == 'name') - { - $sSQL = "select get_tagpair('".$aSearch['sClass']."', '".$aSearch['sType']."')"; - if ($iAmenityID = $this->oDB->getOne($sSQL)) - { - $aValidTokens[$aSearch['sClass'].':'.$aSearch['sType']] = array('word_id' => $iAmenityID); - $aSearch['aName'][$iAmenityID] = $iAmenityID; - $aSearch['sClass'] = ''; - $aSearch['sType'] = ''; - } - } if ($aSearch['iSearchRank'] < $this->iMaxRank) $aNewWordsetSearches[] = $aSearch; } } @@ -768,7 +756,6 @@ if (!$this->sQuery && !$this->aStructuredQuery) return false; $sLanguagePrefArraySQL = "ARRAY[".join(',',array_map("getDBQuoted",$this->aLangPrefOrder))."]"; - $sCountryCodesSQL = false; if ($this->aCountryCodes && sizeof($this->aCountryCodes)) { diff --git a/tests/features/api/search.feature b/tests/features/api/search.feature index ac378b0e..859faa76 100644 --- a/tests/features/api/search.feature +++ b/tests/features/api/search.feature @@ -74,3 +74,9 @@ Feature: Search queries Then results contain | ID | display_name | 0 | Illinois.* + + Scenario: Search with class-type feature + When sending jsonv2 search query "Hotel California" + Then results contain + | place_rank + | 30 -- 2.39.5