Question:how to sorting data using solr?


Solr provides a simple method to sort on one or more indexed fields. Use the "sort' parameter to specify "field direction" pairs, separated by commas if there's more than one sort field:

    q=video&sort=price desc
    q=video&sort=price asc
    q=video&sort=inStock asc, price desc

"score" can also be used as a field name when specifying a sort:

    q=video&sort=score desc
    q=video&sort=inStock asc, score desc

Complex functions may also be used to sort results:

    q=video&sort=div(popularity,add(price,1)) desc

If no sort is specified, the default is score desc to return the matches having the highest relevancy.

asked Sep 13, 2013 in SOLR by rajesh
edited Sep 12, 2013
0 votes

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.