

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 如何帮助用户消除相似结果之间的歧义
<a name="suggest-disambiguate-results"></a>

通过建议 API，您可以针对地点或结果类别创建查询。结果按照匹配可能性从高到低进行排序。每个结果都会提供相关信息，可帮助您快速确定正确的匹配项，尤其是在“标题”和“标签”字段方面。

## 潜在使用案例
<a name="suggest-disambiguate-results-potential-use"></a>
+ **显示结果选项：**您可以选择最符合自己需求的选项。

## 示例
<a name="suggest-disambiguate-results-examples"></a>

“标题”字段的信息通常足以让您了解结果何时达到预期效果。对于标题未提供足够信息的情况，“标签”字段用于为结果添加地址信息上下文。“标签”字段可作为额外信息提供，当为您呈现结果时，正文中不会强调该字段。下面的示例中提供了两个相似的结果，酒店的地址可帮助您选择更适合您需求的结果。此外，还提供了位置，以便在地图上呈现结果，作为您在结果之间进行选择的另一种方式。

### 使用建议 API 消除结果的歧义
<a name="suggest-disambiguate-results-examples"></a>

------
#### [ 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"
```

------