我想id
DESClucene只能排序和搜索没有?
Sort sort = new Sort(new SortField[]{new SortField("id",SortField.INT,true)});
TopDocs topDocs=indexSearch.search(null,null,10,sort);//no need Query,only sort
...
我得到了500异常,因为查询参数为空
我怎样才能实现它的最好的方式列出最新的10行的次序?
BTW:id
字段是NumericField,编写使用:
new NumericField("id",Integer.MAX_VALUE,Field.Store.YES,true)
+ 1,冷静,我从来不知道它 – Koerr
之前,你可以看看我的另一个Lucene的问题吗?感谢http://stackoverflow.com/questions/10464377/in-this-lucene-case-using-booleanquery-or-write-more-indexes – Koerr