GuidePublished November 26, 2026

Boolean Search Setup, Building Steps and Common Mistakes

1Systematicly Research Lab

14 min read
Contents figure for Boolean search, listing the article's sections.

Abstract

Set up a boolean search with clear concept blocks, join synonyms with OR and AND, then catch the mistakes that distort your result counts.

Keywords: boolean operators; result set; synonyms; PubMed; result count

A Boolean search is a database query that links keywords with the logical operators AND, OR and NOT. The database then returns exactly the set of records your logic describes. AND requires every linked term to appear, OR accepts any of them, and NOT drops records that contain a term. Parentheses group terms, quotation marks keep a phrase together, and truncation symbols such as the asterisk pick up different word endings.

This guide is for anyone who needs a search they can defend and run again: systematic reviewers, health sciences librarians, graduate students working on a thesis, and analysts who use bibliographic, legal or recruiting databases. It shows you how to:

  • split a question into concept blocks
  • write a structured string
  • test the string against studies you already know
  • catch the errors that quietly shrink or inflate a result set

In evidence synthesis, a Boolean search is the foundation for every later step. If the string misses relevant studies, careful screening and analysis cannot bring them back. That is why reviewers write the search strategy into the protocol, report it in full, and run it again before publication. Our complete guide to systematic reviews covers the whole workflow. This article covers only how to write the string.

It helps to think in sets of records rather than in words. Each term you type defines a set: the records that contain it. AND keeps only the overlap between sets, so each extra AND either shrinks the result or leaves it the same. OR merges sets, so each extra OR either grows the result or leaves it the same. NOT takes one set away from another. Once you treat the operators as set arithmetic, search behavior becomes easy to predict. A query that returns too much usually needs another AND concept. A query that returns too little usually needs more OR synonyms.

Every string has to balance two goals. Sensitivity, also called recall, is the share of all relevant records that the search finds. Precision is the share of retrieved records that turn out to be relevant. Systematic reviews deliberately favor sensitivity and accept a lot of irrelevant records at screening, because a missed study can bias the conclusions. A quick background search for a lecture or a grant introduction can lean toward precision. Choose your goal before you start. It tells you how many synonyms to add, whether to use NOT at all, and how far to narrow with field tags.

Databases do not all read a query the same way, and the differences are easy to miss. PubMed Help, published by the National Library of Medicine, says PubMed automatically puts an AND between concepts. Typing vitamin c common cold is read as vitamin c AND common cold. PubMed also asks for operators in uppercase and processes them from left to right. That last rule matters more than it looks. Without parentheses, a string that mixes AND OR can group terms in a way you did not intend, and the database gives no warning.

Some databases also reinterpret your words before they apply your logic. According to PubMed Help, automatic term mapping treats air bladder fistula as containing the phrase "air bladder." If you want each word searched on its own, you enter air AND bladder AND fistula. Because databases can rewrite queries like this, check what was actually searched, usually in a search details or history view. For PubMed-specific techniques such as subject headings and filters, see our guide to building PubMed queries that find the evidence.

Boolean logic is not always the right tool. If you need one known article, PubMed's citation sensor can find it from a pasted title or a few citation details, with no field tags or operators. It uses fuzzy matching, so it still finds the best match when one term is wrong. Structured operators are worth the effort when you need a complete, documented and repeatable set of records rather than a single paper.

Keep that distinction in mind as you work. A one-off lookup can be loose. A search that feeds a review has to be one that another researcher could run and get the same records. The next sections follow the order you will work in: preparation, construction, and the mistakes that skew results.

Key takeaways

  • Three operators do the work: AND narrows a result set, OR widens it, and NOT removes records that contain a term.
  • Put the synonyms for each concept in their own OR block inside parentheses, then join the blocks with AND.
  • PubMed asks you to enter Boolean operators in uppercase, processes them left to right, and places AND between concepts when you leave the operator out. PubMed, for example, expects operators in uppercase and reads them from left to right.
  • Boolean logic decides which records come back, not what order they appear in. Sorting is a separate setting.
  • Before you trust a result count, check that the string finds studies you already know are relevant.

A good query starts before you open a database. Starting without these usually means rewriting the string several times and losing track of which version produced which results.

Be clear about what a Boolean search is designed to do. It returns the set of records that matches your logic exactly. It does not understand meaning, fill in synonyms you left out, or judge relevance. Everything the string needs has to come from your preparation.

