public static class CloudSearch.Query
extends java.lang.Object
implements java.lang.Cloneable
| 构造器和说明 |
|---|
Query(java.lang.String tableid,
java.lang.String query,
CloudSearch.SearchBound bound)
根据给定的参数构造一个 CloudSearch.Query 的新对象
Construct a new CloudSearch.Query object based on the given parameters. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addFilterNum(java.lang.String key,
java.lang.String value1,
java.lang.String value2)
已过时。
使用
addFilterString(String, String) 替换
Replace using addFilterString(String, String) |
void |
addFilterString(java.lang.String key,
java.lang.String value)
添加筛选条件
Add filtering criteria. |
CloudSearch.Query |
clone() |
boolean |
equals(java.lang.Object query)
比较两个查询条件是否相同(包括查询第几页)
Compare if two query conditions are the same (including the query page). |
CloudSearch.SearchBound |
getBound()
返回查询的范围(本地、圆形、矩形或者多边形)
Return the query scope (local, circular, rectangular, or polygonal). |
java.lang.String |
getFilterNumString()
已过时。
使用
addFilterString(String, String)替换
Replace using addFilterString(String, String) |
java.lang.String |
getFilterString()
将筛选字段转换为字符串返回
Convert the filter field to a string and return. |
int |
getPageNum()
返回设置查询的是第几页,从0开始
Returns the page number of the query, starting from 0. |
int |
getPageSize()
返回查询每页的结果数目
Return the number of results per query page. |
java.lang.String |
getQueryString()
返回搜索的关键词
Returns the search keywords. |
CloudSearch.Sortingrules |
getSortingrules()
返回排序规则
Return the sorting rule. |
java.lang.String |
getTableID()
返回搜索的表tableid
Returns the tableid of the search. |
int |
hashCode() |
boolean |
queryEquals(CloudSearch.Query query)
比较两个查询条件是否相同(不包括查询第几页)
Compare if two query conditions are the same (excluding the query page). |
void |
setBound(CloudSearch.SearchBound bnd)
设置查询的范围(本地、圆形、矩形或者多边形)
Set the query scope (local, circular, rectangular, or polygonal). |
void |
setPageNum(int pageNum)
设置查询第几页的结果数目
Set the number of results for the query page. |
void |
setPageSize(int size) |
void |
setSortingrules(CloudSearch.Sortingrules sortingrules)
设置排序规则
Set the sorting rule. |
void |
setTableID(java.lang.String tableID)
设置搜索的表tableid
Set the tableid for the search. |
public Query(java.lang.String tableid,
java.lang.String query,
CloudSearch.SearchBound bound)
throws AMapException
参数中:tableid和bound必填,query可选。
In the parameters: tableid and bound are mandatory, query is optional.
如果tableid和bound为空,则抛出IllegalArgumentException 异常。
If tableid and bound are empty, an IllegalArgumentException will be thrown.
如果查询范围不是圆形,则没有距离排序;如果查询范围是圆形,有关键字时默认为权重降序排列,无关键字时默认为距离升序排列。
If the search range is not circular, there is no distance sorting; if the search range is circular, with keywords, it defaults to weight descending order; without keywords, it defaults to distance ascending order.
tableid - 必填,数据表的唯一标示。
query -
1. 支持关键字检索,即对建立过索引的字段进行检索;如keywords=工商银行,检索返回已建立文本索引列值中包含“工商”或者“银行”或者“工商银行”关键字的POI结果集。
2.支持关键字多值检索;(只支持建立过文本索引的字段查询)如keywords=招商银行&&华夏银行&&工商银行,检索返回已建立索引列值中包含“招商银行”且“华夏银行”且“工商银行”的POI结果集,不会返回检索词切分后,如仅包含“招商”或者“银行”的POI集;。
1. Supports keyword search, i.e., searching fields that have been indexed; for example, keywords=ICBC, the search returns a POI result set that contains 'ICBC' or 'Bank' or 'ICBC Bank' in the indexed column values.
2. Supports multi-value keyword search; (only for fields with text index) for example, keywords=CMB&&HXB&&ICBC, the search returns a POI result set that contains 'CMB' and 'HXB' and 'ICBC' in the indexed column values, and will not return POI sets that only contain 'CMB' or 'Bank' after splitting the search terms.
bound - 查询的城市或范围(支持圆形、多边形)。
AMapException - 如果为空或者bounds为空时会抛出 AMapException.AMAP_CLIENT_INVALID_PARAMETER
AMapException.AMAP_CLIENT_INVALID_PARAMETER will be thrown.public java.lang.String getQueryString()
public void setTableID(java.lang.String tableID)
tableID - 数据表的唯一标示。
public java.lang.String getTableID()
public int getPageNum()
public void setPageNum(int pageNum)
pageNum - 查询第几页的结果,从0开始。自 5.2.1后修改成从1开始,和iOS保持一致。
public void setPageSize(int size)
size - 每页结果数
public int getPageSize()
public void setBound(CloudSearch.SearchBound bnd)
bnd - 新的查询范围(本地、圆形、矩形或者多边形)。
public CloudSearch.SearchBound getBound()
public void addFilterString(java.lang.String key,
java.lang.String value)
1:支持建立索引的字段根据多个条件筛选,多个条件用&&符号连接。
2:判断符合支持
>= 大于等于
<= 小于等于
>大于
<小于
= 精确匹配(text索引不可用)
示例规则:key1=value1&&key2=value2&&lastloctime>=1469817532
示例:"name=王师傅|张师傅&&lastloctime>=1469817532
1: Supports filtering indexed fields based on multiple conditions, connected by &&.
2: Supported judgments include
>= greater than or equal to
<= less than or equal to
> greater than
< less than
= exact match (text index not available)
Example rule: key1=value1&&key2=value2&&lastloctime>=1469817532
Example: "name=Master Wang|Master Zhang&&lastloctime>=1469817532
key - 文字筛选条件精确匹配的键。
value - 键对应的文字。
public java.lang.String getFilterString()
public void addFilterNum(java.lang.String key,
java.lang.String value1,
java.lang.String value2)
addFilterString(String, String) 替换
addFilterString(String, String)key - 数值筛选条件的键。
value1 - 键对应的数值连续区间的开始数值。
value2 - 键对应的数值连续区间的结束数值。
public java.lang.String getFilterNumString()
addFilterString(String, String)替换
addFilterString(String, String)public void setSortingrules(CloudSearch.Sortingrules sortingrules)
sortingrules - 排序规则。
public CloudSearch.Sortingrules getSortingrules()
public boolean queryEquals(CloudSearch.Query query)
query - 查询条件
public int hashCode()
hashCode 在类中 java.lang.Objectpublic boolean equals(java.lang.Object query)
equals 在类中 java.lang.Objectquery - 查询条件
public CloudSearch.Query clone()
clone 在类中 java.lang.Object