开发者

Solr returns 'oldest' records instead of 'newest'; 'Rows' and 'Start' parameters

开发者 https://www.devze.com 2022-12-22 02:40 出处:网络
How come Solr returns the \"Oldest\" records first when specifying these parameters. As you probably know these are mainly for \"paging\" purposes.开发者_开发知识库

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 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号