

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 범주 이름 또는 음식 유형을 사용하여 검색하는 방법
<a name="how-to-search-category-name"></a>

`SearchText` API를 사용하면 레스토랑, 학교 등과 같은 범주 이름을 기준으로 검색할 수 있습니다. 또한 음식 유형별로 검색할 수도 있습니다.

SearchText API를 사용하는 한 가지 방법은 최종 사용자가 이름(범주 및 음식 유형)과 애플리케이션 세트의 바이어스 위치를 기준으로 검색할 수 있도록 하는 것입니다. 이러한 바이어스 위치는 디바이스 위치, IP 위치 또는 맵의 뷰 포트 중심일 수 있습니다. 또한 최종 사용자는 도시 이름이나 장소를 제공할 수 있으며 애플리케이션은 지역 좌표에 따라 결과를 편향시킬 수 있습니다.

자세한 내용은 [카테고리 필터](places-filtering.md#place-categories) 및 [음식 종류 필터](places-filtering.md#food-type) 섹션을 참조하세요.

## 가능한 사용 사례
<a name="potential-use-category-name"></a>
+ 주변 지역 탐색의 일환으로 특정 POI 또는 장소를 검색합니다.
+ 여행 계획을 위한 특정 여행지를 검색합니다.
+ 특정 음식을 제공하는 레스토랑을 검색합니다.

## 예제
<a name="search-category-examples"></a>

### 범주 검색
<a name="search-category-result"></a>

------
#### [ Sample request ]

```
{
    "QueryText": "Nursing Home",
    "BiasPosition": [
                -123.11336,
                49.26038
            ],    
}
```

------
#### [ Sample response ]

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointOfInterest",
            "Title": "Diamond Geriatrics Inc",
            "Address": {
                "Label": "Diamond Geriatrics Inc, 288 W 8th Ave, Vancouver, BC V5Y 1N5, Canada",
                "Country": {
                    "Code2": "CA",
                    "Code3": "CAN",
                    "Name": "Canada"
                },
                "Region": {
                    "Code": "BC",
                    "Name": "British Columbia"
                },
                "SubRegion": {
                    "Name": "Metro Vancouver"
                },
                "Locality": "Vancouver",
                "District": "Mt Pleasant",
                "PostalCode": "V5Y 1N5",
                "Street": "W 8th Ave",
                "StreetComponents": [
                    {
                        "BaseName": "8th",
                        "Type": "Ave",
                        "TypePlacement": "AfterBaseName",
                        "TypeSeparator": " ",
                        "Prefix": "W",
                        "Language": "en"
                    }
                ],
                "AddressNumber": "288"
            },
            "Position": [
                -123.11061,
                49.2636
            ],
            "Distance": 410,
            "Categories": [
                {
                    "Id": "nursing_home",
                    "Name": "Nursing Home",
                    "LocalizedName": "Nursing Home",
                    "Primary": true
                },
                {
                    "Id": "social_service",
                    "Name": "Social Service",
                    "LocalizedName": "Social Services",
                    "Primary": false
                }
            ]
        },
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointOfInterest",
            "Title": "Para Med Home Health Care",
            "Address": {
                "Label": "Para Med Home Health Care, 601 W Broadway, Vancouver, BC V5Z 4C2, Canada",
                "Country": {
                    "Code2": "CA",
                    "Code3": "CAN",
                    "Name": "Canada"
                },
                "Region": {
                    "Code": "BC",
                    "Name": "British Columbia"
                },
                "SubRegion": {
                    "Name": "Metro Vancouver"
                },
                "Locality": "Vancouver",
                "District": "Fairview",
                "PostalCode": "V5Z 4C2",
                "Street": "W Broadway",
                "StreetComponents": [
                    {
                        "BaseName": "Broadway",
                        "Prefix": "W",
                        "Language": "en"
                    }
                ],
                "AddressNumber": "601"
            },
            "Position": [
                -123.11772,
                49.26343
            ],
            "Distance": 464,
            "Categories": [
                {
                    "Id": "nursing_home",
                    "Name": "Nursing Home",
                    "LocalizedName": "Nursing Home",
                    "Primary": true
                },
                {
                    "Id": "hospital_or_health_care_facility",
                    "Name": "Hospital or Health Care Facility",
                    "LocalizedName": "Hospital or Health Care Facility",
                    "Primary": false
                }
            ]
        }
        ...
        ...
    ]
}
```

------
#### [ cURL ]

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
    "QueryText": "Nursing Home",
    "BiasPosition": [
                -123.11336,
                49.26038
            ]
}'
```

------
#### [ AWS CLI ]

