Come effettuare una ricerca in una lingua specifica - Servizio di posizione Amazon

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

Come effettuare una ricerca in una lingua specifica

Questa funzionalità consente di selezionare una lingua di risposta preferita tra i BCP47 codici conformi. Rileva il linguaggio di interrogazione in base alle varianti dei nomi e utilizza il linguaggio preferito per token senza pari e casi ambigui. Se non è presente una lingua richiesta, l'API Places fornisce i risultati nella lingua ufficiale del paese, ma dà priorità alla lingua regionale nelle regioni in cui è diversa. Come strategia alternativa, se alcuni elementi dell'indirizzo non sono disponibili nella lingua richiesta, Places APIs restituisce gli indirizzi nella lingua predefinita.

Casi d'uso potenziali

Un potenziale caso d'uso è quello di localizzare la query e/o il risultato.

Esempi

Senza la "Language": "EN" riga nella richiesta, i risultati verrebbero restituiti in ebraico.

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"