How to sort by date in SOLR?

前端 未结 2 871
离开以前
离开以前 2021-01-17 09:14

I want to sort the results and scores returning from SOLR search,how I can get scores based on date like below:

Suppose for keywords \"football\"
  12-10-201         


        
2条回答
  •  萌比男神i
    2021-01-17 09:42

    You can pass the sort parameter in the URL

    e.g. sort=published_date desc for documents by published date in descending order.

    If you want to sort by score and date you can use sort=score desc, published_date desc

提交回复
热议问题