List of Boolean Operators

Overview of each operator that is available in Advanced Alerts

Rodrigo Araujo avatar
Written by Rodrigo Araujo
Updated over a week ago

Through Advanced Alerts, you will have the ability to build boolean queries that will enhance the quality of your results and monitor specific topics that matter to you.

In order to build your queries, you will need to use boolean operators. These operators will allow you to manipulate the text and data that your alert is fetching. Along with the operators, you will need to properly understand how to structure your query so your Advanced Alert knows what data to fetch on the web.

In this article, we will go functionality of each boolean operator and provide examples of how to structure them in your query:

Let's begin!


AND , OR , AND NOT Operators

AND, OR, AND NOT are the three core operators that you will use to build you search query and they will connect your searches to other boolean operators. We will provide definitions and examples for each one below:

--

AND

The AND operator will link your keywords together. In order for Mention to fetch a web posting, all of the keywords that are linked together must appear in the publication.

The AND operator will also link your query to non-autonomous boolean operators such as the country, language, and source operators to name a few.

Let's take a look at some examples of the AND operator:

Example 1 - AND Operator & Keyword Searches

In this example, Mention will fetch content to your Feed when the text Spotify AND Apple Music AND Pandora all appear in a post. If one of these words or phrases is missing, it will not be fetched.

Example 2 - AND Operator & Boolean Operators

In this example, Mention will fetch content to your Feed when the text Spotify appears from websites or social media accounts from Brazil that also includes other Portuguese text. If Mention identifies an article that is in another language or from another country, it will not be fetched.

⚙️ Mention is a text based crawler and will monitor the text you specifically add to your alert. Since Spotify is the brand's name, it will be written the same in multiple languages.

--

OR

The OR operator will separate keywords in your search query. You can use this operator when you want to create multiple searches within an alert.

You can also use this operator within some boolean operators to expand your data monitoring.

Let's take a look at some examples of the OR operator:

Example 1 - OR Operator & Keyword Searches

In this example, Mention will fetch content to your Feed if an online post contains the text of Spotify or Apple Music separately. Here, we have two active searches in your alert.

Example 2 - OR Operator & Boolean Operators

In this example, Mention will fetch content to your Feed if an online post contains the text of Spotify and the publication is from the United States, France, or Brazil. In this case, the alert is taught to specifically monitor certain countries instead of the general web.

--

AND NOT

The AND NOT operator will exclude keywords or operators from your search completely. You can use this operator to limit your search and hone in on specific conversations.

Let's take a look at some examples of the AND NOT operator:

Example 1 - AND NOT Operator & Keyword Searches

In this example, Mention will fetch content to your Feed if an online post contains the text of Spotify and Car Thing is not mentioned. If Car Thing is mentioned in a publication, Mention will ignore the post.

Example 2 - AND NOT Operator & Boolean Operators

In this example, Mention will fetch content to your Feed for posts about Spotify from all sources except Twitter because the query has blocked the Twitter source.


Proximity & NEAR Operators

Similar to the AND operator, the proximity operators allow you to link keywords in your search query with added precision. The proximity operators require your search terms to be within a certain range of each other. Below, you will find information for these operators:

--

Proximity: ~#

The ~# operator works with search phrases and will apply a proximity limit to the phrase in your search. For this operator, you can replace the # with a number between 1 to 6. Depending on the number you choose, Mention will fetch the text in your phrase when they appear between 1 to 6 words of each other.

Example of the ~# Operator

This search will fetch mentions when NASA and rover appear within 6 words of each other. You might see mentions such as:

  • NASA rover...

  • NASA and it's new rover...

  • NASA just launched a rover to space...

❗ This operator does not work with Twitter Historical Data.

⚙️ The proximity operator only works for your text searches. You cannot use it for data operators such as language, country, or source operators to name a few, nor with body operators (body and title).

--

NEAR/#

The NEAR/ operator is similar to the proximity operator except it used to link multiple keywords or phrases together. For this operator, you can replace the # with a number between 1 to 6 and Mention will search for content that fits your search configuration.

Example of the NEAR/# Operator

This search will fetch mentions when NASA TV and SpaceX appear within 4 words of each other. You might see mentions such as:

  • Watch SpaceX footage on NASA TV...

  • NASA TV will work with SpaceX on...

  • NASA TV and SpaceX collaborations...

