Modifier and Type | Field and Description |
---|---|
static String |
AVSEARCH_APP_URL |
static String |
AVSEARCH_DEEP_LINK |
static String |
AVSEARCH_HIGHTLIGHT |
static String |
DATA_EXTRA_SEARCH_KEY |
Constructor and Description |
---|
LCSearchQuery() |
LCSearchQuery(String queryString) |
LCSearchQuery(String queryString,
Class<T> clazz) |
Modifier and Type | Method and Description |
---|---|
LCSearchQuery |
addAscendingOrder(String key)
Also sorts the results in ascending order by the given key.
|
LCSearchQuery |
addDescendingOrder(String key)
Also sorts the results in descending order by the given key.
|
io.reactivex.Observable<List<T>> |
findInBackground()
execute query in background.
|
io.reactivex.Observable<List<T>> |
findInBackground(LCUser asAuthenticatedUser)
execute query in background.
|
String |
getClassName()
获取查询的className,默认为null,即包括所有启用了应用内搜索的class
|
List<String> |
getFields() |
String |
getHightLights()
获取当前设定的语法高亮
|
int |
getHits() |
int |
getLimit()
获得搜索结果的单页大小限制
|
String |
getQueryString() |
protected io.reactivex.Observable<List<T>> |
getSearchResult(LCUser asAuthenticatedUser,
Map<String,String> params) |
String |
getSid()
获取本次查询的id,注意,它不是返回结果中对象的objectId,而是表示本次AVSearchQuery查询的id
|
int |
getSkip()
返回当前返回集合的其实位置
|
LCSearchSortBuilder |
getSortBuilder()
获取当前的AVSearchSortBuilder对象
|
String |
getTitleAttribute()
获取当前指定的title 对应的Field
|
void |
include(String key) |
LCSearchQuery |
order(String order)
设置查询字段列表,以逗号隔开的字符串,例如"a,b,c",表示按照a,b,c三个字段的顺序排序,如果字段前面有负号,表示倒序,例如"a,-b"
|
LCSearchQuery |
orderByAscending(String key)
根据提供的key进行升序排序
|
LCSearchQuery |
orderByDescending(String key)
根据提供的key进行降序排序
|
void |
setClassName(String className)
设置查询的className,否则将包括所有启用了应用内搜索的class
|
void |
setFields(List<String> fields) |
void |
setHightLights(String hightlights)
设置返回的高亮语法,默认为"*"
语法规则可以参考 http://www.elasticsearch.org/guide/en/elasticsearch/reference/current
/search-request-highlighting.html#highlighting-settings
|
void |
setLimit(int limit)
设置搜索的结果单页大小限制,默认值为100,最大为1000
|
void |
setQueryString(String query)
设置搜索的查询语句。
详细语法可以参考http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl
-query-string-query.html#query-string-syntax
|
void |
setSid(String sid)
设置查询id,通常您都不需要调用这个方法来设置,只要不停调用find就可以实现分页。
不过如果需要将查询分页传递到其他Activity,则可能需要通过传递sid来实现。
|
void |
setSkip(int skip)
设置返回集合的起始位置,一般用于分页
|
void |
setSortBuilder(LCSearchSortBuilder sortBuilder)
设置查询的AVSearchSortBuilder,使用更丰富的排序选项。
|
void |
setTitleAttribute(String titleAttribute)
此选项为AVOSCloud SearchActivity使用 指定Title所对应的Field
|
public static final String AVSEARCH_HIGHTLIGHT
public static final String AVSEARCH_APP_URL
public static final String AVSEARCH_DEEP_LINK
public static final String DATA_EXTRA_SEARCH_KEY
public LCSearchQuery()
public LCSearchQuery(String queryString)
public LCSearchSortBuilder getSortBuilder()
public void setSortBuilder(LCSearchSortBuilder sortBuilder)
sortBuilder
- sort builder.public String getClassName()
public LCSearchQuery order(String order)
order
- order string.public LCSearchQuery orderByAscending(String key)
key
- 需要排序的keypublic LCSearchQuery orderByDescending(String key)
key
- The key to order by.public LCSearchQuery addAscendingOrder(String key)
key
- The key to order bypublic LCSearchQuery addDescendingOrder(String key)
key
- The key to order bypublic void setClassName(String className)
className
- class namepublic void setLimit(int limit)
limit
- pagination limit.public int getLimit()
public int getSkip()
public void setSkip(int skip)
skip
- skip value.public void setHightLights(String hightlights)
hightlights
- highlight setting.public String getHightLights()
public void setSid(String sid)
sid
- search session id.public String getSid()
public void setTitleAttribute(String titleAttribute)
titleAttribute
- title setting.public String getTitleAttribute()
public void setQueryString(String query)
query
- query string.public String getQueryString()
public int getHits()
public void include(String key)
public io.reactivex.Observable<List<T>> findInBackground()
public io.reactivex.Observable<List<T>> findInBackground(LCUser asAuthenticatedUser)
asAuthenticatedUser
- explicit user for request authentication.Copyright © 2020, 美味书签(北京)信息技术有限公司 All rights reserved.