+@SQLITE
@APIDB
Feature: Search queries
Generic search result correctness
+ Scenario: Search for natural object
+ When sending json search query "Samina"
+ | accept-language |
+ | en |
+ Then results contain
+ | ID | class | type | display_name |
+ | 0 | waterway | river | Samina, Austria |
+
Scenario: House number search for non-street address
When sending json search query "6 Silum, Liechtenstein" with address
| accept-language |
| postcode | 9497 |
| country | Liechtenstein |
| country_code | li |
+ | ISO3166-2-lvl8 | LI-10 |
Scenario: House number interpolation
When sending json search query "Grosssteg 1023, Triesenberg" with address
| town | Triesenberg |
| country | Liechtenstein |
| country_code | li |
+ | ISO3166-2-lvl8 | LI-10 |
Scenario Outline: Housenumber 0 can be found
When sending <format> search query "Gnalpstrasse 0" with address
| way | ^697,.* |
Scenario: Search with class-type feature
- When sending jsonv2 search query "Hotel in California"
+ When sending jsonv2 search query "bars in ebenholz"
Then results contain
| place_rank |
| 30 |
| class | type |
| amenity | restaurant |
+ Scenario: Search with specific amenity also work in country
+ When sending json search query "restaurants in liechtenstein" with address
+ Then result addresses contain
+ | country |
+ | Liechtenstein |
+ And results contain
+ | class | type |
+ | amenity | restaurant |
+
Scenario: Search with key-value amenity
When sending json search query "[club=scout] Vaduz"
Then results contain
| class | type |
| club | scout |
- Scenario: With multiple amenity search only the first is used
- When sending json search query "[club=scout] [church] vaduz"
- Then results contain
- | class | type |
- | club | scout |
- When sending json search query "[amenity=place_of_worship] [club=scout] vaduz"
- Then results contain
- | class | type |
- | amenity | place_of_worship |
-
Scenario: POI search near given coordinate
When sending json search query "restaurant near 47.16712,9.51100"
Then results contain
| class | type |
| leisure | firepit |
- Scenario: Arbitrary key/value search near given coordinate and named place
- When sending json search query "[leisure=firepit] ebenholz 47° 9′ 26″ N 9° 36′ 45″ E"
+
+ Scenario: POI search in a bounded viewbox
+ When sending json search query "restaurants"
+ | viewbox | bounded |
+ | 9.50830,47.15253,9.52043,47.14866 | 1 |
Then results contain
- | class | type |
- | leisure | firepit |
+ | class | type |
+ | amenity | restaurant |
+
+ Scenario Outline: Key/value search near given coordinate can be restricted to country
+ When sending json search query "[natural=peak] 47.06512,9.53965" with address
+ | countrycodes |
+ | <cc> |
+ Then result addresses contain
+ | country_code |
+ | <cc> |
+
+ Examples:
+ | cc |
+ | li |
+ | ch |
Scenario: Name search near given coordinate
When sending json search query "sporry" with address
Then exactly 0 results are returned
Scenario: Ignore country searches when query is restricted to countries
- When sending json search query "de"
+ When sending json search query "fr"
| countrycodes |
| li |
Then exactly 0 results are returned
+ Scenario: Country searches only return results for the given country
+ When sending search query "Ans Trail" with address
+ | countrycodes |
+ | li |
+ Then result addresses contain
+ | country_code |
+ | li |
+
# https://trac.openstreetmap.org/ticket/5094
Scenario: housenumbers are ordered by complete match first
When sending json search query "Austrasse 11, Vaduz" with address
Then result addresses contain
| ID | house_number |
| 0 | 11 |
- | 1 | 11 a |
Scenario Outline: Coordinate searches with white spaces
When sending json search query "<data>"
Then result addresses contain
| ID | town |
| 0 | Vaduz |
+
+ Scenario: Search can handle complex query word sets
+ When sending search query "aussenstelle universitat lichtenstein wachterhaus aussenstelle universitat lichtenstein wachterhaus aussenstelle universitat lichtenstein wachterhaus aussenstelle universitat lichtenstein wachterhaus"
+ Then a HTTP 200 is returned