]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/api/search/queries.feature
Remove country and state nodes from address computation
[nominatim.git] / test / bdd / api / search / queries.feature
1 @APIDB
2 Feature: Search queries
3     Generic search result correctness
4
5     Scenario: House number search for non-street address
6         When sending json search query "2 Steinwald, Austria" with address
7           | accept-language |
8           | en |
9         Then address of result 0 is
10           | type         | value |
11           | house_number | 2 |
12           | hamlet       | Steinwald |
13           | postcode     | 6811 |
14           | country      | Austria |
15           | country_code | at |
16
17     Scenario: House number interpolation even
18         When sending json search query "Schellingstr 86, Hamburg" with address
19           | accept-language |
20           | de |
21         Then address of result 0 is
22           | type          | value |
23           | house_number  | 86 |
24           | road          | Schellingstraße |
25           | neighbourhood | Auenviertel |
26           | suburb        | Eilbek |
27           | postcode      | 22089 |
28           | city_district | Wandsbek |
29           | country       | Deutschland |
30           | country_code  | de |
31
32     Scenario: House number interpolation odd
33         When sending json search query "Schellingstr 73, Hamburg" with address
34           | accept-language |
35           | de |
36         Then address of result 0 is
37           | type          | value |
38           | house_number  | 73 |
39           | road          | Schellingstraße |
40           | neighbourhood | Auenviertel |
41           | suburb        | Eilbek |
42           | postcode      | 22089 |
43           | city_district | Wandsbek |
44           | country       | Deutschland |
45           | country_code  | de |
46
47     Scenario: With missing housenumber search falls back to road
48         When sending json search query "342 rocha, santa lucia" with address
49         Then address of result 0 is
50           | type         | value |
51           | road         | Rocha |
52           | city         | Santa Lucía |
53           | state        | Canelones |
54           | postcode     | 90700 |
55           | country      | Uruguay |
56           | country_code | uy |
57
58     @Tiger
59     Scenario: TIGER house number
60         When sending json search query "323 22nd Street Southwest, Huron"
61         Then results contain
62          | osm_type |
63          | way |
64
65     Scenario: Search with class-type feature
66         When sending jsonv2 search query "Hotel in California"
67         Then results contain
68           | place_rank |
69           | 30 |
70
71     Scenario: Search with specific amenity
72         When sending json search query "[restaurant] Vaduz" with address
73         Then result addresses contain
74           | country |
75           | Liechtenstein |
76         And  results contain
77           | class   | type |
78           | amenity | restaurant |
79
80     Scenario: Search with key-value amenity
81         When sending json search query "[shop=hifi] hamburg"
82         Then results contain
83           | class | type |
84           | shop  | hifi |
85
86     Scenario: With multiple amenity search only the first is used
87         When sending json search query "[shop=hifi] [church] hamburg"
88         Then results contain
89           | class | type |
90           | shop  | hifi |
91
92     Scenario: With multiple amenity search only the first is used
93         When sending json search query "[church] [restaurant] hamburg"
94         Then results contain
95           | class   | type |
96           | amenity | place_of_worship |
97
98     Scenario: POI search near given coordinate
99         When sending json search query "restaurant near 47.16712,9.51100"
100         Then results contain
101           | class   | type |
102           | amenity | restaurant |
103
104     Scenario: Arbitrary key/value search near given coordinate
105         When sending json search query "[man_made=mast]  47.15739° N 9.61264° E"
106         Then results contain
107           | class    | type |
108           | man_made | mast |
109
110     Scenario: Arbitrary key/value search near given coordinate and named place
111         When sending json search query "[man_made=mast] amerlugalpe  47° 9′ 26″ N 9° 36′ 45″ E"
112         Then results contain
113           | class    | type |
114           | man_made | mast |
115
116     Scenario: Name search near given coordinate
117         When sending json search query "amerlugalpe, N 47.15739° E 9.61264°"
118         Then exactly 1 result is returned
119
120     Scenario: Name search near given coordinate without result
121         When sending json search query "amerlugalpe, N 47 15 7 W 9 61 26"
122         Then exactly 0 results are returned
123
124     Scenario: Arbitrary key/value search near a road
125         When sending json search query "[leisure=table_soccer_table] immenbusch"
126         Then results contain
127           | class   | type |
128           | leisure | table_soccer_table |
129
130     Scenario: Ignore other country codes in structured search with country
131         When sending json search query ""
132             | city | country |
133             | li   | de      |
134         Then exactly 0 results are returned
135
136     Scenario: Ignore country searches when query is restricted to countries
137         When sending json search query "de"
138             | countrycodes |
139             | li  |
140         Then exactly 0 results are returned
141
142     # https://trac.openstreetmap.org/ticket/5094
143     Scenario: housenumbers are ordered by complete match first
144         When sending json search query "6395 geminis, montevideo" with address
145         Then result addresses contain
146           | ID | house_number |
147           | 0  | 6395 |
148           | 1  | 6395 BIS |
149