开发者

Lucene.net 2.9.2 NumericField sort

开发者 https://www.devze.com 2023-01-01 07:29 出处:网络
Can anyone verify if the latest Lucene.net 2.9.2 can sort (and reverse开发者_如何学运维 sort) NumericField? I am sort of stumped, expecially with the reverse sort :(I also get into the same problem to

Can anyone verify if the latest Lucene.net 2.9.2 can sort (and reverse开发者_如何学运维 sort) NumericField? I am sort of stumped, expecially with the reverse sort :(


I also get into the same problem today, the below code is working after troubleshooting for some time.

TopDocs matches = searcher.Search(query, null, 10, new Sort(new SortField("id", SortField.INT, true)));

This is important SortField.INT, otherwise the sorting in the integer field is not working.

0

精彩评论

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