Class LCSearchSortBuilder

java.lang.Object
cn.leancloud.search.LCSearchSortBuilder

public class LCSearchSortBuilder extends Object
  • Constructor Details

    • LCSearchSortBuilder

      public LCSearchSortBuilder()
  • Method Details

    • newBuilder

      public static LCSearchSortBuilder newBuilder()
    • orderByAscending

      public LCSearchSortBuilder orderByAscending(String key, String mode, String missing)
      按照key升序排序
      Parameters:
      key - 排序的key
      mode - 数组或者多值字段的排序模式,min表示取最小值,max取最大值,sum取综合,avg取平均值,默认值是avg。
      missing - 当搜索匹配的文档没有排序的key的时候,设置本选项决定文档放在开头还是末尾,取值是"last"或者"first", 默认是"last"表示在末尾。
      Returns:
      Returns current object, so you can chain this call.
    • orderByAscending

      public LCSearchSortBuilder orderByAscending(String key, String mode)
      Parameters:
      key - sort key
      mode - sort mode
      Returns:
      Returns current object, so you can chain this call.
      See Also:
    • orderByAscending

      public LCSearchSortBuilder orderByAscending(String key)
      Parameters:
      key - sort key
      Returns:
      Returns current object, so you can chain this call.
      See Also:
    • orderByDescending

      public LCSearchSortBuilder orderByDescending(String key, String mode, String missing)
      按照key降序排序
      Parameters:
      key - 排序的key
      mode - 数组或者多值字段的排序模式,min表示取最小值,max取最大值,sum取综合,avg取平均值,默认值是avg。
      missing - 当搜索匹配的文档没有排序的key的时候,设置本选项决定文档放在开头还是末尾,取值是"last"或者"first", 默认是"last"表示在末尾。
      Returns:
      Returns current object, so you can chain this call.
    • orderByDescending

      public LCSearchSortBuilder orderByDescending(String key, String mode)
      Parameters:
      key - sort key
      mode - sort mode
      Returns:
      Returns current object, so you can chain this call.
      See Also:
    • orderByDescending

      public LCSearchSortBuilder orderByDescending(String key)
      Parameters:
      key - sort key
      Returns:
      Returns current object, so you can chain this call.
      See Also:
    • whereNear

      public LCSearchSortBuilder whereNear(String key, LCGeoPoint point)
    • whereNear

      public LCSearchSortBuilder whereNear(String key, LCGeoPoint point, String order)
    • whereNear

      public LCSearchSortBuilder whereNear(String key, LCGeoPoint point, String order, String mode, String unit)
      按照地理位置信息远近排序,key对应的字段类型必须是GeoPoint。
      Parameters:
      key - 排序的字段key
      point - 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

      public List<Object> getSortFields()