• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Bug for searching with descending order

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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]
     
    Migrated From Jforum.net
    Ranch Hand
    Posts: 17424
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    No any comments from JForum development team?
    [originally posted on jforum.net by collin_chu]
     
    Migrated From Jforum.net
    Ranch Hand
    Posts: 17424
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
    Posts: 17424
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks, monroe. Looking forward to the new version of JForum.
    [originally posted on jforum.net by collin_chu]
     
    Seriously? That's what you're going with? I prefer this tiny ad:
    We need your help - Coderanch server fundraiser
    https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    reply
      Bookmark Topic Watch Topic
    • New Topic