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.

- 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.
| Operator | Effect | Use it for |
|---|---|---|
| OR | Broadens: records with either term | Joining synonyms inside one concept |
| AND | Narrows: records with both terms | Joining different concepts |
| NOT | Excludes every record containing a term | Rarely: 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?
- Split the question into concepts: type 2 diabetes, medication adherence, digital tools.
- List terms for each concept: a subject heading plus free-text synonyms and spelling variants.
- Join the terms inside each concept with OR, in brackets.
- Join the concept blocks with AND.
- Check the result: run each block alone, look at the counts and test the string against studies you know should appear.
| Concept block | Terms 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.
| Element | PubMed | Ovid MEDLINE |
|---|---|---|
| Subject heading, exploded | "Medication Adherence"[Mesh] | exp Medication Adherence/ |
| Title and abstract words | adheren*[tiab] | adheren*.ti,ab. |
| Proximity | "medication adherence"[tiab:~3] | (medication adj3 adheren*).ti,ab. |
| Combining | One string, or #1 AND #2 in Advanced search history | By line number: 1 and 2 |
| Platform | Proximity | Order of evaluation |
|---|---|---|
| PubMed | "term term"[tiab:~N] (ti, tiab, ad fields; no wildcards) | Left to right; operators in capitals |
| Ovid MEDLINE | adjN: up to N−1 words between, any order | Bracket explicitly |
| Embase.com | NEAR/n (any order), NEXT/n (fixed order) | Left to right |
| Web of Science | NEAR/x (default 15 words) | NEAR, SAME, NOT, AND, then OR |
| Scopus | W/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
- Known-item check: collect five to ten studies you know are relevant and confirm the string finds them.
- Block counts: run each concept alone; a block with very few or very many hits is a warning.
- Add one concept at a time and watch how the count falls with each AND.
- Read a sample of results for noise, then adjust the free-text terms.
- 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.
| Check | Done |
|---|---|
| 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.
| Guide | Read it for |
|---|---|
| Text and data mining rules (EU and Germany) | The legal basis for machine analysis of full texts |
| PRESS checklist | How to peer review the string you built here |
| Steps in literature review flowchart | Where string-building sits among the ten stages |
| Literature review service Germany: FAQs | Scope, cost drivers and authorship before you commission support |
Questions
What is the difference between AND and OR?
Should I use MeSH or free text?
What does the asterisk do in a search?
Do I need someone to check my search string?
References
- National Library of Medicine. PubMed User Guide. Accessed 5 November 2026. https://pubmed.ncbi.nlm.nih.gov/help/
- National Library of Medicine. Medical Subject Headings (MeSH). Accessed 5 November 2026. https://www.nlm.nih.gov/mesh/meshhome.html
- 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
- 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
- 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
- Wolters Kluwer. Ovid MEDLINE database guide: searching tips and operators. Accessed 5 November 2026. https://tools.ovid.com/selfservice/medline.html
- 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
- Clarivate. Web of Science: search operators. Accessed 5 November 2026. https://webofscience.help.clarivate.com/Content/search-operators.html
- Elsevier. Scopus search tips. Accessed 5 November 2026. https://dev.elsevier.com/sc_search_tips.html
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.