I want to list the lastest 10 rows order by id
DESC
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
...
I got a 500 exception because the Query parameter is null
How can I implement it in a best way?
btw:id
field is a NumericField,write using:
new NumericField("id",Integer.MAX_VALUE,Field.Store.YES,true)