❗ This operator does not work with Twitter Historical Data.

⚙️ The proximity operator only works for your text searches. You cannot use it for data operators such as language, country, or source operators to name a few.


Language & Country Operators

In your boolean query, you can restrict your searches by specific languages or countries. You can use the AND operator to monitor specific languages/countries or you can use the AND NOT operator to block certain languages/countries.

Below, we will go over the operators dedicated to languages and countries:

--

lang:

The lang: operator can be used to monitor or block specific languages. To use this operator, please add the lang: operator and the language codes to your query using AND or AND NOT.

⚙️ If you want to monitor every language on the web, do not use the lang: operator to keep your search query as a broad search.

❗ The operator is non-autonomous. It must be combined to a search query using AND or AND NOT.

📖 For a list of language codes, you can check out this article: Language Codes

Example 1 - Monitor a Language with the lang: Operator

This query will fetch mentions when Starbucks AND Pumpkin Spice are mentioned online and the publication or social media post is in the English language.

Example 2 - Monitor Multiple Languages with the lang: Operator

This query will fetch mentions when Starbucks AND Pumpkin Spice are mentioned online and the publication or social media post are in the English, French, or Spanish language.

Example 3 - Block Languages with the lang: Operator

This query will fetch mentions when Starbucks AND Pumpkin Spice are mentioned online and the publication or social media post is not in the Portuguese language.

--

source_country:

The source_country: operator allows you to monitor or block specific country codes from your search query. To use this operator, please add the source_country: operator and the country codes to your query using AND or AND NOT depending on your needs.

⚙️ When a Mention is fetched into your account, our system will receive data about the online publication or social media post. Within this data, our system will be able to identify the geolocation of the following sources: Web, News, Blogs, Forums, Facebook, Instagram, and Twitter.

Please note:

  • The operator is non-autonomous. It must be combined to a search query using AND or AND NOT.

  • Mention cannot bypass VPNs or fake locations that a website or social media account might list.

📖 For more information about country monitoring and a full list of the country codes you can add to your alert, please check out this article: Country Codes for Advanced Alerts

Example 1 - Monitor a Country with the source_country: Operator

This query will fetch mentions when Krispy Kreme AND coffee appear on publications or social media posts from France.

Example 2 - Monitor Multiple Countries with the source_country: Operator

This query will fetch mentions when Krispy Kreme AND coffee appear on publications or social media posts from France, United States, or Brazil. If a post from Italy mentions Krispy Kreme and coffee, it will not be fetched.

Example 3 - Block Countries with the source_country: Operator

This query will fetch mentions when Krispy Kreme AND coffee appear on publications or social media posts on any country except Spain and Germany. If a post from the United States mentions Krispy Kreme and coffee, it will fetched.

--

AND NOT has:source_country
AND -has:source_country

The AND NOT has:source_country operator and AND -has:source_country operator act in the same way. You can choose to write in whichever one you prefer in your query. These operators will fetch mentions that do not have a specific country location.

Sometimes, mentions from the web and social media do not have a country code embedded in their data. This operator will support you in monitoring relevant content that you need from websites that Mention cannot geolocate.

💡For accurate country monitoring, we recommend using the source_country: operator and one of the has:source_country operators in your query. This will allow you to fetch mentions from specific countries and it will allow you to track mentions from websites in the same country that do not offer geolocation data.

❗ The operator is non-autonomous. It must be combined to a search query using AND or AND NOT.

Example of the AND NOT has:source_country & source_country: Operators

This query will fetch mentions when McDonalds and Big Mac appear on publications and social posts from Italy. On top of this, if an online posting mentions McDonalds and Big Mac and it does not provide country location information, then Mention will fetch it as well.


Title & Body Operators

With the title: and body: operators, you direct your alert to monitor specific areas of a web publication. You can use this operator to monitor hone in on data from web sources such as News, Blogs, or Forums.

⚙️ If you are monitoring the web and social media sources, Mention will disregard the title: and body: operator for social media content.

For example, if you are monitoring the term title: "World Cup", Mention will simply search for "World Cup" on sources like Twitter, Facebook, and TikTok.

--

title:

When you attach the title: operator to your search query, Mention will search for the text on the titles of web postings such as news headlines or blog post titles.

Example of the title: Operator

