xsearch
Use when searching a local NCBI EDirect archive/postings index with Boolean, title, word, or pair queries inside the `x*` local-cache workflow.
SKILL.md.claude/skills/xsearch/SKILL.md
GitHubxsearch
Local search front-end built on xcommon.sh plus rchive. It defaults to pubmed, supports -query, -match, -exact, -title, -words, and -pairs, and usually emits an ENTREZ_DIRECT wrapper unless you switch to -raw or use one of the direct rchive lookup modes.
Quick Start
- Command:
xsearch -query "<search terms>" - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/xsearch - Critical environment:
EDIRECT_LOCAL_ARCHIVE
When To Use This Tool
- Searching a prepared local PubMed-style archive instead of the live NCBI service
- Building an
ENTREZ_DIRECTUID set for downstreamxlink,xfilter, orxfetchsteps - Running Boolean or fielded local queries such as
AND,NOT,[TREE], or[YEAR] - Doing title-oriented lookup modes like
-title,-match,-exact,-words, or-pairs
Common Patterns
# Boolean query against the local archive
export EDIRECT_LOCAL_ARCHIVE=/path/to/local/archive
xsearch -db pubmed -query 'C14.907.617.812* [TREE] AND 2015:2018 [YEAR]'
# Title lookup
export EDIRECT_LOCAL_ARCHIVE=/path/to/local/archive
xsearch -title 'Genetic Control of Biochemical Reactions in Neurospora.'
# Emit raw UIDs instead of ENTREZ_DIRECT XML
export EDIRECT_LOCAL_ARCHIVE=/path/to/local/archive
xsearch -raw -query 'CRISPR AND 2024 [YEAR]'
Recommended Workflow
- Point
EDIRECT_LOCAL_ARCHIVEat a valid local archive/postings root. - Pick the search mode that matches the lookup you need:
-queryfor general Boolean search,-title/-match/-exactfor title-style matching, or-words/-pairsfor tokenized title scoring. - Use wrapped output for downstream
x*tools, or add-rawwhen the next stage expects plain UID lines. - If a query fails immediately, verify the local postings directory before debugging the search syntax.
Guardrails
- This is a local archive/postings tool, not a remote
esearchreplacement. -h/-helpare safe and show usage examples;-versionprints the EDirect version string.- Live testing without
EDIRECT_LOCAL_ARCHIVEfailed withMust supply path to local data by setting EDIRECT_LOCAL_ARCHIVE environment variablefollowed byUnable to get folder Postings for database pubmed. - Source inspection shows
-querywraps UID hits inENTREZ_DIRECTXML unless-rawis set;-match,-exact, and-titlecallrchivedirectly instead. -wordsand-pairstokenize the query throughword-at-a-timeandfilter-stop-words, then rank title hits withsort-uniq-count-rank -n.- If you omit
-db, the script defaults topubmed.