目录

QuerySuggestionRequest

Class Info

public class QuerySuggestionRequest

Represents a search suggestion request object.

Public Constructor Summary

Constructor Name

QuerySuggestionRequest()

Default constructor.

Public Method Summary

Qualifier and Type

Method Name and Description

CoordinateBounds

getBounds()

Obtains the coordinate bounds to which search results need to be biased.

String

getCountryCode()

Obtains the code of the country/region to which a place belongs.

String

getLanguage()

Obtains the language for displaying the place search suggestions.

Coordinate

getLocation()

Obtains the longitude and latitude to which search results need to be biased.

List<LocationType>

getPoiTypes()

Obtains a list of POI types.

String

getPoliticalView()

Obtains the political view.

CAUTION:

This method has been deprecated.

String

getQuery()

Obtains the search keyword.

Integer

getRadius()

Obtains the search radius.

boolean

isChildren()

Checks whether to return information about child nodes.

Boolean

getStrictBounds()

Checks whether place search is strictly restricted in the bounds specified by Bounds.

List<String>

getCountries()

Obtains multiple country or region codes that are set.

void

setChildren(boolean children)

Sets whether to return information about child nodes.

void

setBounds(CoordinateBounds bounds)

Sets the coordinate bounds to which search results need to be biased.

void

setCountryCode(String countryCode)

Sets a country/region code.

void

setLanguage(String language)

Sets the language for displaying the search results.

void

setLocation(Coordinate location)

Sets the longitude and latitude to which search results need to be biased.

void

setPoiTypes(List<LocationType> poiTypes)

Sets a list of POI types.

void

setPoliticalView(String politicalView)

Sets the political view.

CAUTION:

This method has been deprecated.

void

setQuery(String query)

Sets the search keyword.

void

setRadius(Integer radius)

Sets the search radius.

void

setStrictBounds(Boolean strictBounds)

Sets whether to strictly restrict place search in the bounds specified by Bounds.

void

setCountries(List<String> countries)

Sets multiple country or region codes.

Public Methods

[h2]getBounds

Method

public CoordinateBounds getBounds()

Obtains the coordinate bounds to which search results need to be biased.

Returns

Type

Description

CoordinateBounds

Coordinate bounds to which search results need to be biased.

[h2]getCountryCode

Method

public String getCountryCode()

Obtains the code of the country/region to which a place belongs.

Returns

Type

Description

String

Country/Region code, which complies with ISO 3166-1 alpha-2. This parameter is used to specify the country/region where places are searched.

[h2]getLanguage

Method

public String getLanguage()

Obtains the language for displaying the place search suggestions.

Returns

Type

Description

String

Language for displaying the place search suggestions.

[h2]getLocation

Method

public Coordinate getLocation()

Obtains the longitude and latitude to which search results need to be biased.

Returns

Type

Description

Coordinate

Longitude and latitude to which search results need to be biased.

[h2]getPoiTypes

Method

public List<LocationType> getPoiTypes()

Obtains a list of POI types.

Returns

Type

Description

List<LocationType>

List of POI types.

[h2]getPoliticalView

This method has been deprecated.

Method

public String getPoliticalView()

Obtains the political view.

Returns

Type

Description

String

Political view.

[h2]getQuery

Method

public String getQuery()

Obtains the search keyword.

Returns

Type

Description

String

Search keyword.

[h2]getRadius

Method

public Integer getRadius()

Obtains the search radius.

Returns

Type

Description

Integer

Search radius, in meters.

[h2]isChildren

Method

public boolean isChildren()

Checks whether to return information about child nodes.

Returns

Type

Description

boolean

true if information about child nodes is returned; false otherwise.

The default value is false.

[h2]getStrictBounds

Method

public Boolean getStrictBounds()

Checks whether place search is strictly restricted in the bounds specified by Bounds.

Returns

Type

Description

Boolean

Whether place search is strictly restricted in the bounds specified by Bounds.

[h2]getCountries

Method

public List<String> getCountries()

Obtains multiple country or region codes that are set.

Returns

Type

Description

List<String>

List of country or region codes.

[h2]setChildren

Method

public void setChildren(boolean children)

Sets whether to return information about child nodes.

Parameters

Name

Description

children

Indicates whether to return information about child nodes.

  • true: Returns siteId of child nodes.
  • false: Returns no information about child nodes.

The default value is false.

[h2]setBounds

Method

public void setBounds(CoordinateBounds bounds)

Sets the coordinate bounds to which search results need to be biased.

Parameters

Name

Description

bounds

Coordinate bounds to which search results need to be biased.

NOTE:

If both bounds and location are set, the value of bounds takes precedence.

[h2]setCountryCode

Method

public void setCountryCode(String countryCode)

Sets a country/region code.

Parameters

Name

Description

countryCode

Country/Region code, which complies with ISO 3166-1 alpha-2. This parameter is used to specify the country/region where places are searched.

[h2]setLanguage

Method

public void setLanguage(String language)

Sets the language for displaying the search results.

Parameters

Name

Description

language

Language for displaying the search results. For details, please refer to Supported Languages. If this parameter is not passed, the local language will be used.

[h2]setLocation

Method

public void setLocation(Coordinate location)

Sets the longitude and latitude to which search results need to be biased.

Parameters

Name

Description

location

Longitude and latitude to which search results need to be biased.

NOTE:

If both location and bounds are passed, the value of bounds takes precedence.

[h2]setPoiTypes

Method

public void setPoiTypes(List<LocationType> poiTypes)

Sets a list of POI types.

Parameters

Name

Description

poiTypes

List of POI types. The value range is a subset of LocationType, including:

  • GEOCODE
  • ADDRESS
  • ESTABLISHMENT
  • REGIONS
  • CITIES

[h2]setPoliticalView

This method has been deprecated.

Method

public void setPoliticalView(String politicalView)

Sets the political view.

Parameters

Name

Description

politicalView

Political view. The value is a two-letter country/region code complying with ISO 3166-1 alpha-2.

[h2]setQuery

Method

public void setQuery(String query)

Sets the search keyword.

Parameters

Name

Description

query

Search keyword. This parameter is mandatory.

[h2]setRadius

Method

public void setRadius(Integer radius)

Sets the search radius.

Parameters

Name

Description

radius

Search radius, in meters. The value ranges from 1 to 50,000. The default value is 50000.

[h2]setStrictBounds

Method

public void setStrictBounds(Boolean strictBounds)

Sets whether to strictly restrict place search in the bounds specified by Bounds.

Parameters

Name

Description

strictBounds

Indicates whether to strictly restrict place search in the bounds specified by Bounds. The default value is false.

[h2]setCountries

Method

public void setCountries(List<String> countries)

Sets multiple country or region codes.

Parameters

Name

Description

countries

List of country or region codes.