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

        @Deprecated(forRemoval=true)
        public static Sort on()
        Deprecated, for removal: This API element is subject to removal in a future version.
        use sort()
        Creates a sort stage.
        Returns:
        the new stage
      • sort

        public static Sort sort()
        Creates a sort stage.
        Returns:
        the new stage
        Since:
        2.2
      • 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

        @MorphiaInternal
        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