This query will fetch mentions when World Cup and Argentina appear on the title of the website post. If a news website posts and article about Argentina and the World Cup, it will be fetched. However, if World Cup and Argentina appear in the body of the article and not in the title, it will be ignored.

On top of this, Mention will disregard the title: operator for social media. If a tweet is posted about the World Cup and Argentina, it will be fetched as well!

Example of the title: Operator & Other Search Groups

You can utilize parenthesis groups to monitor multiple topics on the web. In this query, the alert will monitor:

  • Mentions of World Cup and Argentina in the title of web postings.

  • Mentions of World Cup and Argentina on social media.

  • Mentions of the Women's World Cup and Spain in any part of a web and social media post such as the title or body of the publication.

--

body:

When you attach the body: operator to your search query, Mention will search for the text on the body paragraphs of the web posting.

Example of the body: operator

This query will fetch mentions when World Cup and 2026 appear in the body of a web posting. If a forum is talking about the 2026 World Cup, it will be fetched into the Feed. However, if World Cup and 2026 appear in the title and not in the body, it will be ignored.

Example of the body: Operator & Other Search Groups

You can utilize parenthesis groups to monitor multiple topics on the web. In this query, the alert will monitor:

  • Mentions of World Cup and 2026 in the body paragraphs of a web post.

  • Mentions of World Cup and 2026 on social media.

  • Mentions of World Cup and USA in the title of the web post.

  • Mentions of World Cup and USA on social media.


URL: Operator

The URL: operator can be used to specifically monitor text within hyperlinks in a post and the text in the URL bar of a web browser. You can utilize this operator to monitor multiple topics:

  • The URL: operator can monitor one or multiple website URLs.

  • The URL: operator can monitor specific text in the URL string of a website.

  • The URL: operator can block one or multiple website URLs.

  • The URL: operator can block specific text in the URL string of a website.

⚙️ If you intend to add a website URL to the URL: operator, please enclose it with in quotations:

  • Moon AND url:"cnn.com" - ✅

  • Moon AND url: cnn.com - ❌

If you intend to add text to the URL: operator, you do not need quotations:

  • Moon AND url: cnn - ✅

❗ The URL: operator is non-autonomous and must be paired with a search query using AND or AND NOT.

For example, if your query is written as (Moon AND URL:"cnn.com") , it will fetch mentions where moon appears on cnn.com or URLs that include cnn.com such as a string like nytimes.com/exampleURLwith-cnn.com

Example 1 - URL: Operator & Website Monitoring

The query will fetch mentions of Adidas when:

  • The text Adidas appears on the nytimes.com website.

  • The text Adidas appears on a website that includes nytimes.com in the URL domain such as nbcnews.com/url-example-nytimes.com-10394

  • The text Adidas appears on a website that includes a hyperlink to nytimes.com.

Example 2 - URL: Operator & Multiple Websites

The query will fetch mentions of Adidas when:

  • The text Adidas appears on the nytimes.com or cnn.com or abcnews.com website.

  • The text Adidas appears on a website that includes nytimes.com or cnn.com or abcnews.com in the URL domain such as larepublica.pe/url-example-cnn.com

  • The text Adidas appears on a website that includes a hyperlink to one of the sites from the query.

Example 3 - URL: Operator & Text Searches

This query will fetch mentions of Adidas when:

  • The text appears on a website that includes messi or Argentina in the URL string such as larepublica.pe/messi-url.

  • The text Adidas appears on a website that has a hyperlink with the text messi or Argentina appear in the hyperlink URL.


Wildcard Operators

Within the Advanced Alert, Mention offers two wildcard operators that will act as text replacements for your search queries. The ? and * operators can be written inside queries to enhance your searches in a productive way. Here is how they work:

  • The ? operator will replace 1 unknown character from your search query. For example, bo?t will monitor the web for boat, boot, bolt, and more.

  • The * operator will replace multiple unknown characters from your query. For example, v*d will monitor the web for voted, void, valid, and more.

⚙️ Twitter, Instagram, Pinterest, YouTube, & TikTok Monitoring:

Wildcard operators are non-autonomous when the Twitter, Instagram, Pinterest, YouTube, or TikTok sources are turned on. This means that you will need to pair your wildcard searches with a regular keyword search in your alert.

