This article aims to demystify the intricacies of Boolean search logic, providing you with effective tools and techniques to craft intelligent searches that filter out irrelevant results. While initially it may appear challenging, Boolean search follows a straightforward logic. With some practice and guidance, you'll quickly become proficient in harnessing its power for more targeted and efficient searching.
Learn more about Boolean in the mCommunity Boolean Resource Page.
Boolean Overview
Think of Boolean as the grammar of your search. Just like sentences have structure, so should your queries. With Boolean, you can use terms like AND, OR, and NOT to make your searches smart and specific.
Boolean Operators
The main operators of building a Boolean search string are AND, OR, and NOT. These are the building blocks that you use to articulate exactly what you want the search to accomplish.
This is how they work:
AND: All terms must be present. Narrows your search.
OR: At least one term must be present. Expands your search.
NOT: Excludes specific terms. Limits your search.
A Boolean Example
Let’s look at an example of a Keyword Search:
When we convert the search above to a Boolean search string it looks like this:
apple AND (watch OR iwatch) NOT ("apple sauce" OR "apple juice"
OR "apple orchard*")
To better understand these components, let’s dissect it into three components:
Training Resource: Here is a visual representation of how these operators work in practice.
TIP: Capitalizing Boolean operators is best practice, though it is no longer required, as it makes the maintenance of search strings much easier.
Modifying a Boolean Search
We can modify our original search query in two ways: by either broadening or narrowing the search scope. Let's explore how this is done:
Broadening the Search
To encompass a wider range of products, we can add another category, like the iPhone, to our search. This modified query looks like this:
apple AND (watch OR iwatch OR IPHONE) NOT ("apple sauce"
OR "apple juice" OR "apple orchard*")
This addition widens the search to include results related to iPhones as well.
Narrowing the Search
You can make the search more specific by excluding certain terms. For example, removing all mentions of the iPhone would narrow down our results:
apple AND (watch OR iwatch) NOT (IPHONE or "apple sauce"
OR "apple juice" OR "apple orchard*")
However, you should be cautious when excluding terms as you could overlook important information. If you exclude “iPhone” from your search, you might miss some useful results that mention both watch and iWatch and iPhone.
Refining Boolean Search Results
To further refine and enhance your search results, there are additional Boolean syntaxes you can use:
Quotation Marks (" "): Use these for exact phrases. For example, searching "apple pie" ensures results contain this exact phrase.
Parentheses ( ): These are used to group alternative terms together. For example, (watch OR iwatch) groups these terms as one unit in the search.
They are also the secret sauce to a great Boolean search. As your queries get longer, parentheses are as necessary to the structure of your search as the location of your boolean operators. For example, if your query looks like this: apple AND (watch OR iwatch OR iPhone) NOT "apple sauce" OR "apple juice" OR "apple orchard*", you have not officially grouped the ending keywords together to be excluded, so you will pull in irrelevant results. Instead, make sure your query looks like this: apple AND (watch OR iwatch OR iPhone) NOT ("apple sauce" OR "apple juice" OR "apple orchard*")
Asterisk (*): This acts as a wildcard. It's useful for capturing various forms of a word. For example, "apple orchard*" will find both singular and plural forms, like "apple orchard" and "apple orchards".
Training Resource: Our Boolean Training Guide will walk you through additional examples and Advanced Boolean Operators with examples.
Understanding Advanced Boolean Operators
Next, let's explore advanced operators and special syntax rules to make your searches even more precise. We'll build upon what we've already learned, adding new operators and specific syntax tips that are particularly useful.
OPERATOR | APPLICATION | EXAMPLE | RESULT |
AND | When you want two keywords to appear in the same document. | Apple AND watch | Both keywords are found in each document. |
OR | When you want at least one keyword to appear in a document. | Apple OR iPhone | At least one of the keywords are found in each document. |
NOT | When you want to exclude documents that contain the keyword. | Apple NOT “apple juice” | All documents contain apple but none include apple juice. |
NEAR | When you want two keywords to appear in close proximity (same context) in an article. | Apple NEAR watch | Both keywords are found in each document, and with no more than 4 words between each other. |
NEAR/N | Same as NEAR but you want to allow for more distance between the two words. | Apple NEAR/10 watch | Both keywords are found in each document, and with no more than 10 words between each other. |
AND/OR | When you want to broaden the results by allowing for multiple qualifiers. | Apple AND (watch OR iWatch) | All documents include Apple and either watch or iwatch. |
ONEAR | Same as NEAR and adds sequence logic. Use this when you’d like a document to have two words in close proximity to one another and in the same order. | Apple ONEAR watch |
Both Apple and watch are in the document with no more than 4 words between them, and Apple needs to be mentioned before watch. |
ONEAR/N | Same as ONEAR but you want to allow for more distance between the two words. Use this when keywords need to be within a specific distance of one another and in the same order | Apple ONEAR/10 watch | Both keywords are found in each document, and with no more than 10 words between Apple and watch, and Apple needs to be mentioned before watch. |
WORD FREQUENCY | Use this syntax when you want results to include a keyword several times. | Apple{3,} | All documents must include Apple at least 3 times. Learn more about Frequency. |
Learn more about the Complete Boolean Library.
Using the Boolean Editor
In Explore, when you click on Advanced Search, you will see a blank box. This is the Boolean Editor, it simplifies the creation of Boolean search queries from scratch. The editor will help you build queries easier and faster as different elements are color-coded for easy identification.
Let’s look at an example of the color coding:
Blue - Dividing operators (AND, OR, NOT, NEAR)
Green - Phrases in “quotation marks”
Black - Words/phrases not in parentheses
Orange - Advanced Operators
The Boolean Editor also provides a link so you can view the Complete Boolean Library of Operators:
Searching by Letter Case Sensitivity
Within Explore, the Action drop-down allows you to search your keywords based on letter case sensitivity:
Searching NEWS Content
Boolean search allows for highly specific queries. For news content, you can narrow down searches to particular parts of an article, such as the title or the opening text (ingress).
Note: This syntax is not applicable to social content.
Title Searches: For example, title:"Apple" AND (watch OR iwatch) will return articles where 'Apple' is in the title, and either 'watch' or 'iWatch' is mentioned elsewhere in the article.
Text/Ingress Searches: Similarly, ingress:"Apple" AND (watch OR iwatch) will show articles with 'Apple' in the opening text, and 'watch' or 'iWatch' mentioned elsewhere.
Note: title and ingress syntax require the use of quotation marks " " around keywords (even though it's a single word).
Searching SOCIAL Content
Explore simplifies tracking social media trends, following influencers, and monitoring mentions of key figures or topics. Here's how you can use it effectively:
Author Search: To find content created by a specific individual, use the 'author' tag. For instance, author:"tim_cook" OR author:"Tim Cook" will show posts made by Tim Cook.
Mention Search: To discover posts that talk about or mention a person, use the 'mention' tag. For example, mention:"tim_cook" brings up posts mentioning Tim Cook.
General Search: Searching for “tim_cook” will pull up posts containing @tim_cook. However, it won't show posts authored by @tim_cook unless “@tim_cook” is also in the post.
Hashtag Search: To follow a specific hashtag, use the format: hashtag:"applewatch". This will return posts that include the #applewatch hashtag."
Searching Industry Content
To set up an Industry Boolean Search, we recommend using the following operators:
TITLE: - Focuses your searches on the titles of articles or documents
INGRESS: - Matches articles or documents containing the specified keyword/phrase in the first paragraph
REACH > # - Filters results based on the extent of their audiences or distribution
SHARES > # - Narrows down results from news articles and Tweets according to the specified number of Facebook shares or Twitter retweets, whether they match, exceed, or are less than that number
For example, if you wanted to do a search on the Electric Vehicle Industry, this would be your Boolean search string:
((TITLE:“Electric Vehicle*” OR INGRESS:“Electric Vehicle*“)
AND (Reach > 10000 OR SHARES > 10))
This query searches for content where "Electric Vehicle*" appears in either the title or ingress and additionally filters content that either has a reach of over 10,000 or more than 10 shares.
To fine-tune your search, you can adjust the reach and shares parameters:
Modify Reach: By increasing or decreasing the 'reach' threshold, you can target either more popular, widely circulated content or more niche, lesser-known articles. For example, setting reach > 50000 will yield results from sources with larger audiences, ideal for tracking major industry trends.
Modify Shares: Adjusting the 'shares' parameter allows you to gauge the social media impact or viral nature of the content. Increasing this number filters for articles that have greater social media engagement, indicating their popularity or relevance in public discourse.
By tweaking these parameters, you can hone in on the most pertinent and impactful content within the Electric Vehicle industry, ensuring your search results are relevant and high-quality.
Displaying Search Results for Decision-Making
Explore is designed to help ensure your search results are actionable. Let’s look at how this is achieved.
Meltwater displays what we call a Hit Sentence in the search results (see screenshot below). The purpose of the Hit Sentence is to help you quickly understand the context in which your keywords are mentioned so that you can determine the relevance of the content (is it important? Should I tag it as earned media?).
However, when using many keywords in a Boolean search, the Hit Sentence might become less straightforward. For example, with a complex search like:
apple AND (watch OR iwatch OR iphone OR ios OR macbook
OR icloud OR ipad OR airpod) NOT ("apple sauce" OR "apple juice"
OR "apple orchard*")
It can be challenging to highlight specific keywords like product names in the Hit Sentence.
To address this, you can prioritize certain keywords using the caret (^) symbol followed by the preference level (e.g. 1,2,3, etc.)
Let’s look at our previous search example and play out two scenarios.
Equal Priority Example
If we want to equally prioritize all product keywords, we use:
apple AND (watch OR iwatch OR iphone OR ios OR macbook
OR icloud OR ipad OR airpod)^1 NOT ("apple sauce"
OR "apple juice" OR "apple orchard*")
High Priority Example
If our focus is mainly on 'iPhone', we adjust the search like this:
apple AND (watch OR iwatch OR iphone^1 OR ios OR macbook
OR icloud OR ipad OR airpod) NOT ("apple sauce"
OR "apple juice" OR "apple orchard*")
Assigning preferences is beneficial not just when reviewing search results, but also if you rely on these searches for alerts and reports. It will help you quickly assess the relevance of articles, saving valuable time.
Improving your Boolean Knowledge
Learning a new skill takes practice. Join our mCommunity Boolean Wizards group to practice this new skill set and get feedback. We have 3 basic and 3 advanced scenarios, you will receive an answer key after your post.
We also share behind-the-scenes advanced Boolean from our Blog Posts on the mCommunity Boolean Resource Page.
In addition, we offer eLearning courses on Boolean at Meltwater Academy. We encourage you to take our:
To take a deeper dive into Boolean Search Logic - check out the Boolean Training Guide or explore the Complete Boolean Library.
💡 Tip
Need more help? Feel free to reach out to us via Live Chat or check out our Customer Community.
Find answers and get help from Meltwater Support and Community Experts.