```
aws geo-places search-text --key ${YourKey} --query-text "Nursing Home" --bias-position -123.11336 49.26038
```

------

### 음식 유형 검색
<a name="search-food-result"></a>

`QueryText`에 음식 유형을 지정하여 음식 유형별로 레스토랑을 선택합니다. 음식 유형별로 필터링하면 음식 유형에 따라 레스토랑을 인덱싱, 쿼리 및 표시할 수 있습니다.

------
#### [ Sample request ]

```
{
    "QueryText": "Sushi",
    "BiasPosition": [
                -123.11336,
                49.26038
            ]
}
```

------
#### [ Sample response ]

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointOfInterest",
            "Title": "Sushi Tomy",
            "Address": {
                "Label": "Sushi Tomy, 555 W 12th Ave, Vancouver, BC V5Z 3X7, Canada",
                "Country": {
                    "Code2": "CA",
                    "Code3": "CAN",
                    "Name": "Canada"
                },
                "Region": {
                    "Code": "BC",
                    "Name": "British Columbia"
                },
                "SubRegion": {
                    "Name": "Metro Vancouver"
                },
                "Locality": "Vancouver",
                "District": "Fairview",
                "PostalCode": "V5Z 3X7",
                "Street": "W 12th Ave",
                "StreetComponents": [
                    {
                        "BaseName": "12th",
                        "Type": "Ave",
                        "TypePlacement": "AfterBaseName",
                        "TypeSeparator": " ",
                        "Prefix": "W",
                        "Language": "en"
                    }
                ],
                "AddressNumber": "555"
            },
            "Position": [
                -123.11629,
                49.26086
            ],
            "Distance": 219,
            "Categories": [
                {
                    "Id": "deli",
                    "Name": "Deli",
                    "LocalizedName": "Deli",
                    "Primary": true
                },
                {
                    "Id": "restaurant",
                    "Name": "Restaurant",
                    "LocalizedName": "Restaurant",
                    "Primary": false
                },
                {
                    "Id": "casual_dining",
                    "Name": "Casual Dining",
                    "LocalizedName": "Casual Dining",
                    "Primary": false
                }
            ],
            "FoodTypes": [
                {
                    "LocalizedName": "Japanese - Sushi",
                    "Id": "japanese-sushi",
                    "Primary": true
                },
                {
                    "LocalizedName": "Canadian",
                    "Id": "canadian",
                    "Primary": false
                },
                {
                    "LocalizedName": "Japanese",
                    "Id": "japanese",
                    "Primary": false
                }
            ]
        },
        {
            "PlaceId": "<Redacted>"
            "PlaceType": "PointOfInterest",
            "Title": "Shiro Japanese Restaurant",
            "Address": {
                "Label": "Shiro Japanese Restaurant, 3096 Cambie St, Vancouver, BC V5Z 2V9, Canada",
                "Country": {
                    "Code2": "CA",
                    "Code3": "CAN",
                    "Name": "Canada"
                },
                "Region": {
                    "Code": "BC",
                    "Name": "British Columbia"
                },
                "SubRegion": {
                    "Name": "Metro Vancouver"
                },
                "Locality": "Vancouver",
                "District": "Mt Pleasant",
                "PostalCode": "V5Z 2V9",
                "Street": "Cambie St",
                "StreetComponents": [
                    {
                        "BaseName": "Cambie",
                        "Type": "St",
                        "TypePlacement": "AfterBaseName",
                        "TypeSeparator": " ",
                        "Language": "en"
                    }
                ],
                "AddressNumber": "3096"
            },
            "Position": [
                -123.11461,
                49.25797
            ],
            "Distance": 283,
            "Categories": [
                {
                    "Id": "casual_dining",
                    "Name": "Casual Dining",
                    "LocalizedName": "Casual Dining",
                    "Primary": true
                },
                {
                    "Id": "restaurant",
                    "Name": "Restaurant",
                    "LocalizedName": "Restaurant",
                    "Primary": false
                }
            ],
            "FoodTypes": [
                {
                    "LocalizedName": "Japanese - Sushi",
                    "Id": "japanese-sushi",
                    "Primary": true
                },
                {
                    "LocalizedName": "Asian",
                    "Id": "asian",
                    "Primary": false
                },
                {
                    "LocalizedName": "Japanese",
                    "Id": "japanese",
                    "Primary": false
                }
            ]
        },
        ...
        ...
    ]
}
```

------
#### [ cURL ]

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
    "QueryText": "Sushi",
    "BiasPosition": [
                -123.11336,
                49.26038
            ]
}'
```

------
#### [ AWS CLI ]

```
aws geo-places search-text --key ${YourKey} --query-text "Sushi" --bias-position -123.11336 49.26038
```

------