]> git.openstreetmap.org Git - nominatim.git/commitdiff
add penalty for special term searches
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 1 May 2014 07:16:03 +0000 (09:16 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 1 May 2014 07:16:03 +0000 (09:16 +0200)
abbreviations for some of the terms are too easily matched against
common address terms like 'street'

lib/Geocode.php

index 7f1d373319afcfe717a2b233e497630f34e61eb0..92e1a0b327d2b295bc6210427bc28af3eaa12d0e 100644 (file)
                                                                                                        $aSearch['sType'] = $aSearchTerm['type'];
                                                                                                        if (sizeof($aSearch['aName'])) $aSearch['sOperator'] = 'name';
                                                                                                        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')