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