Get replies counts along with Topic
Hi All,
I was trying to get count of replies along with Root Topic. (Or count of child items when i am trying to retrieve parent)
For example :-
To get root Topic
i have used LiQL as below(modified for readability)
http://test/api/2.0/search?q=SELECT+*+FROM+messages+WHERE+board.id= 'tp' +AND+depth=0+and+conversation.style='forum'+LIMIT+20+OFFSET+0
This query returns the root topics.
I also want to know how many replies are present for this topic.For example also get replies.count(*).
I cannot combine replies.count(*) in above query .How can i get both root topic and count of its replies in a single LiQL query.
Could someone help me on this.
Thanks,
Vijay
Hi vbandi,
You cannot combine '*' and any other field in the LiQL query. If you need to get replies.count(*) along with other fields then you will have to specify all the fields individually. For example,
Select id, board, subject, author, replies.count(*) from messages where board.id = 'tp' and depth=0
In the above query, add all the fields that you need to be returned.
Hope this helps.
Regards,
Chhama