feat(search): add auditable multi-source literature search - #34
Open
jung233 wants to merge 6 commits into
Open
Conversation
Added PubMed as a fourth search source alongside OpenAlex, Semantic Scholar, and Crossref. Uses esearch + esummary endpoints to find papers by keyword. PMID is preserved for downstream linking. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Users expect more results when searching, especially for broad queries. Default limit increased from 10 to 50, and per_source from 5 to 10. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
jung233
force-pushed
the
codex/search-pubmed
branch
from
July 17, 2026 08:38
7239585 to
7a73fad
Compare
jung233
marked this pull request as ready for review
July 17, 2026 09:31
There was a problem hiding this comment.
Pull request overview
Adds PubMed as an additional search backend (via NCBI E-utilities) and increases default result limits to return more results by default, aligning web/API behavior with the expanded set of sources.
Changes:
- Add PubMed keyword search and include
pmid+sourcemetadata in merged results. - Increase default
limitfrom 10 to 50 in both the web request model andsearch_papers. - Expand parallel search fan-out (now 4 sources) and adjust per-source fetch sizing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/scansci_pdf/web.py | Raises default API search limit to 50 for the web endpoint. |
| src/scansci_pdf/search.py | Adds PubMed search integration and updates defaults/merge behavior for expanded multi-source searching. |
Comments suppressed due to low confidence (1)
src/scansci_pdf/search.py:257
as_completed(..., timeout=30)can raiseconcurrent.futures.TimeoutErrorif any source call takes longer than 30s, which would bubble up and fail the entire search. With an additional PubMed source (and an explicit sleep), this becomes more likely. Consider removing theas_completedtimeout and relying on per-request HTTP timeouts instead.
pool.submit(_search_pubmed, query, per_source, year_from, year_to): "pubmed",
}
for future in as_completed(futures, timeout=30):
try:
all_results.extend(future.result())
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
214
to
215
| """ | ||
| # --- Author-based search (fast path) --- |
Comment on lines
279
to
281
| if not existing.get("pmid") and r.get("pmid"): | ||
| existing["pmid"] = r["pmid"] | ||
| existing["source"] = existing.get("source", "") + "+" + r.get("source", "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/searchresult-array response by default; the advanced UI opts intodetailed: true/api/downloadpipeline unchangedTemplateResponsesignaturesCommit structure
31cce98Add auditable multi-source literature search9b65e63Expose advanced search in MCP and Web UI00b32b0Document advanced literature search workflowEach commit is usable on top of the previous one. No test files are included in the PR.
Compatibility
/api/searchis_directshapeoffsetis explicitly per-source; token/page limitations are reported as warningsVerification
All project execution was performed in isolated remote containers.
5e4a6f2(master), GitHubmergeable=true65 passed15 passed6 passed200, advanced UI present, legacy array response200, detailed Crossref search with provenance200false, restart count0, approximately 45 MiB / 56 MiB memory