2 Feature: Creation of search terms
3 Tests that search_name table is filled correctly
5 Scenario: Semicolon-separated names appear as separate full names
7 | osm | class | type | name+alt_name |
8 | N1 | place | city | New York; Big Apple |
10 Then search_name contains
11 | object | name_vector |
12 | N1 | #New York, #Big Apple |
14 Scenario: Comma-separated names appear as a single full name
16 | osm | class | type | name+alt_name |
17 | N1 | place | city | New York, Big Apple |
19 Then search_name contains
20 | object | name_vector |
21 | N1 | #New York Big Apple |
23 Scenario: Name parts before brackets appear as full names
25 | osm | class | type | name+name |
26 | N1 | place | city | Halle (Saale) |
28 Then search_name contains
29 | object | name_vector |
30 | N1 | #Halle Saale, #Halle |
32 Scenario: Unnamed POIs have no search entry
37 | osm | class | type |
38 | N1 | place | house |
40 | osm | class | type | geometry |
41 | W1 | highway | residential | 10,11 |
43 Then search_name has no entry for N1
45 Scenario: Unnamed POI has a search entry when it has unknown addr: tags
50 | osm | class | type | housenr | addr+city |
51 | N1 | place | house | 23 | Walltown |
53 | osm | class | type | name+name | geometry |
54 | W1 | highway | residential | Rose Street | 10,11 |
56 Then search_name contains
57 | object | nameaddress_vector |
58 | N1 | #Rose Street, Walltown |
59 When sending search query "23 Rose Street, Walltown"
61 | osm | display_name |
62 | N1 | 23, Rose Street |
63 When sending search query "Walltown, Rose Street 23"
65 | osm | display_name |
66 | N1 | 23, Rose Street |
67 When sending search query "Rose Street 23, Walltown"
69 | osm | display_name |
70 | N1 | 23, Rose Street |
72 Scenario: Searching for unknown addr: tags also works for multiple words
77 | osm | class | type | housenr | addr+city |
78 | N1 | place | house | 23 | Little Big Town |
80 | osm | class | type | name+name | geometry |
81 | W1 | highway | residential | Rose Street | 10,11 |
83 Then search_name contains
84 | object | nameaddress_vector |
85 | N1 | #Rose Street, rose, Little, Big, Town |
86 When sending search query "23 Rose Street, Little Big Town"
88 | osm | display_name |
89 | N1 | 23, Rose Street |
90 When sending search query "Rose Street 23, Little Big Town"
92 | osm | display_name |
93 | N1 | 23, Rose Street |
94 When sending search query "Little big Town, Rose Street 23"
96 | osm | display_name |
97 | N1 | 23, Rose Street |
99 Scenario: Unnamed POI has no search entry when it has known addr: tags
104 | osm | class | type | housenr | addr+city |
105 | N1 | place | house | 23 | Walltown |
107 | osm | class | type | name+name | addr+city | geometry |
108 | W1 | highway | residential | Rose Street | Walltown | 10,11 |
110 Then search_name has no entry for N1
111 When sending search query "23 Rose Street, Walltown"
113 | osm | display_name |
114 | N1 | 23, Rose Street |
116 Scenario: Unnamed POI must have a house number to get a search entry
121 | osm | class | type | addr+city |
122 | N1 | place | house | Walltown |
124 | osm | class | type | name+name | geometry |
125 | W1 | highway | residential | Rose Street | 10,11 |
127 Then search_name has no entry for N1
129 Scenario: Unnamed POIs inherit parent name when unknown addr:place is present
131 | 100 | | | | | 101 |
133 | 103 | 10 | | | 11 | 102 |
135 | osm | class | type | housenr | addr+place |
136 | N1 | place | house | 23 | Walltown |
138 | osm | class | type | name+name | geometry |
139 | W1 | highway | residential | Rose Street | 10,11 |
140 | R1 | place | city | Strange Town | (100,101,102,103,100) |
143 | object | parent_place_id |
145 When sending search query "23 Rose Street"
146 Then exactly 1 results are returned
148 | osm | display_name |
149 | W1 | Rose Street, Strange Town |
150 When sending search query "23 Walltown, Strange Town"
152 | osm | display_name |
153 | N1 | 23, Walltown, Strange Town |
154 When sending search query "Walltown 23, Strange Town"
156 | osm | display_name |
157 | N1 | 23, Walltown, Strange Town |
158 When sending search query "Strange Town, Walltown 23"
160 | osm | display_name |
161 | N1 | 23, Walltown, Strange Town |
163 Scenario: Named POIs can be searched by housenumber when unknown addr:place is present
165 | 100 | | | | | 101 |
167 | 103 | 10 | | | 11 | 102 |
169 | osm | class | type | name | housenr | addr+place |
170 | N1 | place | house | Blue house | 23 | Walltown |
172 | osm | class | type | name+name | geometry |
173 | W1 | highway | residential | Rose Street | 10,11 |
174 | R1 | place | city | Strange Town | (100,101,102,103,100) |
176 When sending search query "23 Walltown, Strange Town"
178 | osm | display_name |
179 | N1 | Blue house, 23, Walltown, Strange Town |
180 When sending search query "Walltown 23, Strange Town"
182 | osm | display_name |
183 | N1 | Blue house, 23, Walltown, Strange Town |
184 When sending search query "Strange Town, Walltown 23"
186 | osm | display_name |
187 | N1 | Blue house, 23, Walltown, Strange Town |
188 When sending search query "Strange Town, Walltown 23, Blue house"
190 | osm | display_name |
191 | N1 | Blue house, 23, Walltown, Strange Town |
192 When sending search query "Strange Town, Walltown, Blue house"
194 | osm | display_name |
195 | N1 | Blue house, 23, Walltown, Strange Town |
197 Scenario: Named POIs can be found when unknown multi-word addr:place is present
199 | 100 | | | | | 101 |
201 | 103 | 10 | | | 11 | 102 |
203 | osm | class | type | name | housenr | addr+place |
204 | N1 | place | house | Blue house | 23 | Moon sun |
206 | osm | class | type | name+name | geometry |
207 | W1 | highway | residential | Rose Street | 10,11 |
208 | R1 | place | city | Strange Town | (100,101,102,103,100) |
210 When sending search query "23 Moon Sun, Strange Town"
212 | osm | display_name |
213 | N1 | Blue house, 23, Moon sun, Strange Town |
214 When sending search query "Blue house, Moon Sun, Strange Town"
216 | osm | display_name |
217 | N1 | Blue house, 23, Moon sun, Strange Town |
219 Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
221 | 100 | | | | | 101 |
223 | 103 | 10 | | | 11 | 102 |
225 | osm | class | type | housenr | addr+place |
226 | N1 | place | house | 23 | Walltown |
228 | osm | class | type | name+name | addr+city | geometry |
229 | W1 | highway | residential | Rose Street | Walltown | 10,11 |
230 | R1 | place | suburb | Strange Town | Walltown | (100,101,102,103,100) |
232 When sending search query "23 Rose Street, Walltown"
233 Then exactly 1 result is returned
235 | osm | display_name |
236 | W1 | Rose Street, Strange Town |
237 When sending search query "23 Walltown"
238 Then exactly 1 result is returned
240 | osm | display_name |
241 | N1 | 23, Walltown, Strange Town |
243 Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
248 | osm | class | type | housenr | addr+place | addr+street |
249 | N1 | place | house | 23 | Walltown | Lily Street |
251 | osm | class | type | name+name | geometry |
252 | W1 | highway | residential | Rose Street | 10,11 |
254 Then search_name has no entry for N1
255 When sending search query "23 Rose Street"
257 | osm | display_name |
258 | N1 | 23, Rose Street |
259 When sending search query "23 Lily Street"
260 Then exactly 0 results are returned
262 Scenario: An unknown addr:street is ignored
267 | osm | class | type | housenr | addr+street |
268 | N1 | place | house | 23 | Lily Street |
270 | osm | class | type | name+name | geometry |
271 | W1 | highway | residential | Rose Street | 10,11 |
273 Then search_name has no entry for N1
274 When sending search query "23 Rose Street"
276 | osm | display_name |
277 | N1 | 23, Rose Street |
278 When sending search query "23 Lily Street"
279 Then exactly 0 results are returned
281 Scenario: Named POIs get unknown address tags added in the search_name table
286 | osm | class | type | name+name | housenr | addr+city |
287 | N1 | place | house | Green Moss | 26 | Walltown |
289 | osm | class | type | name+name | geometry |
290 | W1 | highway | residential | Rose Street | 10,11 |
292 Then search_name contains
293 | object | name_vector | nameaddress_vector |
294 | N1 | #Green Moss | #Rose Street, Walltown |
295 When sending search query "Green Moss, Rose Street, Walltown"
297 | osm | display_name |
298 | N1 | Green Moss, 26, Rose Street |
299 When sending search query "Green Moss, 26, Rose Street, Walltown"
301 | osm | display_name |
302 | N1 | Green Moss, 26, Rose Street |
303 When sending search query "26, Rose Street, Walltown"
305 | osm | display_name |
306 | N1 | Green Moss, 26, Rose Street |
307 When sending search query "Rose Street 26, Walltown"
309 | osm | display_name |
310 | N1 | Green Moss, 26, Rose Street |
311 When sending search query "Walltown, Rose Street 26"
313 | osm | display_name |
314 | N1 | Green Moss, 26, Rose Street |
316 Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
318 | 100 | | | | | 101 |
320 | 103 | 10 | | | 11 | 102 |
322 | osm | class | type | name+name | addr+place |
323 | N1 | place | house | Green Moss | Walltown |
325 | osm | class | type | name+name | geometry |
326 | W1 | highway | residential | Rose Street | 10,11 |
327 | R1 | place | suburb | Strange Town | (100,101,102,103,100) |
329 When sending search query "Green Moss, Rose Street, Walltown"
330 Then exactly 0 result is returned
331 When sending search query "Green Moss, Walltown"
333 | osm | display_name |
334 | N1 | Green Moss, Walltown, Strange Town |
336 Scenario: Named POIs inherit address from parent
341 | osm | class | type | name | geometry |
342 | N1 | place | house | foo | 1 |
343 | W1 | highway | residential | the road | 10,11 |
345 Then search_name contains
346 | object | name_vector | nameaddress_vector |
347 | N1 | foo | #the road |
349 Scenario: Some addr: tags are added to address
354 | osm | class | type | name |
355 | N2 | place | city | bonn |
356 | N3 | place | suburb | smalltown|
358 | osm | class | type | addr+city | addr+municipality | addr+suburb | geometry |
359 | W1 | highway | service | bonn | New York | Smalltown | 10,11 |
361 Then search_name contains
362 | object | nameaddress_vector |
363 | W1 | bonn, new, york, smalltown |
365 Scenario: A known addr:* tag is added even if the name is unknown
369 | osm | class | type | name | addr+city | geometry |
370 | W1 | highway | residential | Road | Nandu | 10,11 |
372 Then search_name contains
373 | object | nameaddress_vector |
376 Scenario: addr:postcode is not added to the address terms
377 Given the grid with origin DE
381 | osm | class | type | name+ref |
382 | N1 | place | state | 12345 |
384 | osm | class | type | addr+postcode | geometry |
385 | W1 | highway | residential | 12345 | 10,11 |
387 Then search_name contains not
388 | object | nameaddress_vector |
391 Scenario: a linked place does not show up in search name
396 Given the named places
397 | osm | class | type | admin | geometry |
398 | R13 | boundary | administrative | 9 | (10,11,12,13,10) |
400 | osm | class | type |
401 | N2 | place | city |
403 | id | members | tags+type |
404 | 13 | N2:label | boundary |
407 | object | linked_place_id |
409 And search_name has no entry for N2
411 Scenario: a linked waterway does not show up in search name
415 | osm | class | type | name | geometry |
416 | W1 | waterway | river | Rhein | 1,2 |
417 | W2 | waterway | river | Rhein | 2,3 |
418 | R13 | waterway | river | Rhein | 1,2,3 |
420 | id | members | tags+type |
421 | 13 | W1,W2:main_stream | waterway |
424 | object | linked_place_id |
427 And search_name has no entry for W1
428 And search_name has no entry for W2