ユーザーが同様の結果のあいまいさを解消する方法
Suggest API を使用すると、結果の場所またはカテゴリのクエリを作成できます。結果は、一致する可能性が高い方から低い方にソートされます。各結果の情報が提供されるため、特に [タイトル] フィールドと [ラベル] フィールドに関して、正しい一致をすばやく特定できます。
想定されるユースケース
-
結果オプションを表示する: ニーズに最適なオプションを選択できます。
例
[タイトル] フィールドは通常、結果が意図したものであるタイミングを理解するのに十分な情報です。タイトルに十分な情報がない場合、[ラベル] フィールドを使用してアドレス情報コンテキストを結果に追加します。[ラベル] フィールドは 2 行目の情報として提供でき、結果がレンダリングされたときにメインテキストから強調解除されます。以下の例では、2 つの同様の結果が提供されており、ホテルの住所がニーズにより適したものを選択するのに役立ちます。さらに、結果間の選択の代替方法として、マップで結果をレンダリングできるように位置が提供されます。
- Sample request
-
{ "QueryText": "Marriott", "Filter": { "IncludeCountries": [ "USA" ], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763 ] }, "AdditionalFeatures": [ "Core" ] } - Sample response
-
{ "ResultItems": [ { "Title": "Marriott-Boston Cambridge", "SuggestResultItemType": "Place", "Place": { "PlaceId": "Redacted", "PlaceType": "PointOfInterest", "Address": { "Label": "Marriott-Boston Cambridge, 50 Broadway, Cambridge, MA 02138-4137, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "MA", "Name": "Massachusetts" }, "SubRegion": { "Name": "Middlesex" }, "Locality": "Cambridge", "District": "MIT", "PostalCode": "02138-4137", "Street": "Broadway", "StreetComponents": [ { "BaseName": "Broadway", "Language": "en" } ], "AddressNumber": "50" }, "Position": [ -71.0858, 42.36294 ], "Distance": 5212, ... }, { "Title": "Marriott-Boston Copley Place", "SuggestResultItemType": "Place", "Place": { "PlaceId": "Redacted", "PlaceType": "PointOfInterest", "Address": { "Label": "Marriott-Boston Copley Place, 110 Huntington Ave, Boston, MA 02116-5706, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "MA", "Name": "Massachusetts" }, "SubRegion": { "Name": "Suffolk" }, "Locality": "Boston", "District": "Back Bay", "PostalCode": "02116-5706", "Street": "Huntington Ave", "StreetComponents": [ { "BaseName": "Huntington", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "110" }, "Position": [ -71.0792, 42.34701 ], "Distance": 3362, ... }, ... ], "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": "Marriott", "Filter": { "IncludeCountries": [ "USA" ], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763 ] }, "AdditionalFeatures": [ "Core" ] }' - AWS CLI
-
aws geo-places suggest --key ${YourKey} \ --query-text "Marriott" \ --filter '{"IncludeCountries": ["USA"], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763]}' \ --additional-features "Core"
リージョンの結果をフィルタリングする
コストと使用状況を管理する