Craft Scout provides a simple solution for adding full-text search to your entries. Scout will automatically keep your search indexes in sync with your entries.
MIT License
81
stars
55
forks
source link
Make `SearchableBehavior::getRelatedElements()` configurable #273
I'm working on a Craft Commerce site with about ~250,000~ 650,000 SKUs.
At that scale, we hit memory limit exceeded errors for some of our Entries that have lots of relationships to Products.
Commenting out these lines in SearchableBehavior::getRelatedElements resolved our issue.
This got me thinking... for many use cases, checking all of these Element Types is overkill. Most of our indexes only have relations between Entry and Asset elements.
Our project still need to index relations, but by removing most Element types from that check, we improve our performance by quite a bit.
Overview
Bringing ticket https://github.com/studioespresso/craft-scout/issues/242 is back from the dead.
I'm working on a Craft Commerce site with about ~250,000~ 650,000 SKUs.
At that scale, we hit memory limit exceeded errors for some of our Entries that have lots of relationships to Products.
Commenting out these lines in SearchableBehavior::getRelatedElements resolved our issue.
This got me thinking... for many use cases, checking all of these Element Types is overkill. Most of our indexes only have relations between Entry and Asset elements.
Our project still need to index relations, but by removing most Element types from that check, we improve our performance by quite a bit.