Class Sorts

java.lang.Object
com.datastax.astra.client.model.Sorts

public class Sorts extends Object
Utility class to hold the sort options for a query.
  • Method Details

    • ascending

      public static Sort ascending(String field)
      Build a sort clause ascending.
      Parameters:
      field - current field
      Returns:
      sort instance.
    • descending

      public static Sort descending(String field)
      Build a sort clause DESCENDING.
      Parameters:
      field - current field
      Returns:
      sort instance.
    • vector

      public static Document vector(float[] embeddings)
      Build a sort clause with a vector.
      Parameters:
      embeddings - vector of embeddings
      Returns:
      sort instance.
    • vectorize

      public static Document vectorize(String vectorize)
      Build a sort clause with vectorize.
      Parameters:
      vectorize - vector of embeddings
      Returns:
      sort instance.