我有从Lucene.net排序结果的代码,但我需要按降序排序搜索结果:
var sort = new Lucene.Net.Search.Sort(
new Lucene.Net.Search.SortField("date", Lucene.Net.Search.SortField.LONG));
答案 0 :(得分:7)
Lucene.Net.Search.Sort构造函数有一个重载来反转排序顺序:
var sort = new Lucene.Net.Search.Sort(
new Lucene.Net.Search.SortField("date", Lucene.Net.Search.SortField.LONG),
true);