djencks commented on pull request #3879: URL: https://github.com/apache/camel/pull/3879#issuecomment-637672775
We need a better sorting algorithm. If the summary-group was always the same as the docTitle, then I think the comparison for the sort could be (lets assume everything is uppercased already): comparing (docTitle1, group1) and (docTitle2, group2): - notice if they are equal, return 0 - if group1 and group2 are null, then return comparison docTitle1 and docTitle2 - if group1 and group2 are both present, compare them -- if not equal, return comparison -- if equal, return comparison of docTitle1 and docTitle2 - if only group1 is present: -- if group1 === docTitle2, then the first item is after the second item. -- otherwise, return the comparison of group1 and docTitle2. - if only group2 is present: -- if docTitle1 === group2, then the first item is before the second item. -- otherwise, return the comparison of docTitle1 and group2. Does this make sense? Assuming it does, do you want to write the code for this or shall I? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org