mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
search rank 30 must always go with address rank 30
This commit is contained in:
@@ -194,10 +194,10 @@ BEGIN
|
|||||||
FROM get_postcode_rank(country, postcode);
|
FROM get_postcode_rank(country, postcode);
|
||||||
ELSEIF extended_type = 'N' AND place_class = 'highway' THEN
|
ELSEIF extended_type = 'N' AND place_class = 'highway' THEN
|
||||||
search_rank = 30;
|
search_rank = 30;
|
||||||
address_rank = 0;
|
address_rank = 30;
|
||||||
ELSEIF place_class = 'landuse' AND extended_type != 'A' THEN
|
ELSEIF place_class = 'landuse' AND extended_type != 'A' THEN
|
||||||
search_rank = 30;
|
search_rank = 30;
|
||||||
address_rank = 0;
|
address_rank = 30;
|
||||||
ELSE
|
ELSE
|
||||||
IF place_class = 'boundary' and place_type = 'administrative' THEN
|
IF place_class = 'boundary' and place_type = 'administrative' THEN
|
||||||
classtype = place_type || admin_level::TEXT;
|
classtype = place_type || admin_level::TEXT;
|
||||||
@@ -211,11 +211,8 @@ BEGIN
|
|||||||
AND l.class = place_class AND (l.type = classtype or l.type is NULL)
|
AND l.class = place_class AND (l.type = classtype or l.type is NULL)
|
||||||
ORDER BY l.country_code, l.class, l.type LIMIT 1;
|
ORDER BY l.country_code, l.class, l.type LIMIT 1;
|
||||||
|
|
||||||
IF search_rank is NULL THEN
|
IF search_rank is NULL OR address_rank is NULL THEN
|
||||||
search_rank := 30;
|
search_rank := 30;
|
||||||
END IF;
|
|
||||||
|
|
||||||
IF address_rank is NULL THEN
|
|
||||||
address_rank := 30;
|
address_rank := 30;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ Feature: Import into placex
|
|||||||
When importing
|
When importing
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | rank_search | rank_address |
|
| object | rank_search | rank_address |
|
||||||
| N1 | 30 | 0 |
|
| N1 | 30 | 30 |
|
||||||
| W1 | 26 | 26 |
|
| W1 | 26 | 26 |
|
||||||
| W2 | 26 | 26 |
|
| W2 | 26 | 26 |
|
||||||
| W3 | 26 | 26 |
|
| W3 | 26 | 26 |
|
||||||
@@ -191,8 +191,8 @@ Feature: Import into placex
|
|||||||
When importing
|
When importing
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | rank_search | rank_address |
|
| object | rank_search | rank_address |
|
||||||
| N2 | 30 | 0 |
|
| N2 | 30 | 30 |
|
||||||
| W2 | 30 | 0 |
|
| W2 | 30 | 30 |
|
||||||
| W4 | 22 | 22 |
|
| W4 | 22 | 22 |
|
||||||
| R2 | 22 | 22 |
|
| R2 | 22 | 22 |
|
||||||
| R3 | 22 | 0 |
|
| R3 | 22 | 0 |
|
||||||
|
|||||||
Reference in New Issue
Block a user