Browse Source

Update 002-search.md

pull/4/head^2
Diana Shkolnikov 9 years ago
parent
commit
d353d4c887
  1. 56
      getting-started/002-search.md

56
getting-started/002-search.md

@ -12,24 +12,50 @@ _{search text, global, no options}_
### The most basic scenario
You just set the `text` parameter to whatever you want to find.
Let's say you wanted to find **Stinky Beach**, you would simply query the search API as follows:
| parameter | value |
| --- | --- |
| text | stinky beach |
| api_key | [get yours here](https://mapzen.com/developers) |
> [/v1/search?api_key={YOUR-KEY}&___text=stinky beach___](https://search.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=stinky beach)
_...go ahead, and click that link, we'll wait_
Maybe you'd like to find an address, like this:
| parameter | value |
| --- | --- |
| text | 30 west 26th street |
| api_key | [get yours here](https://mapzen.com/developers) |
> [/v1/search?api_key={YOUR-KEY}&___text=30 west 26th street___](https://search.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=30 west 26th street)
Or even a landmark, like **Yankee Stadium**:
| parameter | value |
| --- | --- |
| text | yankee stadium |
| api_key | [get yours here](https://mapzen.com/developers) |
> [/v1/search?api_key={YOUR-KEY}&___text=yankee stadium___](https://search.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=yankee stadium)
You may have noticed already that cApiTaliZAtioN isn't a big deal for search.
You can type **yankee stadium** or **Yankee Stadium** or even **YANKEE STADIUM** if you're really excited about finding it.
See for yourself:
| parameter | value |
| --- | --- |
| text | YANKEE STADIUM |
| api_key | [get yours here](https://mapzen.com/developers) |
> [/v1/search?api_key={YOUR-KEY}&___text=YANKEE STADIUM___](https://search.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=YANKEE STADIUM)
### Results
@ -101,9 +127,21 @@ That's the _default_ number of results the API will return, unless otherwise spe
**Want a single result?**
| parameter | value |
| --- | --- |
| text | stinky beach |
| size | 1 |
| api_key | [get yours here](https://mapzen.com/developers) |
> [/v1/search?api_key={YOUR-KEY}&text=stinky beach&___size=1___](https://pelias.bigdev.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=stinky beach&size=1)
**How about 25 results?**
| parameter | value |
| --- | --- |
| text | stinky beach |
| size | 25 |
| api_key | [get yours here](https://mapzen.com/developers) |
> [/v1/search?api_key={YOUR-KEY}&text=stinky beach&___size=25___](https://pelias.bigdev.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=stinky beach&size=25)
@ -126,6 +164,15 @@ In the case where you need to specify the boundary using a rectangle, all we nee
**What if you wanted to find museums in London?**
| parameter | value |
| --- | --- |
| text | museum |
| boundary.rect.min_lat | 51.286839 |
| boundary.rect.min_lon | -0.51035 |
| boundary.rect.max_lat | 51.692322 |
| boundary.rect.max_lon | 0.33403 |
| api_key | [get yours here](https://mapzen.com/developers) |
> [/v1/search?api_key={YOUR-KEY}&text=museum&___boundary.rect.min_lat=51.286839&boundary.rect.min_lon=-0.51035&boundary.rect.max_lat=51.692322&boundary.rect.max_lon=0.33403___](https://pelias.bigdev.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=tower&boundary.rect.min_lat=51.286839&boundary.rect.min_lon=-0.51035&boundary.rect.max_lat=51.692322&boundary.rect.max_lon=0.33403)
Below is the region that will be searched. Museums located outside of this highlighted region will **NOT** be included in the results. The museums returned will be sorted based on how well they matched the `text` parameter, in this case **museum**.
@ -134,6 +181,15 @@ Below is the region that will be searched. Museums located outside of this highl
**Or you wanted to find an address, such as 28 Main Ave., in New York City?**
| parameter | value |
| --- | --- |
| text | 28 Main Ave |
| boundary.rect.min_lat | 51.286839 |
| boundary.rect.min_lon | -74.258904 |
| boundary.rect.max_lat | 40.477421 |
| boundary.rect.max_lon | -73.700378 |
| api_key | [get yours here](https://mapzen.com/developers) |
> [/v1/search?api_key={YOUR-KEY}&text=28 Main Ave&___boundary.rect.min_lat=51.286839&boundary.rect.min_lon=-74.258904&boundary.rect.max_lat=40.477421&boundary.rect.max_lon=-73.700378___](http://pelias.bigdev.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=28 Main Ave&boundary.rect.min_lat=51.286839&boundary.rect.min_lon=-74.258904&boundary.rect.max_lat=40.477421&boundary.rect.max_lon=-73.700378)

Loading…
Cancel
Save