This issue came when this library creating multiple group by and if db has $prefix then it append two times because getColumns() calls twice in SearchableTrait
First in scopeSearchRestricted() function and secondly in makeGroupBy() functions
I found a solution that we need to replace code from line 209 to 2016 with below code
$prefix = Config::get("database.connections.$driver.prefix"); foreach ($this->getColumns() as $column => $relevance) { array_map(function ($join) use ($column, $query, $prefix) { if (Str::contains($column, $join)) { $column = str_replace($prefix, "", $column); $query->groupBy($column); } }, $joins); }
This resolves the issue. @nicolaslopezj can you please make these changes to the library
This issue came when this library creating multiple group by and if db has $prefix then it append two times because getColumns() calls twice in SearchableTrait First in scopeSearchRestricted() function and secondly in makeGroupBy() functions
I found a solution that we need to replace code from line 209 to 2016 with below code
$prefix = Config::get("database.connections.$driver.prefix"); foreach ($this->getColumns() as $column => $relevance) { array_map(function ($join) use ($column, $query, $prefix) { if (Str::contains($column, $join)) { $column = str_replace($prefix, "", $column); $query->groupBy($column); } }, $joins); }
This resolves the issue. @nicolaslopezj can you please make these changes to the library