Boolean Operators for Literature Searches: How to Build a Search String Step by Step (AND, OR, NOT, MeSH, Truncation)

How to combine AND, OR and NOT with subject headings, free-text synonyms, truncation and proximity, test the string and record it for PRISMA-S.

Written by
Dr. CharlieSenior Medical Writer
Published
Reading time
7 minutes
Sources
9 cited
  • Literature review
  • Search strategy
  • Boolean operators
  • PubMed
AND OR NOT
Within a concept
OR
Between concepts
AND
NOT
Avoid, or test it
Check
PRESS 2015 peer review

Quick answer

  • Join synonyms with OR, join concepts with AND and avoid NOT.
  • Use a subject heading and free-text synonyms for every concept.
  • Rebuild the string for each database, test it on known studies and log it for PRISMA-S.

01What each Boolean operator does

Boolean operators are the three words AND, OR, NOT, which combine search terms so a database returns the records you want [1]. The rule for literature searches is simple: OR within a concept, AND between concepts, and NOT almost never.

Table 1. What each Boolean operator does
OperatorEffectUse it for
ORBroadens: records with either termJoining synonyms inside one concept
ANDNarrows: records with both termsJoining different concepts
NOTExcludes every record containing a termRarely: it can remove relevant records

When a strategy is peer reviewed, the reviewer checks that operators are used correctly, that brackets nest properly and that NOT causes no unintended exclusions [3].

02Subject headings and free-text synonyms

MeSH (Medical Subject Headings) is the National Library of Medicine’s controlled vocabulary for indexing MEDLINE [2]. Subject headings gather records about a concept however the authors worded it, but new records may not be indexed yet. Free-text synonyms in titles and abstracts catch those records and concepts with no heading, so use both for every concept [4].

A PubMed search applies automatic term mapping to untagged terms, matching them to MeSH, journals and authors [1]. Tag a term with a field, such as [tiab], and you control what it searches.

03Truncation, phrases and proximity

  • Truncation finds word endings: in PubMed, smok* retrieves smoke, smoker and smoking [1].
  • Phrase searching keeps words together, as in "type 2 diabetes".
  • Proximity operators find words within a set distance. PubMed supports proximity in the title, abstract and affiliation fields, written "term term"[tiab:~N] [1]; Ovid uses adjN [6], Embase NEAR/n, Web of Science NEAR/x and Scopus W/n [7, 8, 9]. PRESS asks reviewers whether proximity or phrase searching would improve precision [3].
  • Field tags and wildcards differ between platforms, so never paste syntax from one database into another untested.

04Build the search string step by step

Example question: do digital tools improve medication adherence in adults with type 2 diabetes?

  1. Split the question into concepts: type 2 diabetes, medication adherence, digital tools.
  2. List terms for each concept: a subject heading plus free-text synonyms and spelling variants.
  3. Join the terms inside each concept with OR, in brackets.
  4. Join the concept blocks with AND.
  5. Check the result: run each block alone, look at the counts and test the string against studies you know should appear.
Table 2. Example Boolean search string, built by concept block (PubMed syntax, illustrative)
Concept blockTerms joined with OR
Population"Diabetes Mellitus, Type 2"[Mesh] OR "type 2 diabetes"[tiab] OR "type II diabetes"[tiab] OR T2DM[tiab]
Outcome"Medication Adherence"[Mesh] OR adheren*[tiab] OR complian*[tiab]
Intervention"Telemedicine"[Mesh] OR mHealth[tiab] OR "mobile health"[tiab] OR smartphone*[tiab] OR "text messag*"[tiab]

The final Boolean search string is (Population) AND (Outcome) AND (Intervention). Each block stays in its own brackets so the OR terms are combined before the AND.

05The same search strategy on different platforms

The logic stays the same, but syntax changes. Subject headings, field tags and proximity operators are written differently on each platform, so rebuild and test the search strategy in each database rather than pasting it across [4]. Table 3 shows one concept in a PubMed search and in Ovid MEDLINE; Table 4 shows how platforms differ in proximity and in the order they evaluate operators [1, 6, 7, 8, 9], which is why unbracketed strings behave differently across databases.

Table 3. The same concept on different platforms (check each platform’s help pages before use)
ElementPubMedOvid MEDLINE
Subject heading, exploded"Medication Adherence"[Mesh]exp Medication Adherence/
Title and abstract wordsadheren*[tiab]adheren*.ti,ab.
Proximity"medication adherence"[tiab:~3](medication adj3 adheren*).ti,ab.
CombiningOne string, or #1 AND #2 in Advanced search historyBy line number: 1 and 2
Table 4. Proximity syntax and order of evaluation by platform
PlatformProximityOrder of evaluation
PubMed"term term"[tiab:~N] (ti, tiab, ad fields; no wildcards)Left to right; operators in capitals
Ovid MEDLINEadjN: up to N−1 words between, any orderBracket explicitly
Embase.comNEAR/n (any order), NEXT/n (fixed order)Left to right
Web of ScienceNEAR/x (default 15 words)NEAR, SAME, NOT, AND, then OR
ScopusW/n (any order), PRE/n (fixed order)OR, then W/n and PRE/n, then AND, then AND NOT

