org.apache.solr.client.solrj

Class SolrQuery.SortClause

  • All Implemented Interfaces:
    Serializable
    Enclosing class:
    SolrQuery


    public static class SolrQuery.SortClause
    extends Object
    implements Serializable
    A single sort clause, encapsulating what to sort and the sort order.

    The item specified can be "anything sortable" by solr; some examples include a simple field name, the constant string score, and functions such as sum(x_f, y_f).

    A SortClause can be created through different mechanisms:

    
     new SortClause("product", SolrQuery.ORDER.asc);
     new SortClause("product", "asc");
     SortClause.asc("product");
     SortClause.desc("product");
     
    See Also:
    Serialized Form
    • Constructor Detail

      • SortClause

        public SortClause(String item,
                          SolrQuery.ORDER order)
        Creates a SortClause based on item and order
        Parameters:
        item - item to sort on
        order - direction to sort
      • SortClause

        public SortClause(String item,
                          String order)
        Creates a SortClause based on item and order
        Parameters:
        item - item to sort on
        order - string value for direction to sort