Skip to content

Support multi-archive search and SearchResult with snippets - #276

Merged
benoit74 merged 1 commit into
openzim:mainfrom
Sriram-Nambiar:multi-archive-search-and-snippets
Oct 25, 2026
Merged

benoit74 merged 1 commit into
openzim:mainfrom
Sriram-Nambiar:multi-archive-search-and-snippets

Conversation

@Sriram-Nambiar

@Sriram-Nambiar Sriram-Nambiar commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #230 Fixes #226

  • Support multi-archive searching in Searcher: can be initialized empty, with a list of archives, or populated via add_archive() (also aliased as addArchive()).

  • search.getResults() yields SearchResult objects exposing archive, path, title, and snippet (instead of just raw path strings).

  • SearchResult compares equal to str matching its path so existing code and tests expecting entry paths do not break.

Comment thread libzim/search.pyi

@benoit74 benoit74 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We modify the SearchResultSet but this is OK since this will be a major release.

Please:

  • mention this breaking change in CHANGELOG
  • bump version in pyproject.toml to 4.0.0-dev0 so that we do not release this as a minor by mistake

@benoit74

Copy link
Copy Markdown
Contributor

@Sriram-Nambiar please rebase on main and force push with lease, so that we have tests running on this PR

@Sriram-Nambiar
Sriram-Nambiar force-pushed the multi-archive-search-and-snippets branch from c35621f to 61da1b0 Compare October 22, 2026 12:47
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.11%. Comparing base (2f93930) to head (8443a4f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #276      +/-   ##
==========================================
+ Coverage   94.83%   95.11%   +0.28%     
==========================================
  Files           1        1              
  Lines         600      635      +35     
==========================================
+ Hits          569      604      +35     
  Misses         31       31              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@benoit74

Copy link
Copy Markdown
Contributor

Please fix QA and try to hit 100% patch code coverage

@Sriram-Nambiar
Sriram-Nambiar force-pushed the multi-archive-search-and-snippets branch 2 times, most recently from 73f7e1d to 4a36aef Compare October 22, 2026 14:13
Comment thread CHANGELOG.md Outdated
@Sriram-Nambiar
Sriram-Nambiar force-pushed the multi-archive-search-and-snippets branch from 4a36aef to 47df69c Compare October 23, 2026 12:24
@benoit74
benoit74 force-pushed the multi-archive-search-and-snippets branch 3 times, most recently from 573b148 to d711dd4 Compare October 25, 2026 19:46
@benoit74
benoit74 force-pushed the multi-archive-search-and-snippets branch from d711dd4 to 8443a4f Compare October 25, 2026 20:02
@benoit74
benoit74 merged commit 4a5f431 into openzim:main Oct 25, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple archive searcher Support getSnippet

3 participants