2 Feature: Creation of search terms
3 Tests that search_name table is filled correctly
5 Scenario: POIs without a name have no search entry
6 Given the scene roads-with-pois
8 | osm | class | type | geometry |
9 | N1 | place | house | :p-N1 |
11 | osm | class | type | geometry |
12 | W1 | highway | residential | :w-north |
14 Then search_name has no entry for N1
16 Scenario: Named POIs inherit address from parent
17 Given the scene roads-with-pois
19 | osm | class | type | name | geometry |
20 | N1 | place | house | foo | :p-N1 |
21 | W1 | highway | residential | the road | :w-north |
23 Then search_name contains
24 | object | name_vector | nameaddress_vector |
25 | N1 | foo | the road |
27 Scenario: Some addr: tags are added to address when the name exists
28 Given the scene roads-with-pois
30 | osm | class | type | name | geometry |
31 | N1 | place | state | new york | 80 80 |
32 | N2 | place | city | bonn | 81 81 |
33 | N3 | place | suburb | smalltown| 80 81 |
35 | osm | class | type | addr+city | addr+state | addr+suburb | geometry |
36 | W1 | highway | service | bonn | New York | Smalltown | :w-north |
38 Then search_name contains
39 | object | nameaddress_vector |
40 | W1 | bonn, new york, smalltown |
42 Scenario: A known addr:* tag is added even if the name is unknown
43 Given the scene roads-with-pois
45 | osm | class | type | name | addr+city | geometry |
46 | W1 | highway | residential | Road | Nandu | :w-north |
48 Then search_name contains
49 | object | nameaddress_vector |
52 Scenario: addr:postcode is not added to the address terms
53 Given the scene roads-with-pois
55 | osm | class | type | name+ref | geometry |
56 | N1 | place | state | 12345 | 80 80 |
58 | osm | class | type | addr+postcode | geometry |
59 | W1 | highway | residential | 12345 | :w-north |
61 Then search_name contains not
62 | object | nameaddress_vector |
65 Scenario: is_in is split and added to the address search terms
66 Given the scene roads-with-pois
68 | osm | class | type | name | geometry |
69 | N1 | place | state | new york | 80 80 |
70 | N2 | place | city | bonn | 81 81 |
71 | N3 | place | suburb | smalltown| 80 81 |
73 | osm | class | type | addr+is_in | geometry |
74 | W1 | highway | service | bonn, New York, Smalltown | :w-north |
76 Then search_name contains
77 | object | nameaddress_vector |
78 | W1 | bonn, new york, smalltown |
80 Scenario: a linked place does not show up in search name
81 Given the named places
82 | osm | class | type | admin | geometry |
83 | R13 | boundary | administrative | 9 | poly-area:0.01 |
85 | osm | class | type | geometry |
86 | N2 | place | city | 0.1 0.1 |
88 | id | members | tags+type |
89 | 13 | N2:label | boundary |
92 | object | linked_place_id |
94 And search_name has no entry for N2
96 Scenario: a linked waterway does not show up in search name
97 Given the scene split-road
99 | osm | class | type | name | geometry |
100 | W1 | waterway | river | Rhein | :w-2 |
101 | W2 | waterway | river | Rhein | :w-3 |
102 | R13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
104 | id | members | tags+type |
105 | 13 | W1,W2:main_stream | waterway |
108 | object | linked_place_id |
111 And search_name has no entry for W1
112 And search_name has no entry for W2