Hi, reading the docs for LiQL, there are examples of filtering on conversation.solved. And indeed, this is referenced by @VikasB in this answer:
https://community.khoros.com/t5/Khoros-Communities-Product/How-can-I-track-the-number-of-unanswered-...
What I'm really trying to do is find answers that a user has provided for questions that are still considered unsolved.
I can filter by author.id fine, but when I try to combine that with conversation.solved, things break down because apparently conversation.solved will only work with a depth specified, and that depth MUST BE ZERO:
"message": "The depth parameter, or the value passed in for the depth parameter, is not valid.",
"data": {
"type": "error_data",
"code": 605,
"developer_message": "only depth of 0 is supported.",
Weird.
I mean, why shouldn't I be able to filter on conversation.solved independent of depth? Why are the two linked?
Solved! Go to Solution.
The depth = 0 constraint is required for conversation.solved because only topics (messages with depth 0) can be solved. Messages with a higher depth are replies and can be marked as solutions to the original topic.
I'm not sure if there's a way to get this down to one query, but to get the information you're looking for try using the participants.id constraint instead:
SELECT id FROM messages WHERE participants.id = '{{USER ID}}' AND depth=0 AND conversation.solved = false
If you would also like to filter out topics that were authored by the target user, that constraint can be added as well:
SELECT id FROM messages WHERE participants.id = '{{USER_ID}}' AND author.id != '{{USER_ID}}' AND depth=0 AND conversation.solved = false
That will get you the unsolved topics your user has participated in. From there you can use the results to build a list of topic IDs for the following query:
SELECT * FROM messages WHERE author.id = '{{USER_ID}}' AND topic.id IN ('{{TOPIC_ID}}','{{TOPIC_ID}}',...)
Sweet! This worked great. In fact, I didn't even need the third query. Just used this:
SELECT view_href
FROM messages
WHERE participants.id = '554991'
AND author.id != '554991'
AND depth=0 AND conversation.solved = false
LIMIT 1000
(The user was really just looking for a list of links to questions they had answered that were still not accepted.)
I guess the only other enhancement might be a way to also filter out messages where the user only commented on another answer (which would be anything where the depth != 1.)
But depth can only be zero. Hrm...
Thank you so much for your response though. This is great!
Welcome to the Technology board!
Curious about our platform? Looking to connect on social technology? You've come to the right place!