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

TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs