Forum Discussion
First of all, I would hate to mention that we never supported OR operator in our LiQL queries. We would love to have that but currently there is no support for this. You will have to write two different queries for subject and body and create a union out of those.
Second, I need to understand the WHERE clause in the query that you had written
labels.text = 'FAQ' AND depth=0 AND labels.text MATCHES ( "stereo", "electro", "kickit")
Ideally you should be doing either labels.text = or labels.text MATCHES. Is there a need for both the clauses? As a best practice, we suggest to use labels.text MATCHES.
Hope this helps.
Let me know if you have further questions.
Regards,
Chhama
Hi ChhamaJ, in the process of going through something similar to DylanGeorgeFiel, i can try to explain the difference with using labels.text = as opposed to using labels.text MATCHES.
Using something like the following allows you to query messages based on a AND relationship of labels. Meaning, get posts that has both labels as requested:
SELECT * FROM messages WHERE labels.text = 'FAQ' AND labels.text = 'Help'
If you use MATCHES ("FAQ", "Help"), you are saying you want to get posts with either labels FAQ or Help.
I believe Dylan was trying to do a combination of AND and OR relationships, which is where im also running into a snag: get posts that has the FAQ label AND (also stereo OR electro OR kickit labels)
Do you know what was the resolution to this original request?
Related Content
- 2 years ago
- 15 years ago