search_place_index_for_suggestions
¶
search_place_index_for_suggestions(
index_name: ResourceName,
text: SensitiveString,
*,
config_overrides: Optional[LocationClientConfig] = None,
bias_position: Optional[Position] = None,
filter_b_box: Optional[BoundingBox] = None,
filter_countries: Optional[CountryCodeList] = None,
max_results: Optional[int] = None,
language: Optional[LanguageTag] = None,
filter_categories: Optional[FilterPlaceCategoryList] = None,
key: Optional[ApiKey] = None,
) -> SearchPlaceIndexForSuggestionsResponse
This operation is no longer current and may be deprecated in the future. We recommend you upgrade to The version 2 If you are using an Amazon Web Services SDK or the Amazon Web Services CLI, note that the Places API version 2 is found under Since Grab is not yet fully supported in Places API version 2, we recommend you continue using API version 1 when using Grab.Suggest or Autocomplete unless you require Grab data.
SearchPlaceIndexForSuggestions is part of a previous Amazon Location Service Places API (version 1) which has been superseded by a more intuitive, powerful, and complete API (version 2).Suggest operation gives better results for typeahead place search suggestions with fuzzy matching, while the version 2 Autocomplete operation gives better results for address completion based on partial input.geo-places or geo_places, not under location.
Generates suggestions for addresses and points of interest based on partial or misspelled free-form text. This operation is also known as autocomplete, autosuggest, or fuzzy matching.
Optional parameters let you narrow your search results by bounding box or country, or bias your search toward a specific position on the globe.
You can search for suggested place names near a specified position by using BiasPosition, or filter results within a bounding box by using FilterBBox. These parameters are mutually exclusive; using both BiasPosition and FilterBBox in the same command returns an error.
Parameters:
-
index_name(ResourceName) –The name of the place index resource you want to use for the search.
-
text(SensitiveString) –The free-form partial text to use to generate place suggestions. For example,
eiffel tow. -
bias_position(Optional[Position], default:None) –An optional parameter that indicates a preference for place suggestions that are closer to a specified position.
If provided, this parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude; the second number represents the Y coordinate, or latitude.
For example,
[-123.1174, 49.2847]represents the position with longitude-123.1174and latitude49.2847.BiasPositionandFilterBBoxare mutually exclusive. Specifying both options results in an error. -
filter_b_box(Optional[BoundingBox], default:None) –An optional parameter that limits the search results by returning only suggestions within a specified bounding box.
If provided, this parameter must contain a total of four consecutive numbers in two pairs. The first pair of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the southwest corner of the bounding box; the second pair of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the northeast corner of the bounding box.
For example,
[-12.7935, -37.4835, -12.0684, -36.9542]represents a bounding box where the southwest corner has longitude-12.7935and latitude-37.4835, and the northeast corner has longitude-12.0684and latitude-36.9542.FilterBBoxandBiasPositionare mutually exclusive. Specifying both options results in an error. -
filter_countries(Optional[CountryCodeList], default:None) –An optional parameter that limits the search results by returning only suggestions within the provided list of countries.
-
Use the ISO 3166 3-digit country code. For example, Australia uses three upper-case characters:
AUS.
-
-
max_results(Optional[int], default:None) –An optional parameter. The maximum number of results returned per request.
The default:
5 -
language(Optional[LanguageTag], default:None) –The preferred language used to return results. The value must be a valid BCP 47 language tag, for example,
enfor English.This setting affects the languages used in the results. If no language is specified, or not supported for a particular result, the partner automatically chooses a language for the result.
For an example, we'll use the Greek language. You search for
Athens, Grto get suggestions with thelanguageparameter set toen. The results found will most likely be returned asAthens, Greece.If you set the
languageparameter toel, for Greek, then the result found will more likely be returned asΑθήνα, Ελλάδα.If the data provider does not have a value for Greek, the result will be in a language that the provider does support.
-
filter_categories(Optional[FilterPlaceCategoryList], default:None) –A list of one or more Amazon Location categories to filter the returned places. If you include more than one category, the results will include results that match any of the categories listed.
For more information about using categories, including a list of Amazon Location categories, see Categories and filtering, in the Amazon Location Service developer guide.
-
key(Optional[ApiKey], default:None) –The optional API key to authorize the request.
Raises:
-
AccessDeniedException–The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.
-
InternalServerException–The request has failed to process because of an unknown server error, exception, or failure.
-
ResourceNotFoundException–The resource that you've entered was not found in your AWS account.
-
ThrottlingException–The request was denied because of request throttling.
-
ValidationException–The input failed to meet the constraints specified by the AWS service.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_location/_services/location.py
3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 | |