Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Give SegmentWriter a cachable Searcher #8

Merged

Conversation

ZeroCool940711
Copy link
Contributor

Adding and merging PR #15 from the mchaput/whoosh repo.

When repeatedly calling `update_document()`, each call instantiates a
`Searcher`, which is expensive. The `SegmentWriter` already has a
write lock on the index, so if the conditions are right, let's cache a
`Searcher`, override its closing method to keep it open, and close it
on `_finish()` if it's around.
Also don't cache a `Searcher` if the `SegmentWriter` is closed.
@ZeroCool940711 ZeroCool940711 merged commit 6411df2 into Sygil-Dev:main Jan 3, 2024
2 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.

2 participants