public class LCSearchSortBuilder extends Object
Constructor and Description |
---|
LCSearchSortBuilder() |
Modifier and Type | Method and Description |
---|---|
List<Object> |
getSortFields() |
static LCSearchSortBuilder |
newBuilder() |
LCSearchSortBuilder |
orderByAscending(String key) |
LCSearchSortBuilder |
orderByAscending(String key,
String mode) |
LCSearchSortBuilder |
orderByAscending(String key,
String mode,
String missing)
按照key升序排序
|
LCSearchSortBuilder |
orderByDescending(String key) |
LCSearchSortBuilder |
orderByDescending(String key,
String mode) |
LCSearchSortBuilder |
orderByDescending(String key,
String mode,
String missing)
按照key降序排序
|
LCSearchSortBuilder |
whereNear(String key,
LCGeoPoint point) |
LCSearchSortBuilder |
whereNear(String key,
LCGeoPoint point,
String order) |
LCSearchSortBuilder |
whereNear(String key,
LCGeoPoint point,
String order,
String mode,
String unit)
按照地理位置信息远近排序,key对应的字段类型必须是GeoPoint。
|
public static LCSearchSortBuilder newBuilder()
public LCSearchSortBuilder orderByAscending(String key, String mode, String missing)
key
- 排序的keymode
- 数组或者多值字段的排序模式,min表示取最小值,max取最大值,sum取综合,avg取平均值,默认值是avg。missing
- 当搜索匹配的文档没有排序的key的时候,设置本选项决定文档放在开头还是末尾,取值是"last"或者"first",
默认是"last"表示在末尾。public LCSearchSortBuilder orderByAscending(String key, String mode)
key
- sort keymode
- sort modeorderByAscending(String, String, String)
public LCSearchSortBuilder orderByAscending(String key)
key
- sort keyorderByAscending(String, String, String)
public LCSearchSortBuilder orderByDescending(String key, String mode, String missing)
key
- 排序的keymode
- 数组或者多值字段的排序模式,min表示取最小值,max取最大值,sum取综合,avg取平均值,默认值是avg。missing
- 当搜索匹配的文档没有排序的key的时候,设置本选项决定文档放在开头还是末尾,取值是"last"或者"first",
默认是"last"表示在末尾。public LCSearchSortBuilder orderByDescending(String key, String mode)
key
- sort keymode
- sort modeorderByDescending(String, String, String)
public LCSearchSortBuilder orderByDescending(String key)
key
- sort keyorderByDescending(String, String, String)
public LCSearchSortBuilder whereNear(String key, LCGeoPoint point)
public LCSearchSortBuilder whereNear(String key, LCGeoPoint point, String order)
public LCSearchSortBuilder whereNear(String key, LCGeoPoint point, String order, String mode, String unit)
key
- 排序的字段keypoint
- GeoPoint经纬度对象order
- 排序顺序,升序"asc",降序"desc",默认升序,也就是从近到远。mode
- 数组或者多值字段的排序模式,min表示取最小值,max取最大值,avg取平均值,默认值是avg。unit
- 距离单位,"m"表示米,"cm"表示厘米,"mm"表示毫米,"km"表示公里,"mi"表示英里,"in"表示英寸,"yd"表示英亩,默认"km"。Copyright © 2020, 美味书签(北京)信息技术有限公司 All rights reserved.