Skip to content

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

Open
Sriram-Nambiar wants to merge 1 commit into
openzim:mainfrom
Sriram-Nambiar:multi-archive-search-and-snippets
Open

Sriram-Nambiar wants to merge 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

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

❌ Patch coverage is 80.95238% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.09%. Comparing base (727f77f) to head (61da1b0).

Files with missing lines Patch % Lines
libzim/libzim.pyx 80.95% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #276      +/-   ##
==========================================
- Coverage   94.08%   93.09%   -1.00%     
==========================================
  Files           1        1              
  Lines         541      579      +38     
==========================================
+ Hits          509      539      +30     
- Misses         32       40       +8     

☔ 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
### Added

- Add a CI job building the documentation on every PR/push so this kind of breakage is caught automatically (#279)
- Add support for Python 3.15 (#281)

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.

I don't think this PR has anything to do with documentation or Python 3.15 support

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I am really sorry

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

while doing the rebase and resolving the conflict the lines got misplaced by mistake. I have sorted it out now so only the changes related to this PR are included

@Sriram-Nambiar
Sriram-Nambiar force-pushed the multi-archive-search-and-snippets branch from 4a36aef to 47df69c Compare October 23, 2026 12:24

This branch has not been deployed

No deployments
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