目录

TextSearchRequest

Class Info

public class TextSearchRequest

基于关键字搜索的请求对象。

Public Constructor Summary

Constructor Name

TextSearchRequest()

默认的构造方法。

Public Method Summary

Qualifier and Type

Method Name and Description

String

getCountryCode()

获取地点的国家/地区码。

HwLocationType

getHwPoiType()

获取返回地点的华为POI类型。

String

getLanguage()

获取用于关键字搜索结果的语种。

Coordinate

getLocation()

获取搜索结果偏向的经纬度。

Integer

getPageIndex()

获取当前页数。

Integer

getPageSize()

获取每页的记录数。

LocationType

getPoiType()

获取返回地点的POI类型。

String

getPoliticalView()

获取政治观点。

注意:

该接口已废弃。

String

getQuery()

获取搜索关键字。

Integer

getRadius()

获取搜索半径。

List<String>

getCountries()

获取当前设置的多个国家码。

boolean

isChildren()

判断是否查询子节点。

void

setChildren(boolean children)

设置是否返回子节点。

void

setCountryCode(String countryCode)

设置地点的国家/地区码。

void

setHwPoiType(HwLocationType hwPoiType)

设置返回地点的华为POI类型。

void

setLanguage(String language)

设置搜索结果返回的语言。

void

setLocation(Coordinate location)

设置搜索结果偏向的经纬度。

void

setPageIndex(Integer pageIndex)

设置当前页数。

void

setPageSize(Integer pageSize)

设置每页的记录数。

void

setPoiType(LocationType poiType)

设置返回地点的POI类型。

void

setPoliticalView(String politicalView)

设置政治观点。

注意:

该接口已废弃。

void

setQuery(String query)

设置搜索关键字。

void

setRadius(Integer radius)

设置搜索半径。

void

setCountries(List<String> countries)

设置多个国家码。

Public Methods

[h2]getCountryCode

Method

public String getCountryCode()

您调用此API可以获取地点的国家/地区码。

Returns

Type

Description

String

国家/地区码,在指定的国家内搜索,采用ISO 3166-1 alpha-2。

[h2]getHwPoiType

Method

public HwLocationType getHwPoiType()

您调用此API可以获取返回地点的华为POI类型。

Returns

Type

Description

HwLocationType

地点的华为POI类型。

[h2]getLanguage

Method

public String getLanguage()

您调用此API可以获取用于关键字搜索结果的语种。

Returns

Type

Description

String

用于关键字搜索结果的语种。

[h2]getLocation

Method

public Coordinate getLocation()

您调用此API可以获取搜索结果偏向的经纬度。

Returns

Type

Description

Coordinate

搜索结果偏向的经纬度。

[h2]getPageIndex

Method

public Integer getPageIndex()

您调用此API可以获取当前页数。

Returns

Type

Description

Integer

当前页数。

[h2]getPageSize

Method

public Integer getPageSize()

您调用此API可以获取每页的记录数。

Returns

Type

Description

Integer

每页的记录数。

[h2]getPoiType

Method

public LocationType getPoiType()

您调用此API可以获取返回地点的POI类型。

Returns

Type

Description

LocationType

地点的POI类型。

[h2]getPoliticalView

该接口已废弃。

Method

public String getPoliticalView()

您调用此API可以获取政治观点。

Returns

Type

Description

String

政治观点。

[h2]getQuery

Method

public String getQuery()

您调用此API可以获取搜索关键字。

Returns

Type

Description

String

搜索关键字。

[h2]getRadius

Method

public Integer getRadius()

您调用此API可以获取搜索半径。

Returns

Type

Description

Integer

搜索半径,单位:米。

[h2]getCountries

Method

public List<String> getCountries()

您调用此API可以获取当前设置的多个国家码。

Returns

Type

Description

List<String>

国家码列表。

[h2]isChildren

Method

public boolean isChildren()

您调用此API判断是否查询子节点。

Returns

Type

Description

boolean

  • true:返回子节点。
  • false:不返回子节点。

默认值为false。

[h2]setChildren

Method

public void setChildren(boolean children)

您调用此API可以设置是否返回子节点。

Parameters

Name

Description

children

是否返回子节点。

  • true:返回子节点的全量信息。
  • false:不返回子节点。

默认值为false。

[h2]setCountryCode

Method

public void setCountryCode(String countryCode)

您调用此API可以设置地点的国家/地区码。

Parameters

Name

Description

countryCode

国家/地区码,在指定的国家内搜索,采用ISO 3166-1 alpha-2。

[h2]setHwPoiType

Method

public void setHwPoiType(HwLocationType hwPoiType)

您调用此API可以设置返回地点的华为POI类型。

Parameters

Name

Description

hwPoiType

华为POI类型,推荐使用该类型。

说明:

如果同时设置了hwPoiType和poiType,搜索结果优先符合hwPoiType。

[h2]setLanguage

Method

public void setLanguage(String language)

您调用此API可以设置搜索结果返回的语言。

Parameters

Name

Description

language

搜索结果返回的语言,取值范围参见支持的语言的语种代码。如果不传,返回地点的当地语言。

[h2]setLocation

Method

public void setLocation(Coordinate location)

您调用此API可以设置搜索结果偏向的经纬度。

Parameters

Name

Description

location

搜索结果偏向的经纬度。

[h2]setPageIndex

Method

public void setPageIndex(Integer pageIndex)

您调用此API可以设置当前页数。

Parameters

Name

Description

pageIndex

当前页数。取值范围:[1, 60],默认1。

说明:

pageIndex * pageSize<=60

[h2]setPageSize

Method

public void setPageSize(Integer pageSize)

您调用此API可以设置每页的记录数。

Parameters

Name

Description

pageSize

每页的记录数。取值范围:[1, 20],默认20。

说明:

pageIndex * pageSize<=60

[h2]setPoiType

Method

public void setPoiType(LocationType poiType)

您调用此API可以设置返回地点的POI类型。

Parameters

Name

Description

poiType

POI类型。

说明:

推荐使用华为POI类型。

[h2]setPoliticalView

该接口已废弃。

Method

public void setPoliticalView(String politicalView)

您调用此API可以设置政治观点。

Parameters

Name

Description

politicalView

政治观点,采用ISO 3166-1-alpha-2规范的2位国家/地区码。

[h2]setQuery

Method

public void setQuery(String query)

您调用此API可以设置搜索关键字。

Parameters

Name

Description

query

搜索关键字,query为必选参数。

[h2]setRadius

Method

public void setRadius(Integer radius)

您调用此API可以设置搜索半径。

Parameters

Name

Description

radius

搜索半径,单位:米。取值范围:[1, 50000],默认50000米。

[h2]setCountries

Method

public void setCountries(List<String> countries)

您调用此API可以设置多个国家码。

Parameters

Name

Description

countries

国家码列表。