Spatie Query Builder Partial doesnt work #3271
Unanswered
masterbater
asked this question in
Q&A
Replies: 1 comment
-
This should be implemented using Regex.
This should be done in the spacie project, if they accept to add support for MongoDB. I asked spatie/laravel-query-builder#995 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Looking at this, this is the cause why
By default, all values passed to allowedFilters are converted to partial filters. The underlying query will be modified to use a LIKE LOWER(%value%) statement. Because this can cause missed indexes, it's often worth considering a beginsWithStrict filter for the beginning of the value, or an endsWithStrict filter for the end of the value. These filters will use a LIKE value% statement and a LIKE %value statement respectively, instead of the default partial filter. This can help optimize query performance and index utilization.
https://github.com/spatie/laravel-query-builder/blob/dc7c17a9dfc2df44d108a696cbc20158af622fa3/src/Filters/FiltersPartial.php
Would anyone share their custom filter solution that can replace this?
https://spatie.be/docs/laravel-query-builder/v6/features/filtering#content-custom-filters
Beta Was this translation helpful? Give feedback.
All reactions