How come Solr returns the "Oldest" records first when specifying these parameters.
As you probably know these are mainly for "paging" purposes.开发者_开发知识库
And if I chose something like 10 Rows per page, and with the start set to 0, this means in my mind that the latest 10 records should be displayed. However, Solr displays the oldest 10 records.
How can I change this?
Thanks
Solr is not a database, it is a search engine.
The order in which you get the rows is not based on the order they are inserted, but on a particular ranking algorithm.
You can find more information here:
Solr Relevancy FAQ
Why are search results returned in the order they are? If no other sort order is specified, the default is by relevancy score.
and
Solr Relevancy CookBook
You can specify a sorting order: using the sort parameter:
Examples, from the Solr Tutorial:
Solr provides a simple method to sort on one or more indexed fields. Use the 'sort' parameter to specify "field direction" pairs...
q=video&sort=price desc
q=video&sort=price asc
q=video&sort=inStock asc, price desc
精彩评论