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

[4.x] Provide searchable entries and terms lazily #9171

Conversation

ryanmitchell
Copy link
Contributor

Now that the query builder supports lazy, the searchable provider provide() method can make use of that to return documents in a more memory efficient manner.

The PR updates the interface to allow this method to return a LazyCollection and updates both entries and terms to do that. It seems this is not a breaking change, as other providers still return a standard collection and I encountered no errors.

I notice that assets and users are not using a query builder (they are just returning a filtered all()), so there is definitely scope to improve things further by updating those providers to do that.

This should close #8854

@duncanmcclean duncanmcclean merged commit 9e212c2 into statamic:4.x Dec 14, 2023
18 checks passed
@ryanmitchell ryanmitchell deleted the fix/provide-searchable-documents-lazily branch January 19, 2024 11:24
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.

Poor Memory Management with Search Indexes (Searchables)
2 participants