amazonka-location-2.0: Amazon Location Service SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.Location.SearchPlaceIndexForText

Description

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.

Synopsis

Creating a Request

data SearchPlaceIndexForText Source #

See: newSearchPlaceIndexForText smart constructor.

Constructors

SearchPlaceIndexForText' 

Fields

  • biasPosition :: Maybe (Sensitive (NonEmpty Double))

    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.1174 and latitude 49.2847.

    BiasPosition and FilterBBox are mutually exclusive. Specifying both options results in an error.

  • filterBBox :: Maybe (Sensitive (NonEmpty Double))

    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.7935 and latitude -37.4835, and the northeast corner has longitude -12.0684 and latitude -36.9542.

    FilterBBox and BiasPosition are mutually exclusive. Specifying both options results in an error.

  • filterCountries :: Maybe (NonEmpty Text)

    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.
  • language :: Maybe Text

    The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en for 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 the language parameter set to en. The result found will most likely be returned as Athens.

    If you set the language parameter to el, 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.

  • maxResults :: Maybe Natural

    An optional parameter. The maximum number of results returned per request.

    The default: 50

  • indexName :: Text

    The name of the place index resource you want to use for the search.

  • text :: Sensitive Text

    The address, name, city, or region to be used in the search in free-form text format. For example, 123 Any Street.

Instances

Instances details
ToJSON SearchPlaceIndexForText Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

ToHeaders SearchPlaceIndexForText Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

ToPath SearchPlaceIndexForText Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

ToQuery SearchPlaceIndexForText Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

AWSRequest SearchPlaceIndexForText Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

Generic SearchPlaceIndexForText Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

Associated Types

type Rep SearchPlaceIndexForText :: Type -> Type #

Show SearchPlaceIndexForText Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

NFData SearchPlaceIndexForText Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

Methods

rnf :: SearchPlaceIndexForText -> () #

Eq SearchPlaceIndexForText Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

Hashable SearchPlaceIndexForText Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

type AWSResponse SearchPlaceIndexForText Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

type Rep SearchPlaceIndexForText Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

newSearchPlaceIndexForText Source #

Create a value of SearchPlaceIndexForText with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

SearchPlaceIndexForText, searchPlaceIndexForText_biasPosition - 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.1174 and latitude 49.2847.

BiasPosition and FilterBBox are mutually exclusive. Specifying both options results in an error.

SearchPlaceIndexForText, searchPlaceIndexForText_filterBBox - 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.7935 and latitude -37.4835, and the northeast corner has longitude -12.0684 and latitude -36.9542.

FilterBBox and BiasPosition are mutually exclusive. Specifying both options results in an error.

SearchPlaceIndexForText, searchPlaceIndexForText_filterCountries - 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.

SearchPlaceIndexForText, searchPlaceIndexForText_language - The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en for 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 the language parameter set to en. The result found will most likely be returned as Athens.

If you set the language parameter to el, 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.

SearchPlaceIndexForText, searchPlaceIndexForText_maxResults - An optional parameter. The maximum number of results returned per request.

The default: 50

SearchPlaceIndexForText, searchPlaceIndexForText_indexName - The name of the place index resource you want to use for the search.

SearchPlaceIndexForText, searchPlaceIndexForText_text - The address, name, city, or region to be used in the search in free-form text format. For example, 123 Any Street.

Request Lenses

searchPlaceIndexForText_biasPosition :: Lens' SearchPlaceIndexForText (Maybe (NonEmpty Double)) Source #

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.1174 and latitude 49.2847.

BiasPosition and FilterBBox are mutually exclusive. Specifying both options results in an error.

searchPlaceIndexForText_filterBBox :: Lens' SearchPlaceIndexForText (Maybe (NonEmpty Double)) Source #

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.7935 and latitude -37.4835, and the northeast corner has longitude -12.0684 and latitude -36.9542.

FilterBBox and BiasPosition are mutually exclusive. Specifying both options results in an error.

searchPlaceIndexForText_filterCountries :: Lens' SearchPlaceIndexForText (Maybe (NonEmpty Text)) Source #

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.

searchPlaceIndexForText_language :: Lens' SearchPlaceIndexForText (Maybe Text) Source #

The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en for 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 the language parameter set to en. The result found will most likely be returned as Athens.

If you set the language parameter to el, 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.

searchPlaceIndexForText_maxResults :: Lens' SearchPlaceIndexForText (Maybe Natural) Source #

An optional parameter. The maximum number of results returned per request.

The default: 50

searchPlaceIndexForText_indexName :: Lens' SearchPlaceIndexForText Text Source #

The name of the place index resource you want to use for the search.

searchPlaceIndexForText_text :: Lens' SearchPlaceIndexForText Text Source #

The address, name, city, or region to be used in the search in free-form text format. For example, 123 Any Street.

Destructuring the Response

data SearchPlaceIndexForTextResponse Source #

See: newSearchPlaceIndexForTextResponse smart constructor.

Constructors

SearchPlaceIndexForTextResponse' 

Fields

  • httpStatus :: Int

    The response's http status code.

  • results :: [SearchForTextResult]

    A list of Places matching the input text. Each result contains additional information about the specific point of interest.

    Not all response properties are included with all responses. Some properties may only be returned by specific data partners.

  • summary :: SearchPlaceIndexForTextSummary

    Contains a summary of the request. Echoes the input values for BiasPosition, FilterBBox, FilterCountries, Language, MaxResults, and Text. Also includes the DataSource of the place index and the bounding box, ResultBBox, which surrounds the search results.

Instances

Instances details
Generic SearchPlaceIndexForTextResponse Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

Associated Types

type Rep SearchPlaceIndexForTextResponse :: Type -> Type #

Show SearchPlaceIndexForTextResponse Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

NFData SearchPlaceIndexForTextResponse Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

Eq SearchPlaceIndexForTextResponse Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

type Rep SearchPlaceIndexForTextResponse Source # 
Instance details

Defined in Amazonka.Location.SearchPlaceIndexForText

type Rep SearchPlaceIndexForTextResponse = D1 ('MetaData "SearchPlaceIndexForTextResponse" "Amazonka.Location.SearchPlaceIndexForText" "amazonka-location-2.0-4NLaYgEbMXwF6j2j7LAFNb" 'False) (C1 ('MetaCons "SearchPlaceIndexForTextResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "results") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [SearchForTextResult]) :*: S1 ('MetaSel ('Just "summary") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SearchPlaceIndexForTextSummary))))

newSearchPlaceIndexForTextResponse Source #

Create a value of SearchPlaceIndexForTextResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:httpStatus:SearchPlaceIndexForTextResponse', searchPlaceIndexForTextResponse_httpStatus - The response's http status code.

$sel:results:SearchPlaceIndexForTextResponse', searchPlaceIndexForTextResponse_results - A list of Places matching the input text. Each result contains additional information about the specific point of interest.

Not all response properties are included with all responses. Some properties may only be returned by specific data partners.

$sel:summary:SearchPlaceIndexForTextResponse', searchPlaceIndexForTextResponse_summary - Contains a summary of the request. Echoes the input values for BiasPosition, FilterBBox, FilterCountries, Language, MaxResults, and Text. Also includes the DataSource of the place index and the bounding box, ResultBBox, which surrounds the search results.

Response Lenses

searchPlaceIndexForTextResponse_results :: Lens' SearchPlaceIndexForTextResponse [SearchForTextResult] Source #

A list of Places matching the input text. Each result contains additional information about the specific point of interest.

Not all response properties are included with all responses. Some properties may only be returned by specific data partners.

searchPlaceIndexForTextResponse_summary :: Lens' SearchPlaceIndexForTextResponse SearchPlaceIndexForTextSummary Source #

Contains a summary of the request. Echoes the input values for BiasPosition, FilterBBox, FilterCountries, Language, MaxResults, and Text. Also includes the DataSource of the place index and the bounding box, ResultBBox, which surrounds the search results.