esearch
Quick Start
- Command:
esearch -db <database> -query "<query string>" - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/esearch - Full reference: See references/help.md
When To Use This Tool
- Start an Entrez Direct pipeline by searching for record IDs.
- Search PubMed, Gene, Protein, Nuccore, SRA, and related NCBI databases with field-qualified queries.
- Hand off matching IDs to
efetch,esummary,elink, orxtract. - Use this whenever you need database-specific search syntax, not a free-form web search.
Common Patterns
# 1) PubMed literature search
esearch -db pubmed -query 'ebola virus[Title/Abstract] AND 2024[pdat]'
# 2) Gene search with field qualifiers
esearch -db gene -query 'TP53[gene] AND human[orgn]'
# 3) Search and immediately fetch document summaries
esearch -db assembly -query 'GCF_000001405.40[accn]' | efetch -format docsum
Recommended Workflow
- Pick the Entrez database first, because query fields and sort modes are database-specific.
- Write the query with field tags whenever possible instead of relying on broad keywords.
- Run
esearch, then immediately pipe IDs intoefetch,esummary, orelink. - Use
xtractonly after you know what XML structure the downstream command emits.
Guardrails
-dband-queryare both required.- Wildcards and unqualified terms can explode result counts; narrow with fields like
[AUTH],[GENE], or[orgn]. - Sort options are database-specific, so do not assume the same
-sortvalues work everywhere. esearchgives you IDs, not the final report; plan the next pipeline step before running it at scale.