Forum Discussion

auswin's avatar
auswin
Contributor
8 years ago

Search for a specific word using Liql query

Hi ,

 

I need to search whether the subject contains a specific word using Liql query . Eg : I am trying to get the messages using select * from messages .

I am getting the response with a list of messages and each message contains a subject tag . Now , I need to find whether the subject contains a specific word .

Something like - select * from messages where subject like '%test%' .

Above query throws an error , how to use the LIKE or CONTAINS clause in Liql query ?

    • auswin's avatar
      auswin
      Contributor

      Thanks for the reply . I have one more query , I am trying to get the list of latest discussions where the subject matches a certain query , but I am getting the replies also in the result .

       

      In the result , the subject shows as  "Vs: *********"  , where 'Vs' I believe is a reply .

       

      Is it possible to get the result filtering the replies?

      • auswin- Add depth = 0 to your query. It will filter all the replies and will return only topics.

         

        SELECT * FROM messages WHERE subject MATCHES 'wireless' and depth = 0

         

        Give kudos if you find my posts helpful or mark solution if it answers your query

        Tariq