]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/search.php
use geometry column for special phrase queries
[nominatim.git] / website / search.php
index 1d877e77ebfdf76564e1d8b0cab03bc47cb06fa1..30f7abde0e47ea2e49ef6199e039ec3e85c9f612 100755 (executable)
                                $sQuery = str_replace($aSpecialTerm[0], ' ', $sQuery);
                                $sToken = $oDB->getOne("select make_standard_name('".$aSpecialTerm[1]."') as string");
                                $sSQL = 'select * from (select word_id,word_token, word, class, type, location, country_code, operator';
-                               $sSQL .= ' from word where word_token in (\' '.$sToken.'\')) as x where (class is not null and class not in (\'place\',\'highway\')) or country_code is not null';
+                               $sSQL .= ' from word where word_token in (\' '.$sToken.'\')) as x where (class is not null and class not in (\'place\')) or country_code is not null';
                                if (CONST_Debug) var_Dump($sSQL);
                                $aSearchWords = $oDB->getAll($sSQL);
                                $aNewSearches = array();
                        $sSQL = 'select word_id,word_token, word, class, type, location, country_code, operator';
                        $sSQL .= ' from word where word_token in ('.join(',',array_map("getDBQuoted",$aTokens)).')';
                        $sSQL .= ' and search_name_count < '.CONST_Max_Word_Frequency;
-                       $sSQL .= ' and (class is null or class not in (\'highway\'))';
 //                     $sSQL .= ' group by word_token, word, class, type, location, country_code';
 
                        if (CONST_Debug) var_Dump($sSQL);
                                                        else
                                                        {
                                                                $sSQL = "select place_id from placex where class='".$aSearch['sClass']."' and type='".$aSearch['sType']."'";
-                                                               $sSQL .= " and st_contains($sViewboxSmallSQL, centroid)";
+                                                               $sSQL .= " and st_contains($sViewboxSmallSQL, geometry)";
                                                                if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)";                                                             
                                                                if ($sViewboxCentreSQL) $sSQL .= " order by st_distance($sViewboxCentreSQL, centroid) asc";
                                                                $sSQL .= " limit $iLimit";