]> git.openstreetmap.org Git - nominatim.git/commitdiff
option to get list of search keywords
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Fri, 25 Mar 2011 11:53:17 +0000 (11:53 +0000)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Fri, 25 Mar 2011 11:53:17 +0000 (11:53 +0000)
lib/template/details-html.php
website/details.php

index 8bef4791b2d40e76a875a9c34fbd8788fad0cfea..a02d3abf979143a8a934217805469c77ceb91fc3 100644 (file)
@@ -148,6 +148,24 @@ foreach($aPolyPoints as $aPolyPoint)
        }
        echo '</div>';
 
+       if ($aPlaceSearchNameKeywords)
+       {
+               echo '<h2>Name Keywords</h2>';
+               foreach($aPlaceSearchNameKeywords as $aRow)
+               {
+                       echo '<div>'.$aRow['word_token'].'</div>';
+               }
+       }
+
+       if ($aPlaceSearchAddressKeywords)
+       {
+               echo '<h2>Address Keywords</h2>';
+               foreach($aPlaceSearchAddressKeywords as $aRow)
+               {
+                       echo '<div>'.($aRow['word_token'][0]==' '?'*':'').$aRow['word_token'].'('.$aRow['word_id'].')'.'</div>';
+               }
+       }
+
        if (sizeof($aParentOfLines))
        {
                echo '<h2>Parent Of (named features only):</h2>';
index a4a2ae5e1d06d93d50d66db22aa057c22d944eea..110fdc07a06f01d3cab9fa157162ff735909a475 100755 (executable)
        $sSQL .= " order by rank_address asc,rank_search asc,get_name_by_language(name,$sLanguagePrefArraySQL),housenumber";
        $aParentOfLines = $oDB->getAll($sSQL);
 
+       $aPlaceSearchNameKeywords = false;
+       $aPlaceSearchAddressKeywords = false;
+       if (isset($_GET['keywords']) && $_GET['keywords'])
+       {
+               $sSQL = "select * from search_name where place_id = $iPlaceID";
+               $aPlaceSearchName = $oDB->getRow($sSQL);
+               $sSQL = "select * from word where word_id in (".substr($aPlaceSearchName['name_vector'],1,-1).")";
+               $aPlaceSearchNameKeywords = $oDB->getAll($sSQL);
+               $sSQL = "select * from word where word_id in (".substr($aPlaceSearchName['nameaddress_vector'],1,-1).")";
+               $aPlaceSearchAddressKeywords = $oDB->getAll($sSQL);
+       }
+
        logEnd($oDB, $hLog, 1);
 
        include(CONST_BasePath.'/lib/template/details-'.$sOutputFormat.'.php');