diff --git a/src/Engines/ScoutPhpmorphyEngine.php b/src/Engines/ScoutPhpmorphyEngine.php index 09129ee..c304e90 100755 --- a/src/Engines/ScoutPhpmorphyEngine.php +++ b/src/Engines/ScoutPhpmorphyEngine.php @@ -54,7 +54,6 @@ public function search(Builder $builder) public function paginate(Builder $builder, $perPage, $page) { - $index = $this->buildIndexQuery($builder) ->selectRaw('`index`, `key`, COUNT(*) AS `count_lines`, SUM(`count_words`) AS `sum_count_words`') ->groupBy('index', 'key') @@ -71,7 +70,6 @@ public function mapIds($results) public function map(Builder $builder, $results, $model) { - if ($results->isEmpty()) { return $model->newCollection(); } diff --git a/src/Models/Word.php b/src/Models/Word.php index 0c24c86..5cac368 100644 --- a/src/Models/Word.php +++ b/src/Models/Word.php @@ -17,7 +17,7 @@ class Word extends Model public function getTable() { - return config('scout-phpmorphy.table_prefix') . 'words'; + return config('scout-phpmorphy.table_prefix').'words'; } protected $fillable = [ @@ -46,7 +46,7 @@ public static function getOrCreateItems($array): Collection public static function getItems($array): Collection { $items = new Collection; - if (! empty($array)) { + if (! empty($array)) { $items = self::query() ->when(array_filter($array, fn ($word) => $word['is_dictionary']), fn (Builder $query, $words) => $query->whereIn('word', collect($words)->pluck('word')))