ContributionsMost RecentMost LikesSolutionsjson query syntax matches AND OR Hello, I cannot find the full json query syntax documentation here. Thats wha I'm asking in this post: How does a json based query look like for AND matches in body text. I want to query all posts containing term1 AND term2 in their body. My query currently is this. How do I add the term2? [ { "messages":{ "fields":[ "id", "subject", "search_snippet", "body", "cover_image.view_href", "teaser", "view_href", "author", "conversation.last_post_time", "replies.count(*)", "kudos.sum(weight)", "metrics.views", "labels" ], "constraints":[ { "category.id":"DE", "conversation.style":"tkb", "body":{ "matches":"term1" }, "depth":0 } ], "sorts": [ "post_time desc" ], "limit":10, "subQueries":{ "labels":{ "fields":[ "text", "id" ] } } } } ] Re: JSON subquery returns spontaneous errors Can someone from the development team please advice, what to do? JSON subquery returns spontaneous errors When doing a json query with a subquery for labels, I get an error from time to time. [ { "messages": { "fields": [ "id", "subject", "search_snippet", "body", "cover_image.view_href", "teaser", "view_href", "author", "conversation.last_post_time", "replies.count(*)", "kudos.sum(weight)", "metrics.views", "labels" ], "limit": 10, "subQueries": { "labels": { "fields": [ "text", "id" ] } } } } ] Some requests return the correct result, but some return this error: { "status": "error", "message": "An unexpected error occurred.", "data": { "type": "error_data", "code": 301, "developer_message": "", "more_info": "" }, "metadata": {} } The usage of the subquery is very valueable for us to avoid additional API requests for the labels in a loop. What can I do to avoid the error while still using the subquery? Re: Select labels along with messages in one query Thank you very much for the quick response and help. Re: Select labels along with messages in one query thanks, that worked. One more question (sorry to bother you further) How would this LIQL constraint be in a JSON query AND labels.text IN ('Text1','Text2') Re: Select labels along with messages in one query thx, the like contraint doesnt seem to work: "body":"mykeyword", it returns "message": "Invalid query syntax", Re: Select labels along with messages in one query Thanks for your answer, unfortunately I cannot access developer.khoros.com urls. They always stuck in a TOO_MANY_REDIRECTS error by the browser. Can you please give me an example here on how the request for messages with a subquery looks like? Re: Select Kudos with message query Thank you very much, that helped a lot. Unfortunately the documentation sources are not accessible. This url https://developer.khoros.com/khoroscommunitydevdocs/docs/liql-collection-reference always lead to too-many-redirects error and empty page Select labels along with messages in one query I query messages with SELECT id, subject, search_snippet, body, cover_image.view_href, teaser, view_href, author, conversation.last_post_time, replies.count(*), metrics.views FROM messages WHERE category.id = 'DE' AND conversation.style = 'tkb' AND body MATCHES 'mykeyword' AND depth = 0 ORDER BY post_time DESC LIMIT 10 To get the labels of each message i currently do an additional labels query for each message. Is there a way to get the labels along with the messages in one query? SolvedSelect Kudos with message query I am doing a LIQL query for messages SELECT id, subject, search_snippet, body, cover_image.view_href, teaser, view_href, author, conversation.last_post_time, replies.count(*), metrics.views, kudos FROM messages WHERE category.id = 'DE' AND conversation.style = 'tkb' AND body MATCHES 'mykeyword' AND depth = 0 ORDER BY post_time DESC LIMIT 10 Can I also retrieve the kudos count with one query. ? Something like: SELECT id, subject, search_snippet, body, cover_image.view_href, teaser, view_href, author, conversation.last_post_time, replies.count(*), metrics.views, kudos.count(*) FROM messages WHERE category.id = 'DE' AND conversation.style = 'tkb' AND body MATCHES 'mykeyword' AND depth = 0 ORDER BY post_time DESC LIMIT 10 Solved