Forum Discussion

jeroen_stevens's avatar
jeroen_stevens
Contributor
13 years ago

Sort order of the threads shown in search

I am using the search API function to request a search list for a corporate website. Sorting by -topicPostDate results in a list where the threads are sorted on the start date of the thread. We want to sort the threads by newest message in a thread; with the newest message appearing first. What sort_by element should we use for this?

 

I am using the next URL:

 

forum.---.com/restapi/vc/boards/id/%boardname%/search/messages?page=1&page_size=2&q=is_root:true&restapi.response_style=view&sort_by=-topicPostDate

 

Hopefully you can help us out.


Thank you.

1 Reply

  • YuriK's avatar
    YuriK
    Khoros Expert
    13 years ago

    Hey Jeroen,

     

    Just to make sure I understand what you are trying to do here. You are trying to search the root messages (the message that started a thread), and you want the root messages to be sorted based on the thread's latest message date rather than by the date of the root message?

     

    If my understanding is correct, there is currently no way to do this with one call. Depending on what you are trying to accomplish it may be possible to do this with multiple calls.

     

    If you would like, you can add this request to the Ideas Area with some background around what this will enable you to do.

     

    Thank you,

     

    Yuri