I am using Lithium Community REST API v2 to get question list but I encountered a strange issue.
I want to know if the cases I'm interested in are answered, so I use this query string "SELECT distinct topic.id FROM messages WHERE topic.id in ('id1','id2'...) and is_solution = true". For test, I have 4 ids and I just get random result in different requests while all the 4 questions are answered. For example, at the first request, I got result with 2 item, but got result with 4 items with the same request at second request.
Any help will be appreciated!
@CharlesHe - Tried this query on my side and it worked as expected, I have got the same result on every hit.
Thanks for your help.
If distinct keyword not supported, why no error exists?
I change my query string to "SELECT topic.id FROM messages WHERE topic.id in ('id1','id2'...) and is_solution = true", the issue still exists.
So do you have any suggestion to get what I want ?
@CharlesHe - I thought distinct was not supported till yet, however, this is working with LIQL. Regarding the issue you are facing, I gave it a try and it worked as expected, I was getting the same result on every hit. This might be an issue on your stage which can be fixed from lithium.
SELECT DISTINCT is indeed not a supported statement in LiQL. If what you are looking for are actually threads (which consist of multiple messages (!)) that are solved, then what you are looking for would be the following:
SELECT id FROM messages WHERE depth = 0 AND conversation.solved = true
This will return the id of the topic message for solved threads.
Below is what I got, I want to get 4 questions which are answered already, but got different results in different requests. You can see that I first got 3 items and later got 4 items. It's weird. So do you have any idea why this happens?
Thanks a lot,
Welcome to the Technology board!Curious about our platform? Looking to connect on social technology? You've come to the right place!