What to prepare before writing a search string, and why each item matters
ItemWhat to prepareWhy it matters
Focused questionA one-sentence question split into a small number of core concepts, such as population, intervention and outcomeEach concept becomes one block of the string, and a vague question leads to a vague string
Synonym listAlternative words, spelling variants, abbreviations and closely related terms for each conceptOR only finds the variants you list, so a thin list is a common reason studies get missed
Controlled vocabularyThe database's subject headings for each concept, where the database has themIndexing terms catch records whose authors described the same idea in different words
Database syntax notesOperator case, phrase marking, truncation symbol, field tags and proximity formatPubMed expects uppercase operators and reads them left to right, and other databases have their own rules
Known relevant studiesA handful of studies you already know belong in the reviewIf the string misses them, it needs more synonyms or fewer restrictions before the full run
Search logEach database, the date searched, the exact string and the result countLets you rerun, report and defend the search later

Not every part of the question needs its own block. Many searchers leave the outcome or the study design out of the string. Those details are often missing from titles and abstracts, so requiring them with AND can exclude relevant records. Each block you add is another condition that every record must meet. Add a block only when the results really are too broad without it. If your question is not yet structured, our PICO question examples show how to break it into concepts.

PubMed Help shows that dates combine with other terms through AND. For example, cancer AND 2020/06/01[dp] limits results to one publication date, and influenza AND 2000:2010[dp] limits them to a range. The publication date field includes both print and electronic dates. The exception is an electronic date that falls after the print date. Small details like this decide whether a date limit does what you expect.

Finally, decide where you will record your choices. Before you draft your systematic review protocol, list the databases, concepts and limits you plan to use, because in PubMed even a date limit joins the other terms through the Boolean operator AND, as in heart disease AND 2019/01/01:2019/06/30[dp]. Then any change you make during testing is visible and can be explained.

How to Build a Boolean Search String Step by Step

Table comparing rows including Focused question, Synonym list, Controlled vocabulary across What to prepare, Why it matters.
What to prepare before writing a search string, and why each item matters.

A Boolean search string is built from the inside out. First you join synonyms with OR inside parentheses. Then you combine those concepts with AND, which retrieves only records that include all of the search terms, and in PubMed you can use AND the same way to limit results to a publication date range, as in influenza AND 2000:2010[dp]. Following that order keeps the logic readable and makes errors easier to trace.

  1. Write one block per concept. Join every synonym for a concept with OR, for example (exercise OR "physical activity" OR "resistance training"). Wide blocks protect sensitivity.
  2. Use phrases and truncation on purpose. Quotation marks keep multiword terms together. An asterisk catches word endings, so adolescen* finds adolescent, adolescents and adolescence. Check how far each truncated stem reaches before you keep it.
  3. Put every OR block in parentheses. PubMed processes operators from left to right, so a mix of AND OR without brackets may not group terms the way you meant.
  4. Join the blocks with AND. A complete string might read (exercise OR "physical activity") AND (depression OR "depressive symptoms") AND (adolescen* OR teen*).
  5. Add field tags, proximity and limits last. In PubMed, a date range goes on with AND, as in AND 2000:2010[dp]. A proximity search such as "hip pain"[Title:~4] AND stretching requires the quoted words to appear within four words of each other in the title. PubMed Help notes that joining terms with AND may work better than one long proximity search with many terms or a large N value.
  6. Use NOT only for clear exclusions. If your protocol excludes preprints, PubMed Help says to remove them with NOT, for example by adding NOT preprint[pt].
  7. Test, then record. Run each block on its own, then the combined string, and confirm that your known relevant studies appear. Save the final string, the date and the result count.

Building each concept as a separate line in the search history makes testing much easier. In the PubMed Advanced Search Builder, AND is the default operator, and you can switch to OR NOT from a menu as you add queries to the query box. Combining numbered history lines shows you which block cuts the count most sharply. That is usually where a missing synonym is hiding.

Each database needs its own version of the string. Field tags, truncation symbols and proximity formats rarely carry over unchanged. Keep the same concept logic and rewrite the syntax for each platform.

Common Boolean Search Mistakes That Skew Your Results

Boolean retrieval is exact set logic. That means most errors come from the searcher's logic, not the database. A missing parenthesis, an overused NOT or a thin synonym list changes which records come back, and the database gives no warning. Boolean search terms are the keywords, phrases and subject headings that the operators connect. The operators themselves (AND, OR, NOT) are not terms. They are instructions about how the terms relate. Most mistakes come from treating one like the other or from trusting a result count without checking it.

Zero or very few results usually have one of four causes:

  • Too many AND blocks. Each block is another condition every record has to meet.
  • A typo. A misspelled term matches nothing.
  • An overly specific phrase. An exact phrase in quotation marks misses records worded slightly differently.
  • Operators written in lowercase. In PubMed, operators must be in uppercase, or they may not be read as operators.

To find the problem, run each of your Boolean search terms on its own. A single term that returns nothing is probably misspelled or not used in that database. Then add the blocks back one at a time and watch the count. The block that makes it collapse is the one to widen. PubMed Help suggests these same routes for expanding a search that finds too few citations, including phrases, truncation and how terms are combined.

