In the post 'https://coderanch.com/t/578091 #19125', boyarsky gave the solution for the sorting problem. But it only resolved the ascending sorting, for the descending, the problem is still there. For example, click 'Search', input key
word 'search', in the 'search option', select 'Message date' and order by 'descending', you will get the following result (only list the date):
page 1 first post: 01/12/2008 18:38:40 page 1 last post: 26/01/2009 15:57:28 page 2 first post: 25/10/2008 14:50:43 page 2 last post: 30/11/2008 08:06:43
We can see that on the each page, the order is not descending.
I fixed this bug by overloading the method 'getPostsData' in 'GenericLuceneDAO.java':
In this method, the parameter 'orderDir' indicates the direction of order. For calling this overloading method,
you should update some code in 'LuceneContentCollector.java'.
This change may impact the relevance search, since as mentioned by boyarsky, it isn't useful because relevance can't be sorted at the database end. But even without this change, as boyarsky said, the relevance sort has the same problem - that items within a page aren't sorted correctly. So, I think the impact of this change for the relevance search is low.
Hi, JForum development team, could you please investigate this sorting problem, and review my solution. Then give me any comments. I want to know whether my solution is the best one, and whether it has any other impact.
Thanks a lot!
Collin Chu
[originally posted on jforum.net by collin_chu]