Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tatiana Vassilieva 18 posts 98 karma points
    May 20, 2013 @ 08:19
    Tatiana Vassilieva
    0

    Examine - Order results by multiple property fields?

    So I have a simple query along the lines of:
    var results = searcher.Search(criteria.Range(...).And().Field("nodeTypeAlias","someType").And().OrderBy("date").Compile());

     

    Can I order my results by multiple criteria?? eg. first by 'name' then by 'date'?

    Alternatively, is there a way to flag a property as having a higher priority so that when checked as true it's returned (sorted) at the start of the results list? eg. say I have an Event with property flagEvent(true/false)

  • Tatiana Vassilieva 18 posts 98 karma points
    May 21, 2013 @ 04:29
    Tatiana Vassilieva
    100

    Well, looks like  .And().OrderByDescending("priority").And().OrderBy("date") worked :)
    Keep forgetting that EnableSorting="true" config!

Please Sign in or register to post replies

Write your reply to:

Draft