Boolean logic does not rank results. A record either meets the conditions or it does not. The order you see comes from the database's sort settings, not from your operators. A record at the top of the list is not more relevant because of how you wrote the string, and a relevant record on page twenty counts just as much. This is one reason systematic reviewers screen the whole retrieved set rather than stopping after the first pages.

Boolean operators are used wherever people need exact, repeatable retrieval. That includes bibliographic databases such as PubMed, library catalogs, legal and patent databases, recruiting platforms that search résumés, and many web search engines that support some operators. In business research, the same logic helps find company filings, as our annual report search strategy shows. The operators work the same way everywhere. The syntax around them does not.

These are the most common mistakes and their fixes:

  • Leaving out parentheses. PubMed reads operators from left to right, so exercise OR walking AND depression may not group the way you meant. Bracket every OR block.
  • Overusing NOT. NOT removes every record that mentions a term, including relevant ones. Excluding animals, for example, also drops studies that report both human and animal data. To narrow results, add an AND concept or a field tag instead.
  • Thin synonym lists. Missing spelling variants such as behavior and behavior, abbreviations, or brand and generic drug names cause quiet losses that no result count will reveal.
  • Truncating too early. A short stem picks up unrelated words: cat* finds catheter as well as cats. Truncate at the point where the meaning stays intact.
  • Mixing wildcards with proximity in PubMed. PubMed Help states that if quoted terms in a proximity search include a wildcard, the proximity operator is ignored, so the search runs differently from how you wrote it.
  • Setting a proximity N too large. A higher N widens the search and usually retrieves more records, but some are less relevant. Try a few values and compare the results.
  • Not checking how the database read the query. Automatic term mapping can turn words into phrases. Check the search details to see what actually ran.
  • Copying one string across databases. Field tags and truncation symbols vary between platforms. Translate the syntax and keep the logic.

A string that returns far too much needs the opposite fix. Add a missing concept with AND, or restrict key terms to the title and abstract fields, rather than reaching for NOT. Record each change with its result count so the reasoning stays visible when you report the search. Our PRISMA guide explains what reporting standards expect.

Review software, including Systematicly, comes into play after the string has run. It can help organize the records a search retrieves, but it cannot recover studies the string never found. That is why the testing steps above matter more than any downstream tool.

Frequently asked questions

A Boolean query is a database search that combines terms with the operators AND, OR and NOT. PubMed's help pages explain the logic: AND retrieves results that include all the search terms, OR retrieves results that include at least one of them, and NOT excludes terms, such as preprints, from the results. PubMed asks you to type operators in uppercase and processes them left to right. It also applies AND between concepts automatically, so "vitamin c common cold" runs as vitamin c AND common cold.

What is a Boolean example?

A simple Boolean example is aspirin AND stroke, which returns only records that contain both terms. Changing it to aspirin OR stroke returns records that contain either term, which is a much larger set. Changing it to aspirin NOT stroke returns aspirin records that do not mention stroke. One operator change can transform the result set.

What are the three operators used for Boolean searches?

The three Boolean operators are AND, OR and NOT. An operator is an instruction that tells the database how terms relate to each other.

  • AND narrows results by requiring every term.
  • OR broadens results by accepting any of the terms. It is mainly used for synonyms.
  • NOT excludes records that contain a term. Use it sparingly.

Are Boolean searches still relevant?

Yes, for most structured searching. PubMed Help still explains how to combine terms with AND, OR and NOT. It also shows operators at work in date limits, proximity searches, the search builder and the exclusion of preprints. PubMed even applies AND between concepts when you type plain words. Some tasks need no operators at all. To find one known article, paste its title or citation details, and the citation sensor returns the best match without field tags or Boolean operators.

A typical example of a search string for a review on exercise and adolescent depression is (exercise OR "physical activity") AND (depression OR "depressive symptoms") AND (adolescen* OR teen*). Each bracketed block holds the synonyms for one concept, and joins the concepts. In PubMed you could add a date range, such as AND 2019/01/01:2019/06/30[dp], or exclude preprints with NOT preprint[pt].

How do I do Boolean searches?

Boolean operators work best when you build the query in layers:

  1. Split your question into concepts.
  2. Join the synonyms for each concept with OR inside parentheses.
  3. Join the concept blocks with AND.
  4. Add limits last.

Type operators in uppercase, because PubMed requires it. Check how the database interpreted your query, test it against studies you already know are relevant, and save the final string with its date and result count.

What does * mean in Boolean searches?

The asterisk is a truncation or wildcard symbol that matches any word ending. For example, child* retrieves child, children and childhood. Truncate carefully, because a short stem can pull in unrelated words. In PubMed, a wildcard cannot be used inside a proximity search. If quoted proximity terms include an asterisk, PubMed ignores the proximity operator.

Experience AI-powered research

The tools described in our research are available now. Start your systematic review, meta-analysis, or research project today.