部分的に型付けされたクエリまたはスペルミスのあるクエリの結果を取得する方法 - Amazon Location Service

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

部分的に型付けされたクエリまたはスペルミスのあるクエリの結果を取得する方法

提案 API を使用すると、アプリケーションは結果の場所またはカテゴリに対するユーザークエリを完了できます。これらの結果は、一致する可能性が最も低いものからソートされるため、API は不完全な単語やスペルミスの単語を解決できます。

潜在的なユースケース

  • 部分的に型指定された対象ポイントクエリを完了する: 部分的に型指定されたエントリまたは正しくないエントリに基づいて提案を提供することでユーザーを支援します。

Sample request
{ "QueryText": "Effel tow", "Filter": { "Circle": { "Radius": 10000, "Center": [2.3431932014695382, 48.858844492141145] }, "IncludeCountries": ["FRA"] }, "AdditionalFeatures": ["Core"] }
Sample response
{ "ResultItems": [ { "Title": "Tour Eiffel (Eiffel Tower)", "SuggestResultItemType": "Place", "Place": { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Address": { "Label": "Tour Eiffel, 5 Avenue Anatole France, 75007 Paris, France", "Country": {"Code2": "FR", "Code3": "FRA", "Name": "France"}, "Region": {"Code": "IDF", "Name": "Île-de-France"}, "SubRegion": {"Name": "Paris"}, "Locality": "Paris", "District": "7e Arrondissement", "PostalCode": "75007", "Street": "Avenue Anatole France", "StreetComponents": [{"BaseName": "Anatole France", "Type": "Avenue", "Language": "fr"}], "AddressNumber": "5" }, "Position": [2.2945, 48.85824], "Distance": 3563, "Categories": [ {"Id": "historical_monument", "Name": "Historical Monument", "LocalizedName": "Monument historique", "Primary": true}, {"Id": "landmark-attraction", "Name": "Landmark-Attraction", "LocalizedName": "Lieu d'intérêt/Attraction", "Primary": false}, {"Id": "tourist_attraction", "Name": "Tourist Attraction", "LocalizedName": "Attraction touristique", "Primary": false}, {"Id": "sports_complex-stadium", "Name": "Sports Complex-Stadium", "LocalizedName": "Stade ou complexe sportif", "Primary": false} ] }, "Highlights": {"Title": [{"StartIndex": 13, "EndIndex": 23, "Value": "Eiffel Tow"}]} } ], "QueryRefinements": [] }
cURL
curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Effel tow", "Filter": { "Circle": {"Radius": 10000, "Center": [2.3431932014695382, 48.858844492141145]}, "IncludeCountries": ["FRA"] }, "AdditionalFeatures": ["Core"] }'
AWS CLI
aws geo-places suggest --key ${YourKey} \ --query-text "Effel tow" \ --filter '{"Circle": {"Radius": 1000, "Center": [2.3431932014695382, 48.858844492141145]}, "IncludeCountries": ["FRA"]}' \ --additional-features "Core"

開発者向けのヒント

Filter.IncludeCountries や などのフィルターを Filter.BoundingBoxとともに使用しますBiasPosition。これらのフィルターは、可能な結果を絞り込み、精度を向上させるのに役立ちます。

{ "QueryText": "Effel tow", "BiasPosition": [2.2982750966095398, 48.856078089325294], "Filter": {"IncludeCountries": ["FRA"]} }