]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/search.php
update osm2pgsql version
[nominatim.git] / website / search.php
index f262a3f168a8fe953f7d50e51b8e96acdc8c23e7..139ed0f65fb29e9695f2a21da584a8bef242f381 100755 (executable)
                                array('county', 9, 13),
                                array('state', 8, 8),
                                array('country', 4, 4),
-                               array('postalcode', 16, 25),
+                               array('postalcode', 5, 11),
                                );
        $aStructuredQuery = array();
        $sAllowedTypesSQLList = '';
                                $aSpecialTerms[strtolower($aSpecialTerm[1])] = $aSpecialTerm[2];
                        }
 
-                       preg_match_all('/\\[([a-zA-Z]*)\\]/', $sQuery, $aSpecialTermsRaw, PREG_SET_ORDER);
+                       preg_match_all('/\\[([\\w ]*)\\]/u', $sQuery, $aSpecialTermsRaw, PREG_SET_ORDER);
                        $aSpecialTerms = array();
                        if (isset($aStructuredQuery['amenity']) && $aStructuredQuery['amenity'])
                        {
                        {
                                $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 = 'select * from (select word_id,word_token, word, class, type, country_code, operator';
                                $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);
                        {
 
                        // Check which tokens we have, get the ID numbers                       
-                       $sSQL = 'select word_id,word_token, word, class, type, location, country_code, operator, search_name_count';
+                       $sSQL = 'select word_id,word_token, word, class, type, country_code, operator, search_name_count';
                        $sSQL .= ' from word where word_token in ('.join(',',array_map("getDBQuoted",$aTokens)).')';
 //                     $sSQL .= ' and search_name_count < '.CONST_Max_Word_Frequency;
-//                     $sSQL .= ' group by word_token, word, class, type, location, country_code';
+//                     $sSQL .= ' group by word_token, word, class, type, country_code';
 
                        if (CONST_Debug) var_Dump($sSQL);