For example:

  • *ike by itself will not work if you are monitoring the sources listed above. - ❌

  • Mountain AND *ike will work for all sources. - ✅

  • You can also monitor *ike by itself if you turn off the sources listed above. - ✅

Wildcard Operator Limitations:

  • Do not use wildcard operators with quotations because this will cause Mention to read your search as plain text. For example "car?" will be read as car with a question mark. For this reason, please use wildcard for single words only.

  • You cannot use the same wildcard in a post. For example:

    • l??t does not work - ❌

    • t**h does not work - ❌

    • c?r* does work! -

  • Wildcards do not work for 1 character texts. For example, if you write a? , your alert will not work.

  • Wildcard operators only function with keyword searches. You cannot add wildcards to other search operators. For example, if your search query is written as "New York" AND url: nytimes.com* , you will draw an error.

Example of ? Operator

This query will mentions from websites and social posts that include the text mobile app and variations of McDonald? such as McDonalds , McDonaldz, McDonaldd.

Example of * Operator

This query will fetch mentions from websites and social posts that include the text United States and variations of *iking such as biking, hiking, liking, and more.


Source Operator

The Source operator will allow you to define the sources that you want your search queries to monitor. It is a great way to create specific searches across different platforms if you alert is monitoring multiple topics.

For your search queries, you can choose to monitor specific sources or block specific sources using AND or AND NOT.

⚙️ The operator is non-autonomous and has to be linked to a keyword search in the alert.

❗️If you decide to use the source: operator in your query, please keep in mind that Mention will only monitor the sources you list within the query.

For example, if you have the query Samsung AND source: News, Mention will:

  • Only fetch mentions when Samsung appears on news sites.

  • Mention will not look for mentions on Twitter, Facebook, etc.

To avoid this issue, please make sure to add all of the sources that you want into your search query when the source: operator is active.

💡 Mention Tip - Sources Drop-Down Menu

The source: operator works in conjunction with the Monitored Sources menu in the advanced alert. If you have multiple searches in an alert and you want to precisely monitor certain keywords on specific sources, we recommend turning on all sources from the Monitored Sources menu. From there, you can use the source: operator to hone in on specific sources in the boolean query.

If you turn off a source from the drop-down menu and then try to add the source in your boolean query, you will run into an error. To avoid the error, it's best to leave all of the sources on:

Example 1 - Source: Operator & 1 Monitored Source

This query will fetch mentions when the text Samsung AND Galaxy appear on Twitter. On top of this, Mention will only monitor Twitter for this query. Other sources will be ignored.

Example 2 - Source: Operator & Multiple Sources

This query will fetch mentions when the text Samsung AND Galaxy Fold appear on Twitter or Blog sites. Mention will only monitor these sources and ignore any others.

Example 3 - Source: Operator & Multiple Search Queries

This query will fetch mentions when:

  • Samsung and Galaxy Fold appear on News sites.

  • Google and Pixel appear on Twitter or TikTok posts.

  • Apple and iPhone appear on Blog posts.


Social Media Account Operators (Facebook & Twitter)

For precise monitoring on Facebook and Twitter, you can use the source_name: or source_username: operators. These operators will monitor your search query on specific social media accounts that interest you.

--

source_name:

The source_name: operator will monitor or block Twitter accounts using the name of the accounts that you add to the operator. The operator is non-autonomous and will need to be connected to a search query using AND or AND NOT.

⚙️ The source_name: operator functions with the name of the accounts on Twitter. Please make sure you are attaching the correct names to your search query as some accounts will have different account names and @ handles written:

❗If a Twitter account changes their account name, you will need to make sure to update your query with the new name or Mention might not fetch data from the account.

Example 1 - source_name: Operator & Monitored Accounts

This query will fetch mentions when:

  • The text Beyond Meat , Beyond Chicken, or Plant-Based appear on tweets from the KFC Twitter account.

  • The text Beyond Meat , Beyond Chicken, or Plant-Based appear on tweets from the Burger King Twitter account.

Example 2 - source_name: Operator & Blocked Accounts

This query will fetch mentions on Twitter when the text Beyond Meat, Beyond Chicken, or Plant-Based appear on any account except Wendy's. If Wendy's tweets about these terms, it will not be fetched.

--

source_username:

The source_username: operator will monitor the specific @handles of Twitter accounts and Facebook Business Pages. The operator is non-autonomous and will need to be connected to a search query using AND or AND NOT.

