Skip to main content

TRAC: Tips on validating boolean expressions

This article will provide you with quick and easy tips to help you validate your boolean expressions!

Updated over a week ago

We all know booleans can be a little tricky to create and validate. This article will provide you with some easy tips to validate your boolean like a pro!

Professional GIFs | Tenor

Adding the Pinterest, Twitch and Threads operator

Let's take a look at the simple boolean below which looks at Coachella 2025 fashion:

("Coachella fashion" OR "Coachella style" OR "Coachella outfits" OR "festival fashion") AND (2025)

This is a very broad example, so lets include some social sources such as Pinterest, Threads and Twitch. To incorporate these sources into the boolean, simply add the following operators:

OR PINTEREST

OR THREADS

OR TWITCH

Now to add in the keywords, all you need to do is copy and paste the keywords in the first part of the boolean alongside each of the operators, like so:

OR PINTEREST ("Coachella fashion" AND 2025 OR "Coachella style" AND 2025 OR "Coachella outfits" AND 2025 OR "festival fashion" AND 2025)

OR THREADS ("Coachella fashion" AND 2025 OR "Coachella style" AND 2025 OR "Coachella outfits" AND 2025 OR "festival fashion" AND 2025)

OR TWITCH ("Coachella fashion" AND 2025 OR "Coachella style" AND 2025 OR "Coachella outfits" AND 2025 OR "festival fashion" AND 2025)

Now with everything combined, the validated boolean will look like the below:

("Coachella fashion" OR "Coachella style" OR "Coachella outfits" OR "festival fashion") AND (2025) OR PINTEREST ("Coachella fashion" AND 2025 OR "Coachella style" AND 2025 OR "Coachella outfits" AND 2025 OR "festival fashion" AND 2025) OR THREADS ("Coachella fashion" AND 2025 OR "Coachella style" AND 2025 OR "Coachella outfits" AND 2025 OR "festival fashion" AND 2025) OR TWITCH ("Coachella fashion" AND 2025 OR "Coachella style" AND 2025 OR "Coachella outfits" AND 2025 OR "festival fashion" AND 2025)

The structure of the Boolean query is changing as you add OR PINTEREST, OR THREADS, and OR TWITCH because you are essentially specifying additional data sources from which TRAC should collect mentions related to 2025 Coachella fashion. By adding platform-specific operators, you're customising the query to ensure the platform gathers only relevant mentions of 2025 Coachella fashion content from each distinct platform—Pinterest, Threads, and Twitch. It increases precision by filtering noise and ensuring that mentions on these platforms actually refer to your topic of interest, not just the year or festival separately.

✏️ Note: You only need to use the operators for these sources once in the boolean.


Adding Language and Location operators

Using the language and location operator is a great way to narrow down your results to a targeted language and location.

To add the language operator into your boolean expression, simply type out LANG, and then an open parentheses and you will be given a drop down list of all the languages available:

You can also add as many languages as you like - here is an example below which is looking at English, Spanish, Italian, Russian, Polish and Arabic:

LANG ("en" OR "es" OR "it" OR "ru" OR "pl" OR "ar")

The location operator works in the same way. Type out LOCATION and then an open parentheses, and a drop down list of all the available countries will show giving you the option to select a location:

If you wish to add more locations, add in the OR operator in the same bracket and the drop down list will pop up and you can add as many as you like.

Here is an example below showing multiple locations added in the location operator:

LOCATION ("GB" OR "US" OR "CA" OR "ES" OR "IT" OR "BR")


Using curly and straight quotes

When writing search queries that involve exact phrases, you can use straight double quotes (" ") and also curly quotes (“ ”).


Using parentheses around the entire expression

Once you have built your boolean which has the language and location operators, as well as the source operators, a second pair of brackets is needed to validate the expression.

For example, using the Coachella fashion boolean we created above, without adding a second pair of parentheses around the whole expression will not validate it and will show the below message:

So when you add a second pair of parentheses around the keywords, it will validate the expression. See the below screenshot with the parentheses highlighted:

🚨 Important: Only add a second pair of parentheses around the keywords, and not around the location and language operator.


Exclusion operator

The exclusion operator helps to exclude unwanted and irrelevant keywords from your search, and is another quick way to reduce the volume of results.

Using the same Coachella fashion boolean example, you can add the exclusion operator at the end of the expression using AND NOT and then add in the terms you do not want to collect:

LANG ("en") AND LOCATION ("GB" OR "US") AND (("Coachella fashion" OR "Coachella style" OR "Coachella outfits" OR "festival fashion") AND (2025) OR PINTEREST ("Coachella fashion" AND 2025 OR "Coachella style" AND 2025 OR "Coachella outfits" AND 2025 OR "festival fashion" AND 2025) OR THREADS ("Coachella fashion" AND 2025 OR "Coachella style" AND 2025 OR "Coachella outfits" AND 2025 OR "festival fashion" AND 2025) OR TWITCH ("Coachella fashion" AND 2025 OR "Coachella style" AND 2025 OR "Coachella outfits" AND 2025 OR "festival fashion" AND 2025)) AND NOT (trump OR nsfw OR sponsored OR giveaway)

The same logic applies if you want to exclude any retweets, replies, and quote retweets for X.

🚨 Important: You won't need to apply a second set of parentheses around the exclusion operator section as only one is needed to validate the expression.


For more information on the different types of operators you can use in booleans, please see the below operator guide:


We hope you enjoyed reading this article! 📚

If you have any questions or would like to learn more, please don't hesitate to reach out to our support team via live chat. 🚀

Did this answer your question?