org.apache.solr.search

## Class SortSpecParsing

- java.lang.Object
- - org.apache.solr.search.SortSpecParsing

-     public class SortSpecParsing
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DOCID`
    `static String` | `SCORE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SortSpecParsing()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SortSpec` | `parseSortSpec(String sortSpec, IndexSchema schema)` The form of the (function free) sort specification string currently parsed is:
    `static SortSpec` | `parseSortSpec(String sortSpec, SolrQueryRequest req)` The form of the sort specification string currently parsed is:

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DOCID

          public static final String DOCID

      See Also:
        Constant Field Values

    - #### SCORE

          public static final String SCORE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SortSpecParsing

          public SortSpecParsing()

  - ### Method Detail

    - #### parseSortSpec

          public static SortSpec parseSortSpec(String sortSpec,
                                               SolrQueryRequest req)

      The form of the sort specification string currently parsed is:

           SortSpec ::= SingleSort [, SingleSort]*
           SingleSort ::= <fieldname|function> SortDirection
           SortDirection ::= top | desc | bottom | asc

      Examples:

             score desc               #normal sort by score (will return null)
             weight bottom            #sort by weight ascending
             weight desc              #sort by weight descending
             height desc,weight desc  #sort by height descending, and use weight descending to break any ties
             height desc,weight asc   #sort by height descending, using weight ascending as a tiebreaker

      Returns:
        a SortSpec object populated with the appropriate Sort (which may be null if default score sort is used) and SchemaFields (where applicable) using hardcoded default count & offset values.

    - #### parseSortSpec

          public static SortSpec parseSortSpec(String sortSpec,
                                               IndexSchema schema)

      The form of the (function free) sort specification string currently parsed is:

           SortSpec ::= SingleSort [, SingleSort]*
           SingleSort ::= <fieldname> SortDirection
           SortDirection ::= top | desc | bottom | asc

      Examples:

             score desc               #normal sort by score (will return null)
             weight bottom            #sort by weight ascending
             weight desc              #sort by weight descending
             height desc,weight desc  #sort by height descending, and use weight descending to break any ties
             height desc,weight asc   #sort by height descending, using weight ascending as a tiebreaker

      Returns:
        a SortSpec object populated with the appropriate Sort (which may be null if default score sort is used) and SchemaFields (where applicable) using hardcoded default count & offset values.

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.