Class SortField

java.lang.Object
com.redis.vl.query.SortField

public class SortField extends Object
Represents a sort field with its direction.

Python port: Corresponds to tuple (field_name, ascending) in _parse_sort_spec

  • Constructor Details

    • SortField

      public SortField()
  • Method Details

    • asc

      public static SortField asc(String fieldName)
      Create a SortField with ascending order.
      Parameters:
      fieldName - Field name
      Returns:
      SortField with ascending=true
    • desc

      public static SortField desc(String fieldName)
      Create a SortField with descending order.
      Parameters:
      fieldName - Field name
      Returns:
      SortField with ascending=false
    • getDirection

      public String getDirection()
      Get the direction as a string.
      Returns:
      "ASC" or "DESC"