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
33 | osm | class | type |
34 | N1 | place | house |
36 | osm | class | type | geometry |
37 | W1 | highway | residential | 10,11 |
39 Then search_name has no entry for N1
41 Scenario: Unnamed POI has a search entry when it has unknown addr: tags
46 | osm | class | type | housenr | addr+city |
47 | N1 | place | house | 23 | Walltown |
49 | osm | class | type | name+name | geometry |
50 | W1 | highway | residential | Rose Street | 10,11 |
52 Then search_name contains
53 | object | nameaddress_vector |
54 | N1 | #Rose Street, Walltown |
55 When sending search query "23 Rose Street, Walltown"
57 | osm | display_name |
58 | N1 | 23, Rose Street |
59 When sending search query "Walltown, Rose Street 23"
61 | osm | display_name |
62 | N1 | 23, Rose Street |
63 When sending search query "Rose Street 23, Walltown"
65 | osm | display_name |
66 | N1 | 23, Rose Street |
68 Scenario: Searching for unknown addr: tags also works for multiple words
73 | osm | class | type | housenr | addr+city |
74 | N1 | place | house | 23 | Little Big Town |
76 | osm | class | type | name+name | geometry |
77 | W1 | highway | residential | Rose Street | 10,11 |
79 Then search_name contains
80 | object | nameaddress_vector |
81 | N1 | #Rose Street, rose, Little, Big, Town |
82 When sending search query "23 Rose Street, Little Big Town"
84 | osm | display_name |
85 | N1 | 23, Rose Street |
86 When sending search query "Rose Street 23, Little Big Town"
88 | osm | display_name |
89 | N1 | 23, Rose Street |
90 When sending search query "Little big Town, Rose Street 23"
92 | osm | display_name |
93 | N1 | 23, Rose Street |
95 Scenario: Unnamed POI has no search entry when it has known addr: tags
100 | osm | class | type | housenr | addr+city |
101 | N1 | place | house | 23 | Walltown |
103 | osm | class | type | name+name | addr+city | geometry |
104 | W1 | highway | residential | Rose Street | Walltown | 10,11 |
106 Then search_name has no entry for N1
107 When sending search query "23 Rose Street, Walltown"
109 | osm | display_name |
110 | N1 | 23, Rose Street |
112 Scenario: Unnamed POI must have a house number to get a search entry
117 | osm | class | type | addr+city |
118 | N1 | place | house | Walltown |
120 | osm | class | type | name+name | geometry |
121 | W1 | highway | residential | Rose Street | 10,11 |
123 Then search_name has no entry for N1
125 Scenario: Unnamed POIs inherit parent name when unknown addr:place is present
127 | 100 | | | | | 101 |
129 | 103 | 10 | | | 11 | 102 |
131 | osm | class | type | housenr | addr+place |
132 | N1 | place | house | 23 | Walltown |
134 | osm | class | type | name+name | geometry |
135 | W1 | highway | residential | Rose Street | 10,11 |
136 | R1 | place | city | Strange Town | (100,101,102,103,100) |
139 | object | parent_place_id |
141 When sending search query "23 Rose Street"
142 Then exactly 1 results are returned
144 | osm | display_name |
145 | W1 | Rose Street, Strange Town |
146 When sending search query "23 Walltown, Strange Town"
148 | osm | display_name |
149 | N1 | 23, Walltown, Strange Town |
150 When sending search query "Walltown 23, Strange Town"
152 | osm | display_name |
153 | N1 | 23, Walltown, Strange Town |
154 When sending search query "Strange Town, Walltown 23"
156 | osm | display_name |
157 | N1 | 23, Walltown, Strange Town |
159 Scenario: Named POIs can be searched by housenumber when unknown addr:place is present
161 | 100 | | | | | 101 |
163 | 103 | 10 | | | 11 | 102 |
165 | osm | class | type | name | housenr | addr+place |
166 | N1 | place | house | Blue house | 23 | Walltown |
168 | osm | class | type | name+name | geometry |
169 | W1 | highway | residential | Rose Street | 10,11 |
170 | R1 | place | city | Strange Town | (100,101,102,103,100) |
172 When sending search query "23 Walltown, Strange Town"
174 | osm | display_name |
175 | N1 | Blue house, 23, Walltown, Strange Town |
176 When sending search query "Walltown 23, Strange Town"
178 | osm | display_name |
179 | N1 | Blue house, 23, Walltown, Strange Town |
180 When sending search query "Strange Town, Walltown 23"
182 | osm | display_name |
183 | N1 | Blue house, 23, Walltown, Strange Town |
184 When sending search query "Strange Town, Walltown 23, Blue house"
186 | osm | display_name |
187 | N1 | Blue house, 23, Walltown, Strange Town |
188 When sending search query "Strange Town, Walltown, Blue house"
190 | osm | display_name |
191 | N1 | Blue house, 23, Walltown, Strange Town |
193 Scenario: Named POIs can be found when unknown multi-word addr:place is present
195 | 100 | | | | | 101 |
197 | 103 | 10 | | | 11 | 102 |
199 | osm | class | type | name | housenr | addr+place |
200 | N1 | place | house | Blue house | 23 | Moon sun |
202 | osm | class | type | name+name | geometry |
203 | W1 | highway | residential | Rose Street | 10,11 |
204 | R1 | place | city | Strange Town | (100,101,102,103,100) |
206 When sending search query "23 Moon Sun, Strange Town"
208 | osm | display_name |
209 | N1 | Blue house, 23, Moon sun, Strange Town |
210 When sending search query "Blue house, Moon Sun, Strange Town"
212 | osm | display_name |
213 | N1 | Blue house, 23, Moon sun, Strange Town |
215 Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
217 | 100 | | | | | 101 |
219 | 103 | 10 | | | 11 | 102 |
221 | osm | class | type | housenr | addr+place |
222 | N1 | place | house | 23 | Walltown |
224 | osm | class | type | name+name | addr+city | geometry |
225 | W1 | highway | residential | Rose Street | Walltown | 10,11 |
226 | R1 | place | suburb | Strange Town | Walltown | (100,101,102,103,100) |
228 When sending search query "23 Rose Street, Walltown"
229 Then exactly 1 result is returned
231 | osm | display_name |
232 | W1 | Rose Street, Strange Town |
233 When sending search query "23 Walltown"
234 Then exactly 1 result is returned
236 | osm | display_name |
237 | N1 | 23, Walltown, Strange Town |
239 Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
244 | osm | class | type | housenr | addr+place | addr+street |
245 | N1 | place | house | 23 | Walltown | Lily Street |
247 | osm | class | type | name+name | geometry |
248 | W1 | highway | residential | Rose Street | 10,11 |
250 Then search_name has no entry for N1
251 When sending search query "23 Rose Street"
253 | osm | display_name |
254 | N1 | 23, Rose Street |
255 When sending search query "23 Lily Street"
256 Then exactly 0 results are returned
258 Scenario: An unknown addr:street is ignored
263 | osm | class | type | housenr | addr+street |
264 | N1 | place | house | 23 | Lily Street |
266 | osm | class | type | name+name | geometry |
267 | W1 | highway | residential | Rose Street | 10,11 |
269 Then search_name has no entry for N1
270 When sending search query "23 Rose Street"
272 | osm | display_name |
273 | N1 | 23, Rose Street |
274 When sending search query "23 Lily Street"
275 Then exactly 0 results are returned
277 Scenario: Named POIs get unknown address tags added in the search_name table
282 | osm | class | type | name+name | housenr | addr+city |
283 | N1 | place | house | Green Moss | 26 | Walltown |
285 | osm | class | type | name+name | geometry |
286 | W1 | highway | residential | Rose Street | 10,11 |
288 Then search_name contains
289 | object | name_vector | nameaddress_vector |
290 | N1 | #Green Moss | #Rose Street, Walltown |
291 When sending search query "Green Moss, Rose Street, Walltown"
293 | osm | display_name |
294 | N1 | Green Moss, 26, Rose Street |
295 When sending search query "Green Moss, 26, Rose Street, Walltown"
297 | osm | display_name |
298 | N1 | Green Moss, 26, Rose Street |
299 When sending search query "26, Rose Street, Walltown"
301 | osm | display_name |
302 | N1 | Green Moss, 26, Rose Street |
303 When sending search query "Rose Street 26, Walltown"
305 | osm | display_name |
306 | N1 | Green Moss, 26, Rose Street |
307 When sending search query "Walltown, Rose Street 26"
309 | osm | display_name |
310 | N1 | Green Moss, 26, Rose Street |
312 Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
314 | 100 | | | | | 101 |
316 | 103 | 10 | | | 11 | 102 |
318 | osm | class | type | name+name | addr+place |
319 | N1 | place | house | Green Moss | Walltown |
321 | osm | class | type | name+name | geometry |
322 | W1 | highway | residential | Rose Street | 10,11 |
323 | R1 | place | suburb | Strange Town | (100,101,102,103,100) |
325 When sending search query "Green Moss, Rose Street, Walltown"
326 Then exactly 0 result is returned
327 When sending search query "Green Moss, Walltown"
329 | osm | display_name |
330 | N1 | Green Moss, Walltown, Strange Town |
332 Scenario: Named POIs inherit address from parent
337 | osm | class | type | name | geometry |
338 | N1 | place | house | foo | 1 |
339 | W1 | highway | residential | the road | 10,11 |
341 Then search_name contains
342 | object | name_vector | nameaddress_vector |
343 | N1 | foo | #the road |
345 Scenario: Some addr: tags are added to address
350 | osm | class | type | name |
351 | N2 | place | city | bonn |
352 | N3 | place | suburb | smalltown|
354 | osm | class | type | addr+city | addr+municipality | addr+suburb | geometry |
355 | W1 | highway | service | bonn | New York | Smalltown | 10,11 |
357 Then search_name contains
358 | object | nameaddress_vector |
359 | W1 | bonn, new, york, smalltown |
361 Scenario: A known addr:* tag is added even if the name is unknown
365 | osm | class | type | name | addr+city | geometry |
366 | W1 | highway | residential | Road | Nandu | 10,11 |
368 Then search_name contains
369 | object | nameaddress_vector |
372 Scenario: addr:postcode is not added to the address terms
373 Given the grid with origin DE
377 | osm | class | type | name+ref |
378 | N1 | place | state | 12345 |
380 | osm | class | type | addr+postcode | geometry |
381 | W1 | highway | residential | 12345 | 10,11 |
383 Then search_name contains not
384 | object | nameaddress_vector |
387 Scenario: a linked place does not show up in search name
392 Given the named places
393 | osm | class | type | admin | geometry |
394 | R13 | boundary | administrative | 9 | (10,11,12,13,10) |
396 | osm | class | type |
397 | N2 | place | city |
399 | id | members | tags+type |
400 | 13 | N2:label | boundary |
403 | object | linked_place_id |
405 And search_name has no entry for N2
407 Scenario: a linked waterway does not show up in search name
411 | osm | class | type | name | geometry |
412 | W1 | waterway | river | Rhein | 1,2 |
413 | W2 | waterway | river | Rhein | 2,3 |
414 | R13 | waterway | river | Rhein | 1,2,3 |
416 | id | members | tags+type |
417 | 13 | W1,W2:main_stream | waterway |
420 | object | linked_place_id |
423 And search_name has no entry for W1
424 And search_name has no entry for W2