Forum Discussion

tmarshall's avatar
tmarshall
Advisor
3 years ago

# in Conversation (LIQL Query) from Messages

Hey Khoros Community Gurus,

I'm trying to figure out how to get the '# in conversation' number using a LIQL query. I get the other stats, but am not sure about how to calculate the number that is shown on a post? 

Select id, replies.count(*), author.login, kudos.sum(weight), metrics.views, convesration.message_count FROM messages where id ='1864895'

3 Replies

  • I think that number refers to number of unique users participating in the discussion right?

    Also: You answered your own question a while ago =): https://community.khoros.com/t5/Developer-Discussion/Message-stats-via-APIv2/m-p/597617

    I still don't see a better/more efficient way than getting all message authors in a topic, then loop over all of them and aggregate an array (sequence) of unique authors... pretty terrible performance wise when the topic is long (e.g. a lot of messages to go trough).

  • tmarshall's avatar
    tmarshall
    Advisor
    3 years ago

    Hey luk - Yeah, I had the same issue when first starting out on this journey and satya was able to suggest that we use topic.id as a solution, however our moderator has moved posts and this 'broke' the query when using topic.id. So am now returning to figure out the best way to get the details from a post that mimics the '# in conversation'  if I go back to using just id. 

    When using topic.id our middleware person sum up all the child threads to get the number of people in the conversation, but now if use 'id' instead of 'topic.id' I can't get those details. Oh hum. I suppose we could do two queries? 

    Need to dig around to figure out how to get '# in conversation' even if the message is moved by the moderator. Tricky, eh. 

  • tmarshall's avatar
    tmarshall
    Advisor
    3 years ago

    Had more of a think and feel this is a process issue and not a code problem. Need to let the community moderators know that if they merge posts together and it is being used for our clever integration that they need to update the link to the now 'merged' post.