- | country | postcode | geometry |
- | gb | EH4 7EA | country:gb |
- | gb | E4 7EA | country:gb |
- When searching for "EH4 7EA"
- Then results contain
- | type | placename |
- | postcode | EH4 7EA |
- When searching for "E4 7EA"
+ | postcode | country | rank_search | rank_address |
+ | E45 2CD | gb | 25 | 5 |
+ | E45 2 | gb | 23 | 5 |
+ | Y45 | gb | 21 | 5 |
+
+ Scenario: Postcodes outside all countries are not added to the postcode and word table
+ Given the places
+ | osm | class | type | addr+postcode | addr+housenumber | addr+place | geometry |
+ | N34 | place | house | 01982 | 111 | Null Island | 0 0.00001 |
+ And the places
+ | osm | class | type | name | geometry |
+ | N1 | place | hamlet | Null Island | 0 0 |
+ When importing
+ Then location_postcode contains exactly
+ | country | postcode | geometry |
+ And there are no word tokens for postcodes 01982
+ When sending search query "111, 01982 Null Island"