2 Feature: Creation of search terms
3 Tests that search_name table is filled correctly
5 Scenario Outline: Comma- and semicolon separated names appear as full names
7 | osm | class | type | name+alt_name |
8 | N1 | place | city | New York<sep>Big Apple |
10 Then search_name contains
11 | object | name_vector |
12 | N1 | #New York, #Big Apple |
19 Scenario Outline: Name parts before brackets appear as full names
21 | osm | class | type | name+name |
22 | N1 | place | city | Halle (Saale) |
24 Then search_name contains
25 | object | name_vector |
26 | N1 | #Halle Saale, #Halle |
28 Scenario: Unnamed POIs have no search entry
29 Given the scene roads-with-pois
31 | osm | class | type | geometry |
32 | N1 | place | house | :p-N1 |
34 | osm | class | type | geometry |
35 | W1 | highway | residential | :w-north |
37 Then search_name has no entry for N1
39 Scenario: Unnamed POI has a search entry when it has unknown addr: tags
40 Given the scene roads-with-pois
42 | osm | class | type | housenr | addr+city | geometry |
43 | N1 | place | house | 23 | Walltown | :p-N1 |
45 | osm | class | type | name+name | geometry |
46 | W1 | highway | residential | Rose Street | :w-north |
48 Then search_name contains
49 | object | nameaddress_vector |
50 | N1 | #Rose Street, Walltown |
51 When sending search query "23 Rose Street, Walltown"
53 | osm | display_name |
54 | N1 | 23, Rose Street |
55 When sending search query "Walltown, Rose Street 23"
57 | osm | display_name |
58 | N1 | 23, Rose Street |
59 When sending search query "Rose Street 23, Walltown"
61 | osm | display_name |
62 | N1 | 23, Rose Street |
64 Scenario: Searching for unknown addr: tags also works for multiple words
65 Given the scene roads-with-pois
67 | osm | class | type | housenr | addr+city | geometry |
68 | N1 | place | house | 23 | Little Big Town | :p-N1 |
70 | osm | class | type | name+name | geometry |
71 | W1 | highway | residential | Rose Street | :w-north |
73 Then search_name contains
74 | object | nameaddress_vector |
75 | N1 | #Rose Street, rose, Little, Big, Town |
76 When sending search query "23 Rose Street, Little Big Town"
78 | osm | display_name |
79 | N1 | 23, Rose Street |
80 When sending search query "Rose Street 23, Little Big Town"
82 | osm | display_name |
83 | N1 | 23, Rose Street |
84 When sending search query "Little big Town, Rose Street 23"
86 | osm | display_name |
87 | N1 | 23, Rose Street |
89 Scenario: Unnamed POI has no search entry when it has known addr: tags
90 Given the scene roads-with-pois
92 | osm | class | type | housenr | addr+city | geometry |
93 | N1 | place | house | 23 | Walltown | :p-N1 |
95 | osm | class | type | name+name | addr+city | geometry |
96 | W1 | highway | residential | Rose Street | Walltown | :w-north |
98 Then search_name has no entry for N1
99 When sending search query "23 Rose Street, Walltown"
101 | osm | display_name |
102 | N1 | 23, Rose Street |
104 Scenario: Unnamed POI must have a house number to get a search entry
105 Given the scene roads-with-pois
107 | osm | class | type | addr+city | geometry |
108 | N1 | place | house | Walltown | :p-N1 |
110 | osm | class | type | name+name | geometry |
111 | W1 | highway | residential | Rose Street | :w-north |
113 Then search_name has no entry for N1
115 Scenario: Unnamed POIs inherit parent name when unknown addr:place is present
116 Given the scene roads-with-pois
118 | osm | class | type | housenr | addr+place | geometry |
119 | N1 | place | house | 23 | Walltown | :p-N1 |
121 | osm | class | type | name+name | geometry |
122 | W1 | highway | residential | Rose Street | :w-north |
123 | N2 | place | city | Strange Town | :p-N1 |
126 | object | parent_place_id |
128 When sending search query "23 Rose Street"
129 Then exactly 1 results are returned
131 | osm | display_name |
132 | W1 | Rose Street, Strange Town |
133 When sending search query "23 Walltown, Strange Town"
135 | osm | display_name |
136 | N1 | 23, Walltown, Strange Town |
137 When sending search query "Walltown 23, Strange Town"
139 | osm | display_name |
140 | N1 | 23, Walltown, Strange Town |
141 When sending search query "Strange Town, Walltown 23"
143 | osm | display_name |
144 | N1 | 23, Walltown, Strange Town |
146 Scenario: Named POIs can be searched by housenumber when unknown addr:place is present
147 Given the scene roads-with-pois
149 | osm | class | type | name | housenr | addr+place | geometry |
150 | N1 | place | house | Blue house | 23 | Walltown | :p-N1 |
152 | osm | class | type | name+name | geometry |
153 | W1 | highway | residential | Rose Street | :w-north |
154 | N2 | place | city | Strange Town | :p-N1 |
156 When sending search query "23 Walltown, Strange Town"
158 | osm | display_name |
159 | N1 | Blue house, 23, Walltown, Strange Town |
160 When sending search query "Walltown 23, Strange Town"
162 | osm | display_name |
163 | N1 | Blue house, 23, Walltown, Strange Town |
164 When sending search query "Strange Town, Walltown 23"
166 | osm | display_name |
167 | N1 | Blue house, 23, Walltown, Strange Town |
168 When sending search query "Strange Town, Walltown 23, Blue house"
170 | osm | display_name |
171 | N1 | Blue house, 23, Walltown, Strange Town |
172 When sending search query "Strange Town, Walltown, Blue house"
174 | osm | display_name |
175 | N1 | Blue house, 23, Walltown, Strange Town |
177 Scenario: Named POIs can be found when unknown multi-word addr:place is present
178 Given the scene roads-with-pois
180 | osm | class | type | name | housenr | addr+place | geometry |
181 | N1 | place | house | Blue house | 23 | Moon sun | :p-N1 |
183 | osm | class | type | name+name | geometry |
184 | W1 | highway | residential | Rose Street | :w-north |
185 | N2 | place | city | Strange Town | :p-N1 |
187 When sending search query "23 Moon Sun, Strange Town"
189 | osm | display_name |
190 | N1 | Blue house, 23, Moon sun, Strange Town |
191 When sending search query "Blue house, Moon Sun, Strange Town"
193 | osm | display_name |
194 | N1 | Blue house, 23, Moon sun, Strange Town |
196 Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
197 Given the scene roads-with-pois
199 | osm | class | type | housenr | addr+place | geometry |
200 | N1 | place | house | 23 | Walltown | :p-N1 |
202 | osm | class | type | name+name | addr+city | geometry |
203 | W1 | highway | residential | Rose Street | Walltown | :w-north |
204 | N2 | place | suburb | Strange Town | Walltown | :p-N1 |
206 When sending search query "23 Rose Street, Walltown"
207 Then exactly 1 result is returned
209 | osm | display_name |
210 | W1 | Rose Street, Strange Town |
211 When sending search query "23 Walltown"
212 Then exactly 1 result is returned
214 | osm | display_name |
215 | N1 | 23, Walltown, Strange Town |
217 Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
218 Given the scene roads-with-pois
220 | osm | class | type | housenr | addr+place | addr+street | geometry |
221 | N1 | place | house | 23 | Walltown | Lily Street | :p-N1 |
223 | osm | class | type | name+name | geometry |
224 | W1 | highway | residential | Rose Street | :w-north |
226 Then search_name has no entry for N1
227 When sending search query "23 Rose Street"
229 | osm | display_name |
230 | N1 | 23, Rose Street |
231 When sending search query "23 Lily Street"
232 Then exactly 0 results are returned
234 Scenario: An unknown addr:street is ignored
235 Given the scene roads-with-pois
237 | osm | class | type | housenr | addr+street | geometry |
238 | N1 | place | house | 23 | Lily Street | :p-N1 |
240 | osm | class | type | name+name | geometry |
241 | W1 | highway | residential | Rose Street | :w-north |
243 Then search_name has no entry for N1
244 When sending search query "23 Rose Street"
246 | osm | display_name |
247 | N1 | 23, Rose Street |
248 When sending search query "23 Lily Street"
249 Then exactly 0 results are returned
251 Scenario: Named POIs get unknown address tags added in the search_name table
252 Given the scene roads-with-pois
254 | osm | class | type | name+name | housenr | addr+city | geometry |
255 | N1 | place | house | Green Moss | 26 | Walltown | :p-N1 |
257 | osm | class | type | name+name | geometry |
258 | W1 | highway | residential | Rose Street | :w-north |
260 Then search_name contains
261 | object | name_vector | nameaddress_vector |
262 | N1 | #Green Moss | #Rose Street, Walltown |
263 When sending search query "Green Moss, Rose Street, Walltown"
265 | osm | display_name |
266 | N1 | Green Moss, 26, Rose Street |
267 When sending search query "Green Moss, 26, Rose Street, Walltown"
269 | osm | display_name |
270 | N1 | Green Moss, 26, Rose Street |
271 When sending search query "26, Rose Street, Walltown"
273 | osm | display_name |
274 | N1 | Green Moss, 26, Rose Street |
275 When sending search query "Rose Street 26, Walltown"
277 | osm | display_name |
278 | N1 | Green Moss, 26, Rose Street |
279 When sending search query "Walltown, Rose Street 26"
281 | osm | display_name |
282 | N1 | Green Moss, 26, Rose Street |
284 Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
285 Given the scene roads-with-pois
287 | osm | class | type | name+name | addr+place | geometry |
288 | N1 | place | house | Green Moss | Walltown | :p-N1 |
290 | osm | class | type | name+name | geometry |
291 | W1 | highway | residential | Rose Street | :w-north |
292 | N2 | place | suburb | Strange Town | :p-N1 |
294 When sending search query "Green Moss, Rose Street, Walltown"
295 Then exactly 0 result is returned
296 When sending search query "Green Moss, Walltown"
298 | osm | display_name |
299 | N1 | Green Moss, Walltown, Strange Town |
301 Scenario: Named POIs inherit address from parent
302 Given the scene roads-with-pois
304 | osm | class | type | name | geometry |
305 | N1 | place | house | foo | :p-N1 |
306 | W1 | highway | residential | the road | :w-north |
308 Then search_name contains
309 | object | name_vector | nameaddress_vector |
310 | N1 | foo | #the road |
312 Scenario: Some addr: tags are added to address
313 Given the scene roads-with-pois
315 | osm | class | type | name | geometry |
316 | N2 | place | city | bonn | 81 81 |
317 | N3 | place | suburb | smalltown| 80 81 |
319 | osm | class | type | addr+city | addr+municipality | addr+suburb | geometry |
320 | W1 | highway | service | bonn | New York | Smalltown | :w-north |
322 Then search_name contains
323 | object | nameaddress_vector |
324 | W1 | bonn, new, york, smalltown |
326 Scenario: A known addr:* tag is added even if the name is unknown
327 Given the scene roads-with-pois
329 | osm | class | type | name | addr+city | geometry |
330 | W1 | highway | residential | Road | Nandu | :w-north |
332 Then search_name contains
333 | object | nameaddress_vector |
336 Scenario: addr:postcode is not added to the address terms
337 Given the scene roads-with-pois
339 | osm | class | type | name+ref | geometry |
340 | N1 | place | state | 12345 | 80 80 |
342 | osm | class | type | addr+postcode | geometry |
343 | W1 | highway | residential | 12345 | :w-north |
345 Then search_name contains not
346 | object | nameaddress_vector |
349 Scenario: a linked place does not show up in search name
350 Given the named places
351 | osm | class | type | admin | geometry |
352 | R13 | boundary | administrative | 9 | poly-area:0.01 |
354 | osm | class | type | geometry |
355 | N2 | place | city | 0.1 0.1 |
357 | id | members | tags+type |
358 | 13 | N2:label | boundary |
361 | object | linked_place_id |
363 And search_name has no entry for N2
365 Scenario: a linked waterway does not show up in search name
366 Given the scene split-road
368 | osm | class | type | name | geometry |
369 | W1 | waterway | river | Rhein | :w-2 |
370 | W2 | waterway | river | Rhein | :w-3 |
371 | R13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
373 | id | members | tags+type |
374 | 13 | W1,W2:main_stream | waterway |
377 | object | linked_place_id |
380 And search_name has no entry for W1
381 And search_name has no entry for W2