⚙️ The source_username: operator is used with the @handle of an account that you can find on the bio of a Twitter or Facebook account or in the URL of the account:

💡 Mention Tips:

  • You do not need to add @ to the operator. Mention already recognizes the @ symbol when you are writing using the source_username: operator:

    • "Beyond Meat" AND source_username: burgerking - ✅

    • "Beyond Meat" AND source_username: @burgerking - ❌

  • Some brand's might use different @names for their Facebook Page and Twitter accounts. For example, Mention uses @mention for Twitter and @mentionapp for Facebook. Before creating your alert, please take the time to check if the brands you are monitoring use different names on social media.

Example 1 - source_username: Operator & Monitored Accounts.

This query will fetch mentions when:

  • The text Beyond Meat, Beyond Chicken or Plant-Based appear on a post or tweet by Burger King's Facebook page or Twitter account.

  • The text Beyond Meat, Beyond Chicken or Plant-Based appear on a post or tweet by McDonald's Facebook page or Twitter account.

Example 2 - source_username: Operator & Blocked Accounts

This query will fetch tweets or Facebook posts from pages that are posting about Beyond Meat, Beyond Chicken, or Plant-Based. If the Costco, Walmart, or Target Facebook pages or Twitter accounts post about these phrases, they will be ignored.


Reach Operators

Mention offers the ability to integrate reach operators within your Advanced Alert for specific sources. The reach operators will implement a limit to your search query based on the number of followers, subscribers, or visits a website or account has online.

At this time, Mention offers reach operators for the following sources:

  • Twitter

  • Facebook

  • YouTube

  • TikTok

  • Pinterest

  • LinkedIn

  • Web Sources - News, Blogs, Forums

📖 For more information about the Reach metric, check out this article: Reach

❗The reach operators do not work with Twitter Historical Data.

--

twitter_followers:XXX

The twitter_followers: will fetch mentions or block mentions from Twitter accounts that have a certain number of followers. The operator is non-autonomous and must attached to a search query with AND or AND NOT.

⚙️ When the operator is in use, it will only monitor Twitter mentions. To fetch mentions from other sources, you can add OR NOT source:Twitter to your query.

For example:

  • Nutella AND twitter_followers:10000 - this will only fetch mentions from Twitter

  • Nutella AND (twitter_followers:10000 OR NOT source: twitter) - this will fetch mentions from accounts on Twitter with 10,000 followers or more and it will monitor Nutella across other sources.

Example of twitter_followers: Operator

This query will fetch mentions when the text Nutella, Hersheys, or Hershey's appears on a tweet from an account with 500 followers or more.

--

facebook_page_likes:XXX

The facebook_page_lkes: operator will fetch or block mentions from Facebook pages that have a certain number of likes . The operator is non-autonomous and must attached to a search query with AND or AND NOT.

⚙️ When the operator is in use, it will only monitor Facebook mentions. To fetch mentions from other sources, you can add OR NOT source: facebook to your query.

For example:

  • Nutella AND facebook_page_likes:1000 - this will only fetch mentions from Facebook pages

  • Nutella AND (facebook_page_likes:1000 OR NOT source: facebook) - this will fetch mentions from accounts on Facebook pages with 1000 followers or more and it will monitor Nutella across other sources.

❗This operator will only monitor Facebook pages. Mention does not monitor Facebook profiles or Facebook groups at this time.

Example of facebook_page_likes: Operator

This search query will fetch mentions when:

  • The text Nutella and biscuits appear on Facebook pages with 1000 likes or more.

  • The text Nutella and biscuits appears on any other source such as Twitter, News, etc.

--

tiktok_followers:XXX

The tiktok_followers: operator will fetch or block posts from TikTok when the caption of the video matches your search query and the TikTok page has a specific number of likes. The operator is non-autonomous and must attached to a search query with AND or AND NOT.

⚙️ When the operator is in use, it will only monitor TikTok captions. To fetch mentions from other sources, you can add OR NOT source: tiktok to your query.

For example:

  • Nutella AND tiktok_followers: 6000 - this will only fetch mentions from TikTok pages

  • Nutella AND (tiktok_followers: 6000 OR NOT source: tiktok) - this will fetch mentions from TikTok pages with 6000 followers or more and it will monitor Nutella across other sources.

