search_place_index_for_text
¶
search_place_index_for_text(
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[PlaceIndexSearchResultLimit] = None,
language: Optional[LanguageTag] = None,
filter_categories: Optional[FilterPlaceCategoryList] = None,
key: Optional[ApiKey] = None,
) -> SearchPlaceIndexForTextResponse
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.Geocode or SearchText unless you require Grab data.
SearchPlaceIndexForText 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).Geocode operation gives better results in the address geocoding use case, while the version 2 SearchText operation gives better results when searching for businesses and points of interest.geo-places or geo_places, not under location.
Geocodes free-form text, such as an address, name, city, or region to allow you to search for Places or points of interest.
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 places near a given position using BiasPosition, or filter results within a bounding box using FilterBBox. Providing both parameters simultaneously returns an error.
Search results are returned in order of highest to lowest relevance.
Parameters:
-
index_name(ResourceName) –The name of the place index resource you want to use for the search.
-
text(SensitiveString) –The address, name, city, or region to be used in the search in free-form text format. For example,
123 Any Street. -
bias_position(Optional[Position], default:None) –An optional parameter that indicates a preference for places 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 places that are within the provided 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 places that are in a specified list of countries.
-
Valid values include ISO 3166 3-digit country codes. For example, Australia uses three upper-case characters:
AUS.
-
-
max_results(Optional[PlaceIndexSearchResultLimit], default:None) –An optional parameter. The maximum number of results returned per request.
The default:
50 -
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, but not the results themselves. 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, Greece, with thelanguageparameter set toen. The result found will most likely be returned asAthens.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
3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 | |