How to make does not contain


#1

Hi,

I was searching for the filter in the csdl language that has the functionality of “does not contain”.

Thanks for any additional help!


#2

You simply need to use the CSDL NOT operator to exclude terms. For example:

interaction.content contains "ford" AND
NOT interaction.content contains "for sale"

This filter will return any interactions which contain the word “Ford”, but will filter out any interactions that also contain the phrase “for sale”.

You can also write more complex filters using parentheses:

( 
  interaction.content contains_any "ford, honda, bmw" OR
  interaction.mentions in "ford, honda, bmw"
) 
AND NOT (
  interaction.content contains_any "for sale, auction" OR
  interaction.author.username in "ford, honda, bmw"
)