AnsweredAssumed Answered

Sorting of Contents based on two fields

Question asked by chai on Jul 12, 2011
Latest reply on Jul 12, 2011 by chai

I want to sort the contents from Alfresco based on two fields. Please note the below points:
1) The first field used here for sorting (content_date) has only date part and not time part.
    So if there are more than one content with same content_date, I want them to be sorted based on modified date.
2) Sorting based on first field (content_date) alone works fine.
3) Sorting based on second field (modified) alone also works fine.
4) Sorting based on both fields together doesn't seem to be working.

My code looks like this:


   SearchParameters searchParameters = new SearchParameters();
   searchParameters.addSort("@{}content_date", false);
   searchParameters.addSort("@{}modified", false);

If anyone has implemented this, please provide your inputs.

Thank you.