nicolaslopezj / searchable

A php trait to search laravel models
MIT License
2.01k stars 291 forks source link

SQLITE SQLSTATE[HY000]: General error: 25 bind or column index out of range #145

Open isneezy opened 7 years ago

isneezy commented 7 years ago

First I'd like to say thanks for a such great library, helped me a lot in many projects Now I'm trying to use it with sqlite. When i use only Model::search no errors are raised but if I try to mix queries in this specific order Model::where('field', '=', 'value')->search('keyword') the exception is raised. As a work around, i had to invert the order of the scopes, calling search first and them others like this

$query = Products:query();
$query->search($keywords);
$query->where('company_id', '=', $company_id);
// ...other scopes

I could leave the code like this since it is working, but i think this will lead me to performance issues in the future when it'll have hundreds if not thousands of records.

Any idea to solve this issue?

isneezy commented 7 years ago

Oh i think this is related to #143