Lucene.net 2.9.2 NumericField sort

淺唱寂寞╮ 提交于 2020-01-03 06:28:41

问题


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 :(


回答1:


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.



来源:https://stackoverflow.com/questions/2937713/lucene-net-2-9-2-numericfield-sort

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!