| Author |
Bug for searching with descending order
|
Migrated From Jforum.net
Ranch Hand
Joined: Apr 22, 2012
Posts: 17424
|
|
In the post 'http://www.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]
|
 |
Migrated From Jforum.net
Ranch Hand
Joined: Apr 22, 2012
Posts: 17424
|
|
No any comments from JForum development team? [originally posted on jforum.net by collin_chu]
|
 |
Migrated From Jforum.net
Ranch Hand
Joined: Apr 22, 2012
Posts: 17424
|
|
It looks good to me... but I really only have time now a days for answering support issues.. Raphael is the one to really comment on this.
Of course, implementing this is compounded by the fact that everyone is spending their time on V3. [originally posted on jforum.net by monroe]
|
 |
Migrated From Jforum.net
Ranch Hand
Joined: Apr 22, 2012
Posts: 17424
|
|
Thanks, monroe. Looking forward to the new version of JForum. [originally posted on jforum.net by collin_chu]
|
 |
 |
|
|
subject: Bug for searching with descending order
|
|
|