Copied to clipboard

Flag this post as spam?

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


  • Simon 692 posts 1068 karma points
    Dec 13, 2016 @ 13:20
    Simon
    0

    Search - Sort by custom umbraco document type properties

    Regarding the following:

    QueryResultDisplay Search(long page, long itemsPerPage, string sortBy = "name", SortDirection sortDirection = SortDirection.Descending);
    

    can I sort by my custom umbraco product document type alias properties?

    Thank you in advance.

  • Simon 692 posts 1068 karma points
    Dec 13, 2016 @ 14:21
    Simon
    0

    And can I sort by multiple, for example "name, CreateData"?

    Thank you

    Kind Regards

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Dec 13, 2016 @ 16:18
    Rusty Swayne
    0

    Hi Simon,

    It sounds like you have some pretty specific query needs - if you have a small catalog, using the existing methods through the MerchelloHelper and LINQ would probably be the quickest solution.

    If you are concerned with performance, you many wind up having to write a quick custom SQL query to either return a Page<Guid> (product keys matching your criteria, ordered how you would like) or think about organizing things with the categories and filters ...

    Really need to understand more of what you're trying to do to give a better response.

  • Simon 692 posts 1068 karma points
    Dec 14, 2016 @ 08:03
    Simon
    0

    Hi Rusty,

    Can you please show a quick example how I can do it with a custom SQL Query?

    I would need to order by also a custom property in my product document type.

    Thanks in advance

    Kind Regards

Please Sign in or register to post replies

Write your reply to:

Draft