com.clusterpoint.api
Class CPSOrder

java.lang.Object
  extended by com.clusterpoint.api.CPSOrder

public class CPSOrder
extends java.lang.Object

Defines all possible ordering rules that could be applied when doing search.


Constructor Summary
CPSOrder()
           
 
Method Summary
static java.lang.String CPSLatLonDistanceOrdering(java.util.Map<java.lang.String,java.lang.String>[] coords, boolean ascending)
          Returns an ordering string for sorting by distance from a latitude/longitude coordinate pair
static java.lang.String CPSNumericOrdering(java.lang.String tag, boolean ascending)
          Returns an ordering string for sorting by a numeric field
static java.lang.String CPSPlaneDistanceOrdering(java.util.Map<java.lang.String,java.lang.String>[] coords, boolean ascending)
          Returns an ordering string for sorting by distance from specified coordinates on a geometric plane
static java.lang.String CPSRelevanceOrdering()
          Returns an ordering string for sorting by relevance in descending order (more relevant first)
static java.lang.String CPSRelevanceOrdering(boolean ascending)
          Returns an ordering string for sorting by relevance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CPSOrder

public CPSOrder()
Method Detail

CPSLatLonDistanceOrdering

public static java.lang.String CPSLatLonDistanceOrdering(java.util.Map<java.lang.String,java.lang.String>[] coords,
                                                         boolean ascending)
Returns an ordering string for sorting by distance from a latitude/longitude coordinate pair

Parameters:
coords - array of maps where key is xpath and value is centerpoint coordinates as values. Should contain exactly two elements - latitude first and longitude second.
ascending - parameter to specify ascending/descending order.
See Also:
CPSSearchRequest.setOrdering(String), CPSSearchRequest.setOrdering(String[])

CPSPlaneDistanceOrdering

public static java.lang.String CPSPlaneDistanceOrdering(java.util.Map<java.lang.String,java.lang.String>[] coords,
                                                        boolean ascending)
Returns an ordering string for sorting by distance from specified coordinates on a geometric plane

Parameters:
coords - array of maps where key is xpath and value is centerpoint coordinates as values.
ascending - parameter to specify ascending/descending order.
See Also:
CPSSearchRequest.setOrdering(String), CPSSearchRequest.setOrdering(String[])

CPSNumericOrdering

public static java.lang.String CPSNumericOrdering(java.lang.String tag,
                                                  boolean ascending)
Returns an ordering string for sorting by a numeric field

Parameters:
tag - the xpath of the tag by which You wish to perform sorting
ascending - parameter to specify ascending/descending order.
See Also:
CPSSearchRequest.setOrdering(String), CPSSearchRequest.setOrdering(String[])

CPSRelevanceOrdering

public static java.lang.String CPSRelevanceOrdering()
Returns an ordering string for sorting by relevance in descending order (more relevant first)

See Also:
CPSSearchRequest.setOrdering(String[]), CPSSearchRequest.setOrdering(String)

CPSRelevanceOrdering

public static java.lang.String CPSRelevanceOrdering(boolean ascending)
Returns an ordering string for sorting by relevance

Parameters:
ascending - parameter to specify ascending/descending order.
See Also:
CPSSearchRequest.setOrdering(String[]), CPSSearchRequest.setOrdering(String)