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.
Thanks. So, it looks like the only way to really do this would be to make a separate API call for each Topic.
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.
Related Content
- 23 days ago
- 5 years ago