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 |
15 Scenario: Comma-separated names appear as a single full name
17 | osm | class | type | name+alt_name |
18 | N1 | place | city | New York, Big Apple |
20 Then search_name contains
21 | object | name_vector |
22 | N1 | #New York Big Apple |
24 Scenario: Name parts before brackets appear as full names
26 | osm | class | type | name+name |
27 | N1 | place | city | Halle (Saale) |
29 Then search_name contains
30 | object | name_vector |
31 | N1 | #Halle Saale, #Halle |
33 Scenario: Unnamed POIs have no search entry
38 | osm | class | type |
39 | N1 | place | house |
41 | osm | class | type | geometry |
42 | W1 | highway | residential | 10,11 |
44 Then search_name has no entry for N1
46 Scenario: Unnamed POI has a search entry when it has unknown addr: tags
51 | osm | class | type | housenr | addr+city |
52 | N1 | place | house | 23 | Walltown |
54 | osm | class | type | name+name | geometry |
55 | W1 | highway | residential | Rose Street | 10,11 |
57 Then search_name contains
58 | object | nameaddress_vector |
59 | N1 | #Rose Street, Walltown |
60 When sending search query "23 Rose Street, Walltown"
62 | osm | display_name |
63 | N1 | 23, Rose Street |
64 When sending search query "Walltown, Rose Street 23"
66 | osm | display_name |
67 | N1 | 23, Rose Street |
68 When sending search query "Rose Street 23, Walltown"
70 | osm | display_name |
71 | N1 | 23, Rose Street |
73 Scenario: Searching for unknown addr: tags also works for multiple words
78 | osm | class | type | housenr | addr+city |
79 | N1 | place | house | 23 | Little Big Town |
81 | osm | class | type | name+name | geometry |
82 | W1 | highway | residential | Rose Street | 10,11 |
84 Then search_name contains
85 | object | nameaddress_vector |
86 | N1 | #Rose Street, rose, Little, Big, Town |
87 When sending search query "23 Rose Street, Little Big Town"
89 | osm | display_name |
90 | N1 | 23, Rose Street |
91 When sending search query "Rose Street 23, Little Big Town"
93 | osm | display_name |
94 | N1 | 23, Rose Street |
95 When sending search query "Little big Town, Rose Street 23"
97 | osm | display_name |
98 | N1 | 23, Rose Street |
100 Scenario: Unnamed POI has no search entry when it has known addr: tags
105 | osm | class | type | housenr | addr+city |
106 | N1 | place | house | 23 | Walltown |
108 | osm | class | type | name+name | addr+city | geometry |
109 | W1 | highway | residential | Rose Street | Walltown | 10,11 |
111 Then search_name has no entry for N1
112 When sending search query "23 Rose Street, Walltown"
114 | osm | display_name |
115 | N1 | 23, Rose Street |
117 Scenario: Unnamed POI must have a house number to get a search entry
122 | osm | class | type | addr+city |
123 | N1 | place | house | Walltown |
125 | osm | class | type | name+name | geometry |
126 | W1 | highway | residential | Rose Street | 10,11 |
128 Then search_name has no entry for N1
130 Scenario: Unnamed POIs inherit parent name when unknown addr:place is present
132 | 100 | | | | | 101 |
134 | 103 | 10 | | | 11 | 102 |
136 | osm | class | type | housenr | addr+place |
137 | N1 | place | house | 23 | Walltown |
139 | osm | class | type | name+name | geometry |
140 | W1 | highway | residential | Rose Street | 10,11 |
141 | R1 | place | city | Strange Town | (100,101,102,103,100) |
144 | object | parent_place_id |
146 When sending search query "23 Rose Street"
147 Then exactly 1 results are returned
149 | osm | display_name |
150 | W1 | Rose Street, Strange Town |
151 When sending search query "23 Walltown, Strange Town"
153 | osm | display_name |
154 | N1 | 23, Walltown, Strange Town |
155 When sending search query "Walltown 23, Strange Town"
157 | osm | display_name |
158 | N1 | 23, Walltown, Strange Town |
159 When sending search query "Strange Town, Walltown 23"
161 | osm | display_name |
162 | N1 | 23, Walltown, Strange Town |
164 Scenario: Named POIs can be searched by housenumber when unknown addr:place is present
166 | 100 | | | | | 101 |
168 | 103 | 10 | | | 11 | 102 |
170 | osm | class | type | name | housenr | addr+place |
171 | N1 | place | house | Blue house | 23 | Walltown |
173 | osm | class | type | name+name | geometry |
174 | W1 | highway | residential | Rose Street | 10,11 |
175 | R1 | place | city | Strange Town | (100,101,102,103,100) |
177 When sending search query "23 Walltown, Strange Town"
179 | osm | display_name |
180 | N1 | Blue house, 23, Walltown, Strange Town |
181 When sending search query "Walltown 23, Strange Town"
183 | osm | display_name |
184 | N1 | Blue house, 23, Walltown, Strange Town |
185 When sending search query "Strange Town, Walltown 23"
187 | osm | display_name |
188 | N1 | Blue house, 23, Walltown, Strange Town |
189 When sending search query "Strange Town, Walltown 23, Blue house"
191 | osm | display_name |
192 | N1 | Blue house, 23, Walltown, Strange Town |
193 When sending search query "Strange Town, Walltown, Blue house"
195 | osm | display_name |
196 | N1 | Blue house, 23, Walltown, Strange Town |
198 Scenario: Named POIs can be found when unknown multi-word addr:place is present
200 | 100 | | | | | 101 |
202 | 103 | 10 | | | 11 | 102 |
204 | osm | class | type | name | housenr | addr+place |
205 | N1 | place | house | Blue house | 23 | Moon sun |
207 | osm | class | type | name+name | geometry |
208 | W1 | highway | residential | Rose Street | 10,11 |
209 | R1 | place | city | Strange Town | (100,101,102,103,100) |
211 When sending search query "23 Moon Sun, Strange Town"
213 | osm | display_name |
214 | N1 | Blue house, 23, Moon sun, Strange Town |
215 When sending search query "Blue house, Moon Sun, Strange Town"
217 | osm | display_name |
218 | N1 | Blue house, 23, Moon sun, Strange Town |
220 Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
222 | 100 | | | | | 101 |
224 | 103 | 10 | | | 11 | 102 |
226 | osm | class | type | housenr | addr+place |
227 | N1 | place | house | 23 | Walltown |
229 | osm | class | type | name+name | addr+city | geometry |
230 | W1 | highway | residential | Rose Street | Walltown | 10,11 |
231 | R1 | place | suburb | Strange Town | Walltown | (100,101,102,103,100) |
233 When sending search query "23 Rose Street, Walltown"
234 Then exactly 1 result is returned
236 | osm | display_name |
237 | W1 | Rose Street, Strange Town |
238 When sending search query "23 Walltown"
239 Then exactly 1 result is returned
241 | osm | display_name |
242 | N1 | 23, Walltown, Strange Town |
244 Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
249 | osm | class | type | housenr | addr+place | addr+street |
250 | N1 | place | house | 23 | Walltown | Lily Street |
252 | osm | class | type | name+name | geometry |
253 | W1 | highway | residential | Rose Street | 10,11 |
255 Then search_name has no entry for N1
256 When sending search query "23 Rose Street"
258 | osm | display_name |
259 | N1 | 23, Rose Street |
260 When sending search query "23 Lily Street"
261 Then exactly 0 results are returned
263 Scenario: An unknown addr:street is ignored
268 | osm | class | type | housenr | addr+street |
269 | N1 | place | house | 23 | Lily Street |
271 | osm | class | type | name+name | geometry |
272 | W1 | highway | residential | Rose Street | 10,11 |
274 Then search_name has no entry for N1
275 When sending search query "23 Rose Street"
277 | osm | display_name |
278 | N1 | 23, Rose Street |
279 When sending search query "23 Lily Street"
280 Then exactly 0 results are returned
282 Scenario: Named POIs get unknown address tags added in the search_name table
287 | osm | class | type | name+name | housenr | addr+city |
288 | N1 | place | house | Green Moss | 26 | Walltown |
290 | osm | class | type | name+name | geometry |
291 | W1 | highway | residential | Rose Street | 10,11 |
293 Then search_name contains
294 | object | name_vector | nameaddress_vector |
295 | N1 | #Green Moss | #Rose Street, Walltown |
296 When sending search query "Green Moss, Rose Street, Walltown"
298 | osm | display_name |
299 | N1 | Green Moss, 26, Rose Street |
300 When sending search query "Green Moss, 26, Rose Street, Walltown"
302 | osm | display_name |
303 | N1 | Green Moss, 26, Rose Street |
304 When sending search query "26, Rose Street, Walltown"
306 | osm | display_name |
307 | N1 | Green Moss, 26, Rose Street |
308 When sending search query "Rose Street 26, Walltown"
310 | osm | display_name |
311 | N1 | Green Moss, 26, Rose Street |
312 When sending search query "Walltown, Rose Street 26"
314 | osm | display_name |
315 | N1 | Green Moss, 26, Rose Street |
317 Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
319 | 100 | | | | | 101 |
321 | 103 | 10 | | | 11 | 102 |
323 | osm | class | type | name+name | addr+place |
324 | N1 | place | house | Green Moss | Walltown |
326 | osm | class | type | name+name | geometry |
327 | W1 | highway | residential | Rose Street | 10,11 |
328 | R1 | place | suburb | Strange Town | (100,101,102,103,100) |
330 When sending search query "Green Moss, Rose Street, Walltown"
331 Then exactly 0 result is returned
332 When sending search query "Green Moss, Walltown"
334 | osm | display_name |
335 | N1 | Green Moss, Walltown, Strange Town |
337 Scenario: Named POIs inherit address from parent
342 | osm | class | type | name | geometry |
343 | N1 | place | house | foo | 1 |
344 | W1 | highway | residential | the road | 10,11 |
346 Then search_name contains
347 | object | name_vector | nameaddress_vector |
348 | N1 | foo | #the road |
350 Scenario: Some addr: tags are added to address
355 | osm | class | type | name |
356 | N2 | place | city | bonn |
357 | N3 | place | suburb | smalltown|
359 | osm | class | type | addr+city | addr+municipality | addr+suburb | geometry |
360 | W1 | highway | service | bonn | New York | Smalltown | 10,11 |
362 Then search_name contains
363 | object | nameaddress_vector |
364 | W1 | bonn, new, york, smalltown |
366 Scenario: A known addr:* tag is added even if the name is unknown
370 | osm | class | type | name | addr+city | geometry |
371 | W1 | highway | residential | Road | Nandu | 10,11 |
373 Then search_name contains
374 | object | nameaddress_vector |
377 Scenario: addr:postcode is not added to the address terms
378 Given the grid with origin DE
382 | osm | class | type | name+ref |
383 | N1 | place | state | 12345 |
385 | osm | class | type | addr+postcode | geometry |
386 | W1 | highway | residential | 12345 | 10,11 |
388 Then search_name contains not
389 | object | nameaddress_vector |
392 Scenario: a linked place does not show up in search name
397 Given the named places
398 | osm | class | type | admin | geometry |
399 | R13 | boundary | administrative | 9 | (10,11,12,13,10) |
401 | osm | class | type |
402 | N2 | place | city |
404 | id | members | tags+type |
405 | 13 | N2:label | boundary |
408 | object | linked_place_id |
410 And search_name has no entry for N2
412 Scenario: a linked waterway does not show up in search name
416 | osm | class | type | name | geometry |
417 | W1 | waterway | river | Rhein | 1,2 |
418 | W2 | waterway | river | Rhein | 2,3 |
419 | R13 | waterway | river | Rhein | 1,2,3 |
421 | id | members | tags+type |
422 | 13 | W1,W2:main_stream | waterway |
425 | object | linked_place_id |
428 And search_name has no entry for W1
429 And search_name has no entry for W2