Example of tiktok_followers: operator

This search query will fetch mentions when the text Nutella appears with recipe, recommendations, or ideas in the caption of the TikTok post. On top of this, the TikTok page must have less than 16,000 followers or else it will not be fetched.

--

pinterest_followers:XXX

The pinterest_followers: will fetch or block mentions from Pinterest when the post matches your search query and the account has a specific number of followers. It is non-autonomous and must be used with AND or AND NOT.

⚙️ When the operator is in use, it will only monitor Pinterest posts. To fetch mentions from other sources, you can add OR NOT source: pinterest to your query.

For example:

  • Nutella AND pinterest_followers: 20000 - this will only fetch mentions from Pinterest accounts.

  • Nutella AND (pinterest_followers: 20000 OR NOT source: pinterest) - this will fetch mentions from Pinterest accounts with 20000 followers or more and it will monitor Nutella across other sources.

Example of pinterest_followers: Operator

This query will fetch mentions when:

  • The text Nutella & Go and Twix appear on Pinterest posts with 200 followers or more.

  • The text Nutella and Snickers appear on Pinterest posts with 500 followers or more.

--

youtube_subscribers:XXX

The youtube_subscribers: operator will fetch or block mentions when the title or caption of a YouTube video matches your search query and the YouTube channel has a certain number of subscribers. It is non-autonomous and must be used with AND or AND NOT.

⚙️ When the operator is in use, it will only monitor YouTube videos. To fetch mentions from other sources, you can add OR NOT source: youtube to your query.

For example:

  • Nutella AND youtube_subscribers: 20000 - this will only fetch mentions from YouTube.

  • Nutella AND (youtube_subscribers: 20000 OR NOT source: youtube) - this will fetch mentions from YouTube channels with 20000 followers or more and it will monitor Nutella across other sources.

Example of youtube_subscribers: Operator

This query will fetch mentions when the text Nutella Pretzel Sticks and review or unboxing appear on the title or caption of videos with 1000 or more subscribers.

--

linkedin_reach:XXX

The linkedin_reach: operator will fetch or block mentions based on whether the title or content of a LinkedIn post matches your search query and the LinkedIn post has a certain number of reaction. It is non-autonomous and must be used with AND or AND NOT.

⚙️ When the operator is in use, it will only monitor LinkedIn business page. To fetch mentions from other sources, you can add OR NOT source: linkedin to your query.

For example:

  • Nutella AND linkedin_reach: 20000 - this will only fetch mentions from Linkedin.

  • Nutella AND (linkedin_reach: 20000 OR NOT source: linkedin) - this will fetch mentions from Linkedin page with 20000 reactions or more and it will monitor Nutella across other sources.

Example of linkedin_reach: Operator


This query will fetch mentions when the text Nutella Pretzel Sticks and review or unboxing appear on the title or content of the post with 1000 or more reactions.

-

website_reach:XXX

The website_reach: operator will fetch or block mentions from websites with a certain reach number. The operator is non-autonomous and must be paired with AND or AND NOT.

⚙️ When the operator is in use, it will only monitor mentions from web sources. To fetch mentions from social media, you can add OR NOT source: (web OR blogs OR forums OR news) to your query.

Example of the website_reach: Operator

This query will fetch mentions when the text Nutella, Oreo, and Halloween appear on web mentions with a reach of 5000 or more.


Boolean Query Example

Now that you have seen the full list of boolean operators offerred in your Advanced Alert, feel free to take a look at this boolean query below and try to figure out what it is monitoring:

Answer

This search query will fetch mentions when:

  • The text Volkswagon and Bus appears in titles of posts from the Web, News, and Forums in the English language.

  • The text Volkswagon and ID.Buzz appears in titles of posts from the Web, News, and Forums in the English language.

  • The text Volkswagon and electronic car appears on tweets from the United States or from accounts without country location.

  • The text Volkswagon and EV appears on tweets from the United States or from accounts without country location.

  • The text Volkswagon and eco-friendly appears on tweets from the United States or from accounts without country location.

  • The text Volkswagon appears on the title or caption of YouTube videos with 50000 or more subscribers.


Commenting

You can add comments to your code by typing "//" followed by the comment for that line.



Thank you! If you have any questions, please contact [email protected].

Did this answer your question?