Class Sort


  • public class Sort
    extends Stage
    Sorts all input documents and returns them to the pipeline in sorted order.
    • Constructor Detail

      • Sort

        protected Sort()
    • Method Detail

      • on

        public static Sort on()
        Creates a sort stage.
        Returns:
        the new stage
      • ascending

        public Sort ascending​(String field,
                              String... additional)
        Adds an ascending sort definition on the field.
        Parameters:
        field - the sort field
        additional - any additional fields to sort on
        Returns:
        this
      • descending

        public Sort descending​(String field,
                               String... additional)
        Adds an descending sort definition on the field.
        Parameters:
        field - the sort field
        additional - any additional fields to sort on
        Returns:
        this
      • getSorts

        public List<Sort.SortType> getSorts()
        Returns:
        the sorts
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
      • meta

        public Sort meta​(String field)
        Adds a sort by the computed textScore metadata in descending order.
        Parameters:
        field - the sort field
        Returns:
        this