06Test the string before you run it

  1. Known-item check: collect five to ten studies you know are relevant and confirm the string finds them.
  2. Block counts: run each concept alone; a block with very few or very many hits is a warning.
  3. Add one concept at a time and watch how the count falls with each AND.
  4. Read a sample of results for noise, then adjust the free-text terms.
  5. Ask for a peer review: a second searcher checks the strategy with the PRESS checklist before the final run [3].

07Why NOT is risky, and how to balance sensitivity

NOT removes every record containing the excluded term, even one that is also about your topic. Exclude “children” to focus on adults and you also lose studies of both. PRESS lists unintended exclusions from NOT as a specific check [3]; handle such cases at screening instead.

A sensitive string retrieves most relevant records plus many irrelevant ones; a precise string misses some. For a systematic review or other comprehensive literature review, favour sensitivity and accept more screening [4]. Every added AND concept narrows the results, so add one only when the question needs it.

08When Boolean searching is not enough

A database string finds only what that database indexes. Supplement it with citation searching, trial registers such as the German Clinical Trials Register (DRKS) and grey literature sources [4]. If you plan to analyse retrieved full texts by machine, check the text and data mining rules first.

09Record and review the search

Save the exact string for each database, the date it was run and the number of records. PRISMA-S asks authors to report full strategies, dates and record counts, and to describe any search peer review [5]. The search log is also the source of your flow counts.

Table 5. Checklist before you run the search
CheckDone
Each concept has subject headings (where the database has them) and free-text synonyms☐
Every OR group is bracketed, and groups are joined with AND☐
NOT is avoided, or tested for unintended exclusions☐
Truncation, phrases and proximity are tested in this database☐
The string finds your known relevant studies☐
A second searcher has reviewed it against PRESS 2015☐
The final string, date and record count are in the search log☐

10Where this fits in the cluster

This guide is the hub of our literature review and gap analysis series. Start at the ten steps of a literature review, then use the guides below.

Table 6. The literature review and gap analysis cluster
GuideRead it for
Text and data mining rules (EU and Germany)The legal basis for machine analysis of full texts
PRESS checklistHow to peer review the string you built here
Steps in literature review flowchartWhere string-building sits among the ten stages
Literature review service Germany: FAQsScope, cost drivers and authorship before you commission support

Questions

What is the difference between AND and OR?
OR broadens a search by accepting either term; AND narrows it by requiring both. Use OR between synonyms and AND between concepts.
Should I use MeSH or free text?
Both. A subject heading finds indexed records however they are worded, and free text finds new or unindexed records.
What does the asterisk do in a search?
It truncates a word so the search finds variant endings; in PubMed, smok* finds smoke, smoker and smoking.
Do I need someone to check my search string?
It helps. The PRESS 2015 guideline is built for peer reviewing search strategies, and PRISMA-S asks you to report any search peer review.

References

  1. National Library of Medicine. PubMed User Guide. Accessed 5 November 2026. https://pubmed.ncbi.nlm.nih.gov/help/
  2. National Library of Medicine. Medical Subject Headings (MeSH). Accessed 5 November 2026. https://www.nlm.nih.gov/mesh/meshhome.html
  3. McGowan J, Sampson M, Salzwedel DM, Cogo E, Foerster V, Lefebvre C. PRESS Peer Review of Electronic Search Strategies: 2015 guideline statement. J Clin Epidemiol. 2016;75:40-46. https://doi.org/10.1016/j.jclinepi.2016.01.021
  4. Lefebvre C, Glanville J, Briscoe S, et al. Chapter 4: Searching for and selecting studies. In: Higgins JPT, Thomas J, Chandler J, et al., eds. Cochrane Handbook for Systematic Reviews of Interventions. Cochrane. Accessed 5 November 2026. https://www.cochrane.org/authors/handbooks-and-manuals/handbook/current/chapter-04
  5. Rethlefsen ML, Kirtley S, Waffenschmidt S, et al. PRISMA-S: an extension to the PRISMA statement for reporting literature searches in systematic reviews. Syst Rev. 2021;10:39. https://doi.org/10.1186/s13643-020-01542-z
  6. Wolters Kluwer. Ovid MEDLINE database guide: searching tips and operators. Accessed 5 November 2026. https://tools.ovid.com/selfservice/medline.html
  7. Elsevier. Can I use Boolean operators, wildcards and proximity operators in Embase? Accessed 5 November 2026. https://www.elsevier.support/embase/answer/can-i-use-boolean-operators-wildcards-and-proximity-operators-in-embase
  8. Clarivate. Web of Science: search operators. Accessed 5 November 2026. https://webofscience.help.clarivate.com/Content/search-operators.html
  9. Elsevier. Scopus search tips. Accessed 5 November 2026. https://dev.elsevier.com/sc_search_tips.html
Dr. CharliePubrica · Senior Medical Writer

Update log

  • Published by Pubrica

How to cite this article

Dr. Charlie. (2026, November 5). Boolean Operators for Literature Searches: How to Build a Search String Step by Step (AND, OR, NOT, MeSH, Truncation). Pubrica. https://pubrica.com/academy/literature-review/boolean-operators-literature-searches/

This article is general information for researchers, not legal, regulatory or funding advice. Check the current requirements of your journal, funder, ethics committee or regulator before you act on it.

Enquire now
WhatsApp
Email us