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 searchables()->lazy and insertLazily methods to search indexes #9072

Conversation

ryanmitchell
Copy link
Contributor

Maybe not the right approach, but this PR works to reduce the memory usage of searchables()->all() by providing a searchables()->lazy() method returning a less memory heavy LazyCollection. It also updates Algolia and Comb to use this instead of searchables()->all().

It could be possible to take this a step further and have the provider return a lazy collection and then insert each document individually rather than multiple, but that would mean more http calls so maybe thats a trade off.

Should help with #8854

@jasonvarga jasonvarga merged commit 612ba32 into statamic:4.x Nov 28, 2023
18 checks passed
@ryanmitchell ryanmitchell deleted the fix/use-a-lazy-collection-for-search-insert-multiple branch December 2, 2023 22:40
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