@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public function register() |
17 | 17 | { |
18 | - $this->app[EngineManager::class]->extend('tntsearch', function () { |
|
18 | + $this->app[EngineManager::class]->extend('tntsearch', function() { |
|
19 | 19 | $tnt = new TNTSearch(); |
20 | 20 | $tnt->loadConfig(config('scout.tntsearch')); |
21 | 21 |
@@ -36,6 +36,9 @@ |
||
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | + /** |
|
40 | + * @param TNTSearch $tnt |
|
41 | + */ |
|
39 | 42 | private function setFuzziness($tnt) |
40 | 43 | { |
41 | 44 | $prefix_length = config('scout.tntsearch.fuzzy.prefix_length'); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function update($models) |
32 | 32 | { |
33 | 33 | $this->initIndex($models->first()); |
34 | - $models->each(function ($model) { |
|
34 | + $models->each(function($model) { |
|
35 | 35 | $searchableFields = $this->getSearchableFields($model); |
36 | 36 | |
37 | 37 | $this->tnt->selectIndex("{$model->searchableAs()}.index"); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | public function delete($models) |
55 | 55 | { |
56 | 56 | $this->initIndex($models->first()); |
57 | - $models->each(function ($model) { |
|
57 | + $models->each(function($model) { |
|
58 | 58 | $this->tnt->selectIndex("{$model->searchableAs()}.index"); |
59 | 59 | $index = $this->tnt->getIndex(); |
60 | 60 | $index->delete($model->id); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | protected function filters(Builder $builder) |
115 | 115 | { |
116 | - return collect($builder->wheres)->map(function ($value, $key) { |
|
116 | + return collect($builder->wheres)->map(function($value, $key) { |
|
117 | 117 | return $key.'='.$value; |
118 | 118 | })->values()->all(); |
119 | 119 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $model->getKeyName(), $keys |
137 | 137 | )->get()->keyBy($model->getKeyName()); |
138 | 138 | |
139 | - return collect($results['ids'])->map(function ($hit) use ($models) { |
|
139 | + return collect($results['ids'])->map(function($hit) use ($models) { |
|
140 | 140 | return $models[$hit]; |
141 | 141 | }); |
142 | 142 | } |