Forum Discussion
Hello Akenefick
Core components often have direct database access, so replicating them in a component isn't always possible. In this case, threaded sorting is only possible with API v1:
https://developer.khoros.com/khoroscommunitydevdocs/docs/linear-and-threaded-sorting
There is a similar discussion here using API v1:
https://community.khoros.com/t5/Developer-Discussion/Need-some-API/m-p/183822
If you only want the latest message in a thread, you can filter by topic.id
:
https://developer.khoros.com/khoroscommunitydevdocs/docs/messages#topicid
Then sort by post_time
:
https://developer.khoros.com/khoroscommunitydevdocs/docs/messages#post_time-2
Alternatively, you can file a Support ticket so we can further investigate this.
- Akenefick2 years agoGenius
Thanks. So, it looks like the only way to really do this would be to make a separate API call for each Topic.
- luk2 years agoBoss
I wouldn' t worry too much about that second call, I tested batch queries a lot in terms of performance and unfortunately the performance gains are minimal to negligible, the API calls are still made, for large and nested collections maybe a bit more efficiently than if you would do it in FreeMarker with a loop, but in my experience FreeMarker hasn't been the bottleneck (most of the time) but the API's response time is and that doesn't change with subqueries.
- Akenefick2 years agoGenius
Oh, that's interesting. Right now, with the replies subquery it loads very quickly, so I will try looping through and making the additional API call instead. I assumed it would take forever but if the speed is similar to the subquery that might work.
Thanks
Related Content
- 2 years ago
- 4 years ago