Home TeamSite TeamSite, LiveSite and OpenDeploy

Sorting Issue of the LSCS Query Result

Hi all,

Currently i am using LSCS query for query xml content for building up a site.
however have difficulties on how to sort the result by the data of the content (say i want to sort by onlineDate, which stored as metadata of the content. e.g. Teamsite/Metadata/onlineDate)
May i ask if there are config/query parameter which enable custom sorting of content?

Thanks

Comments

  • You need to specify what version of LSCS you are using.

    Reading the LS Technical Reference Manual (16.6.1) there is a sort parameter on the query string:

    A comma-separated list of fields by which to
    sort the results.
    • To sort date and numeric fields in ascending order, prefix the field name with the plus (+) character. Note that the + character must be percent-encoded as %2B when included in the URL.
    • To sort these fields in descending order, prefix the field name with the minus (-) character.
    By default, the fields will be sorted in alphabetical order

    Example:
    http://host:port/context/v1/document$title,summary?q=category:article&sort=-publishDate

Sign In or Register to comment.