

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# 特定の言語で検索する方法
<a name="how-to-search-specific-language"></a>

この機能を使用すると、BCP47 準拠のコードから任意のレスポンス言語を選択できます。名前バリアントに基づいてクエリ言語を検出し、一致しないトークンやあいまいなケースに優先言語を使用します。リクエストされた言語がない場合、**Places** API はその国の公式言語で結果を提供しますが、リージョンの言語が異なる場合は、そのリージョンの言語を優先します。フォールバックとして、リクエストされた言語で住所の要素が使用できない場合は、**Places** API デフォルトの言語で住所を返します。

## 想定されるユースケース
<a name="potential-use-search-language"></a>

想定されるユースケースの 1 つは、クエリや結果をローカライズする場合です。

## 例
<a name="search-language-examples"></a>

### 特定の言語で結果を取得する
<a name="search-language-result"></a>

リクエストに `"Language": "EN"` 行がない場合、結果はヘブライ語で返されます。

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

```
{
    "QueryText": "Vegan",
        "BiasPosition":[    
                34.78953,
                32.08556
        ],
    "Language": "EN"
}
```

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

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointOfInterest",
            "Title": "Rainbow",
            "Address": {
                "Label": "Rainbow, Ibn Gabirol 88, 6404612 Tel Aviv-Yafo, Israel",
                "Country": {
                    "Code2": "IL",
                    "Code3": "ISR",
                    "Name": "Israel"
                },
                "Region": {
                    "Code": "TA",
                    "Name": "TA"
                },
                "SubRegion": {
                    "Name": "Tel Aviv"
                },
                "Locality": "Tel Aviv-Yafo",
                "District": "The New North-Southern Area",
                "PostalCode": "6404612",
                "Street": "Ibn Gabirol",
                "StreetComponents": [
                    {
                        "BaseName": "Ibn Gabirol",
                        "Language": "he-Latn"
                    }
                ],
                "AddressNumber": "88"
            },
            "Position": [
                34.78149,
                32.08252
            ],
            "Distance": 829,
            "Categories": [
                {
                    "Id": "restaurant",
                    "Name": "Restaurant",
                    "LocalizedName": "Restaurant",
                    "Primary": true
                },
                {
                    "Id": "fast_food",
                    "Name": "Fast Food",
                    "LocalizedName": "Fast Food",
                    "Primary": false
                }
            ],
            "FoodTypes": [
                {
                    "LocalizedName": "Vegan",
                    "Id": "vegan",
                    "Primary": true
                },
                {
                    "LocalizedName": "Fast Food",
                    "Id": "fast_food",
                    "Primary": false
                },
                {
                    "LocalizedName": "Burgers",
                    "Id": "burgers",
                    "Primary": false
                },
                {
                    "LocalizedName": "Jewish/Kosher",
                    "Id": "jewish/kosher",
                    "Primary": false
                }
            ]
        },
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointOfInterest",
            "Title": "Alegria",
            "Address": {
                "Label": "Alegria, Ibn Gabirol 165, 6203305 Tel Aviv-Yafo, Israel",
                "Country": {
                    "Code2": "IL",
                    "Code3": "ISR",
                    "Name": "Israel"
                },
                "Region": {
                    "Code": "TA",
                    "Name": "TA"
                },
                "SubRegion": {
                    "Name": "Tel Aviv"
                },
                "Locality": "Tel Aviv-Yafo",
                "District": "The Old North-Northern Area",
                "PostalCode": "6203305",
                "Street": "Ibn Gabirol",
                "StreetComponents": [
                    {
                        "BaseName": "Ibn Gabirol",
                        "Language": "he-Latn"
                    }
                ],
                "AddressNumber": "165"
            },
            "Position": [
                34.78295,
                32.0923
            ],
            "Distance": 973,
            "Categories": [
                {
                    "Id": "restaurant",
                    "Name": "Restaurant",
                    "LocalizedName": "Restaurant",
                    "Primary": true
                },
                {
                    "Id": "coffee_shop",
                    "Name": "Coffee Shop",
                    "LocalizedName": "Coffee Shop",
                    "Primary": false
                },
                {
                    "Id": "specialty_food_store",
                    "Name": "Specialty Food Store",
                    "LocalizedName": "Specialty Food Store",
                    "Primary": false
                },
                {
                    "Id": "bakery_and_baked_goods_store",
                    "Name": "Bakery and Baked Goods Store",
                    "LocalizedName": "Bakery & Baked Goods Store",
                    "Primary": false
                }
            ],
            "FoodTypes": [
                {
                    "LocalizedName": "Vegan",
                    "Id": "vegan",
                    "Primary": true
                }
            ]
        }
    ]
}
```

------
#### [ 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": "Vegan",
                "BiasPosition":[    
                        34.78953,
                        32.08556
                ],
            "Language": "EN"
        }'
```

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

```
aws geo-places search-text --key ${YourKey} --query-text "Vegan" \
--bias-position 34.78953 32.08556 \
--language "EN"
```

------