]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/db/query/search_simple.feature
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / test / bdd / db / query / search_simple.feature
1 @DB
2 Feature: Searching of simple objects
3     Testing simple stuff
4
5     Scenario: Search for place node
6         Given the places
7           | osm | class | type    | name+name | geometry   |
8           | N1  | place | village | Foo       | 10.0 -10.0 |
9         When importing
10         And sending search query "Foo"
11         Then results contain
12          | ID | osm | category | type    | centroid |
13          | 0  | N1  | place    | village | 10 -10   |
14
15      Scenario: Updating postcode in postcode boundaries without ref
16         Given the grid
17           | 1 | 2 |
18           | 4 | 3 |
19         Given the places
20           | osm | class    | type        | postcode | geometry |
21           | R1  | boundary | postal_code | 12345    | (1,2,3,4,1) |
22         When importing
23         And sending search query "12345"
24         Then results contain
25          | ID | osm |
26          | 0  | R1 |
27         When updating places
28           | osm | class    | type        | postcode | geometry |
29           | R1  | boundary | postal_code | 54321    | (1,2,3,4,1) |
30         And sending search query "12345"
31         Then exactly 0 results are returned
32         When sending search query "54321"
33         Then results contain
34          | ID | osm |
35          | 0  | R1 |
36
37     # github #1763
38     Scenario: Correct translation of highways under construction
39         Given the grid
40          | 1 |  |   |  | 2 |
41          |   |  | 9 |  |   |
42         And the places
43          | osm | class   | type         | name      | geometry |
44          | W1  | highway | construction | The build | 1,2      |
45          | N1  | amenity | cafe         | Bean      | 9        |
46         When importing
47         And sending json search query "Bean" with address
48         Then result addresses contain
49          | amenity | road |
50          | Bean    | The build |
51
52     Scenario: when missing housenumbers in search don't return a POI
53         Given the places
54          | osm | class   | type       | name        |
55          | N3  | amenity | restaurant | Wood Street |
56         And the places
57          | osm | class   | type       | name        | housenr |
58          | N20 | amenity | restaurant | Red Way     | 34      |
59         When importing
60         And sending search query "Wood Street 45"
61         Then exactly 0 results are returned
62         When sending search query "Red Way 34"
63         Then results contain
64          | osm |
65          | N20 |
66
67      Scenario: when the housenumber is missing the street is still returned
68         Given the grid
69          | 1 |  | 2 |
70         Given the places
71          | osm | class   | type        | name        | geometry |
72          | W1  | highway | residential | Wood Street | 1, 2     |
73         When importing
74         And sending search query "Wood Street"
75         Then results contain
76          | osm |
77          | W1  |
78
79
80      Scenario Outline: Special cased american states will be found
81         Given the grid
82          | 1 |    | 2 |
83          |   | 10 |   |
84          | 4 |    | 3 |
85         Given the places
86          | osm  | class    | type           | admin | name    | name+ref | geometry    |
87          | R1   | boundary | administrative | 4     | <state> | <ref>    | (1,2,3,4,1) |
88         Given the places
89          | osm  | class | type  | name   | geometry    |
90          | N2   | place | town  | <city> | 10          |
91          | N3   | place | city  | <city>  | country:ca  |
92         When importing
93         And sending search query "<city>, <state>"
94         Then results contain
95          | osm |
96          | N2  |
97         When sending search query "<city>, <ref>"
98          | accept-language |
99          | en |
100         Then results contain
101          | osm |
102          | N2  |
103
104      Examples:
105         | city        | state     | ref |
106         | Chicago     | Illinois  | IL  |
107         | Auburn      | Alabama   | AL  |
108         | New Orleans | Louisiana | LA  |