We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

TextSearchRequest

Expand

Class Info

public class TextSearchRequest

Represents a request object used to search for places by keyword.

Public Constructor Summary

Expand

Constructor Name

TextSearchRequest()

Default constructor.

Public Method Summary

Expand

Qualifier and Type

Method Name and Description

String

getCountryCode()

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

HwLocationType

getHwPoiType()

Obtains the Huawei POI type of a place.

String

getLanguage()

Obtains the language for displaying the keyword search results.

Coordinate

getLocation()

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

Integer

getPageIndex()

Obtains the number of the current page.

Integer

getPageSize()

Obtains the number of records on each page.

LocationType

getPoiType()

Obtains the POI type of a place.

String

getPoliticalView()

Obtains the political view.

NOTICE

This method has been deprecated.

String

getQuery()

Obtains the search keyword.

Integer

getRadius()

Obtains the search radius.

List<String>

getCountries()

Obtains multiple country or region codes that are set.

boolean

isChildren()

Checks whether to return information about child nodes.

void

setChildren(boolean children)

Sets whether to return information about child nodes.

void

setCountryCode(String countryCode)

Sets the country/region code for place search.

void

setHwPoiType(HwLocationType hwPoiType)

Sets the Huawei POI type of a place.

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

setPageIndex(Integer pageIndex)

Sets the number of the current page.

void

setPageSize(Integer pageSize)

Sets the number of records on each page.

void

setPoiType(LocationType poiType)

Sets the POI type of a place.

void

setPoliticalView(String politicalView)

Sets the political view.

NOTICE

This method has been deprecated.

void

setQuery(String query)

Sets the search keyword.

void

setRadius(Integer radius)

Sets the search radius.

void

setCountries(List<String> countries)

Sets multiple country or region codes.

Public Methods

getCountryCode

Expand

Method

public String getCountryCode()

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

Returns

Expand

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.

getHwPoiType

Expand

Method

public HwLocationType getHwPoiType()

Obtains the Huawei POI type of a place.

Returns

Expand

Type

Description

HwLocationType

Huawei POI type.

getLanguage

Expand

Method

public String getLanguage()

Obtains the language for displaying the keyword search results.

Returns

Expand

Type

Description

String

Language for displaying the keyword search results.

getLocation

Expand

Method

public Coordinate getLocation()

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

Returns

Expand

Type

Description

Coordinate

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

getPageIndex

Expand

Method

public Integer getPageIndex()

Obtains the number of the current page.

Returns

Expand

Type

Description

Integer

Number of the current page.

getPageSize

Expand

Method

public Integer getPageSize()

Obtains the number of records on each page.

Returns

Expand

Type

Description

Integer

Number of records on each page.

getPoiType

Expand

Method

public LocationType getPoiType()

Obtains the POI type of a place.

Returns

Expand

Type

Description

LocationType

POI type.

getPoliticalView

NOTICE

This method has been deprecated.

Expand

Method

public String getPoliticalView()

Obtains the political view.

Returns

Expand

Type

Description

String

Political view.

getQuery

Expand

Method

public String getQuery()

Obtains the search keyword.

Returns

Expand

Type

Description

String

Search keyword.

getRadius

Expand

Method

public Integer getRadius()

Obtains the search radius.

Returns

Expand

Type

Description

Integer

Search radius, in meters.

getCountries

Expand

Method

public List<String> getCountries()

Obtains multiple country or region codes that are set.

Returns

Expand

Type

Description

List<String>

List of country or region codes.

isChildren

Expand

Method

public boolean isChildren()

Checks whether to return information about child nodes.

Returns

Expand

Type

Description

boolean

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

The default value is false.

setChildren

Expand

Method

public void setChildren(boolean children)

Sets whether to return information about child nodes.

Parameters

Expand

Name

Description

children

Indicates whether to return information about child nodes.

  • true: Returns full information about child nodes.
  • false: Returns no information about child nodes.

The default value is false.

setCountryCode

Expand

Method

public void setCountryCode(String countryCode)

Sets the country/region code for place search.

Parameters

Expand

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.

setHwPoiType

Expand

Method

public void setHwPoiType(HwLocationType hwPoiType)

Sets the Huawei POI type of a place.

Parameters

Expand

Name

Description

hwPoiType

Huawei POI type. This parameter is recommended.

NOTE

If both hwPoiType and poiType are set, search results of hwPoiType take precedence.

setLanguage

Expand

Method

public void setLanguage(String language)

Sets the language for displaying the search results.

Parameters

Expand

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.

setLocation

Expand

Method

public void setLocation(Coordinate location)

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

Parameters

Expand

Name

Description

location

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

setPageIndex

Expand

Method

public void setPageIndex(Integer pageIndex)

Sets the number of the current page.

Parameters

Expand

Name

Description

pageIndex

Number of the current page. The value ranges from 1 to 60. The default value is 1.

NOTE

The following formula must be met: pageIndex x pageSize ≤ 60.

setPageSize

Expand

Method

public void setPageSize(Integer pageSize)

Sets the number of records on each page.

Parameters

Expand

Name

Description

pageSize

Number of records on each page. The value ranges from 1 to 20. The default value is 20.

NOTE

The following formula must be met: pageIndex x pageSize ≤ 60.

setPoiType

Expand

Method

public void setPoiType(LocationType poiType)

Sets the POI type of a place.

Parameters

Expand

Name

Description

poiType

POI type.

NOTE

Huawei POI types are recommended.

setPoliticalView

NOTICE

This method has been deprecated.

Expand

Method

public void setPoliticalView(String politicalView)

Sets the political view.

Parameters

Expand

Name

Description

politicalView

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

setQuery

Expand

Method

public void setQuery(String query)

Sets the search keyword.

Parameters

Expand

Name

Description

query

Search keyword. This parameter is mandatory.

setRadius

Expand

Method

public void setRadius(Integer radius)

Sets the search radius.

Parameters

Expand

Name

Description

radius

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

setCountries

Expand

Method

public void setCountries(List<String> countries)

Sets multiple country or region codes.

Parameters

Expand

Name

Description

countries

List of country or region codes.

Search in References
Enter a keyword.