]> git.openstreetmap.org Git - nominatim.git/commitdiff
fix result splitting for last search group
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 11 Mar 2021 16:14:46 +0000 (17:14 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 11 Mar 2021 16:14:46 +0000 (17:14 +0100)
When we are in the final iteration of the search groups, it is not
possible to further delay the results. Unconditionally use the
results with the best rank instead.

lib-php/Geocode.php

index b475add22e8eefaf3cd85d0cbc85c46e7c66bc98..f638af9a9a300a927f066a59690c23b6ee58e966 100644 (file)
@@ -779,7 +779,8 @@ class Geocode
                     $aSplitResults = Result::splitResults($aResults);
                     Debug::printVar('Split results', $aSplitResults);
                     if ($iGroupLoop <= 4
-                        && reset($aSplitResults['head'])->iResultRank > 0) {
+                        && reset($aSplitResults['head'])->iResultRank > 0
+                        && $iGroupedRank !== array_key_last($aGroupedSearches)) {
                         // Haven't found an exact match for the query yet.
                         // Therefore add result from the next group level.
                         $aNextResults = $aSplitResults['head'];