-
Notifications
You must be signed in to change notification settings - Fork 110
Cache full text index fields #110
Comments
If I understand this extra sql query check if column support fulltext search. |
I check into code a bit more and seem that this extra query is executed for select and where, because we can't access toSearchableArray(). A possible workaround could be to add a static method or property into model with array of columns searchable and one fulltextable if different from searchable. Then in ModelService change method: public function getFullTextIndexFields()
{
return $this->model::$fulltextable;
}
public function getSearchableFields()
{
return $this->model::$searchable;
} And we could also access directly from builder using |
I saw that this package added a lot of queries to my application and at the part that adds the queries, you can see a comment
@TODO cache this.
.laravel-scout-mysql-driver/src/Services/ModelService.php
Line 50 in b777fcb
Same thing in the
getAllFields
method.I suggest adding a command
scout:mysql-cache
.Is there anything preventing us from caching? Otherwise I'll gladly add a PR.
The text was updated successfully, but these errors were encountered: