Forum Discussion
Hello,
You can use the following query parameter key/value to sort by descending date:
sort_by=-topicPostDate
For ascending you can remove the '-' from query param value. Here are some other query param values you can use for sorting:
- topicViews
- topicKudos
- replies
- PieterOtten11 years agoHelper
Ordering by (-) topicKudos doens't seem to work.. (querying search/messages). Errocode = 100. Can you please elaborate?
- ChhamaJ11 years agoKhoros Staff
Actually, its topicKudosCount
On the other hand, how or by what criteria are you trying to sort the messages?
Regards,
Chhama- PieterOtten11 years agoHelper
I was trying to get the most popular topics in the last X days. Popular in this case meaning most views, as most reactions can be abused and most kudos isn't usefull because kudos aren't used often by our forum users.
I've came up with the following link to use, which seems to work good:
..restapi/vc/search/messages?q=(is_root:true%20AND%20date%3A%5B1398089232%20TO%201400681242%5D)&sort_by=-topicViews&collapse_discussion=trueThe datefilter is used to get topics not more than 1 month old.
Any further suggestions on this query?
Overall I'm missing documentation on the query and sort possibilities. Only by searching these forums I've found the "is_root:true", date-filter and possible sortyBy values... Too bad!
Related Content
- 6 months ago
- 2 years ago
- 2 years ago