Package cn.leancloud.search
Class LCSearchSortBuilder
java.lang.Object
cn.leancloud.search.LCSearchSortBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LCSearchSortBuilderorderByAscending(String key) orderByAscending(String key, String mode) orderByAscending(String key, String mode, String missing) 按照key升序排序orderByDescending(String key) orderByDescending(String key, String mode) orderByDescending(String key, String mode, String missing) 按照key降序排序whereNear(String key, LCGeoPoint point) whereNear(String key, LCGeoPoint point, String order) 按照地理位置信息远近排序,key对应的字段类型必须是GeoPoint。
-
Constructor Details
-
LCSearchSortBuilder
public LCSearchSortBuilder()
-
-
Method Details
-
newBuilder
-
orderByAscending
按照key升序排序- Parameters:
key- 排序的keymode- 数组或者多值字段的排序模式,min表示取最小值,max取最大值,sum取综合,avg取平均值,默认值是avg。missing- 当搜索匹配的文档没有排序的key的时候,设置本选项决定文档放在开头还是末尾,取值是"last"或者"first", 默认是"last"表示在末尾。- Returns:
- Returns current object, so you can chain this call.
-
orderByAscending
- Parameters:
key- sort keymode- sort mode- Returns:
- Returns current object, so you can chain this call.
- See Also:
-
orderByAscending
- Parameters:
key- sort key- Returns:
- Returns current object, so you can chain this call.
- See Also:
-
orderByDescending
按照key降序排序- Parameters:
key- 排序的keymode- 数组或者多值字段的排序模式,min表示取最小值,max取最大值,sum取综合,avg取平均值,默认值是avg。missing- 当搜索匹配的文档没有排序的key的时候,设置本选项决定文档放在开头还是末尾,取值是"last"或者"first", 默认是"last"表示在末尾。- Returns:
- Returns current object, so you can chain this call.
-
orderByDescending
- Parameters:
key- sort keymode- sort mode- Returns:
- Returns current object, so you can chain this call.
- See Also:
-
orderByDescending
- Parameters:
key- sort key- Returns:
- Returns current object, so you can chain this call.
- See Also:
-
whereNear
-
whereNear
-
whereNear
public LCSearchSortBuilder whereNear(String key, LCGeoPoint point, String order, String mode, String unit) 按照地理位置信息远近排序,key对应的字段类型必须是GeoPoint。- Parameters:
key- 排序的字段keypoint- GeoPoint经纬度对象order- 排序顺序,升序"asc",降序"desc",默认升序,也就是从近到远。mode- 数组或者多值字段的排序模式,min表示取最小值,max取最大值,avg取平均值,默认值是avg。unit- 距离单位,"m"表示米,"cm"表示厘米,"mm"表示毫米,"km"表示公里,"mi"表示英里,"in"表示英寸,"yd"表示英亩,默认"km"。- Returns:
- Returns current object, so you can chain this call.
-
getSortFields
-