0

Scenario of searching news, I would like to show the latest news on top. How should I do in hibernate lucene search? It seems by default it shows earliest on top.

Well I also don't want to set a sort manually on publication date, it makes the relevance useless.

王子1986
  • 3,019
  • 4
  • 31
  • 43

1 Answers1

0

I found the answer here

Hibernate Search sorting

The key point is add "SortField.FIELD_SCORE" in the sort field.

Community
  • 1
  • 1
王子1986
  • 3,019
  • 4
  • 31
  • 43