@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $manticore = new ManticoreSearch; |
| 64 | 64 | $manticore->truncateRTIndex(Arr::wrap('releases_rt')); |
| 65 | 65 | $total = Release::count(); |
| 66 | - if (! $total) { |
|
| 66 | + if (!$total) { |
|
| 67 | 67 | $this->warn('Releases table is empty. Nothing to do.'); |
| 68 | 68 | exit(); |
| 69 | 69 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id']) |
| 84 | 84 | ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename') |
| 85 | 85 | ->groupBy('id') |
| 86 | - ->chunk($max, function ($releases) use ($manticore, $bar) { |
|
| 86 | + ->chunk($max, function($releases) use ($manticore, $bar) { |
|
| 87 | 87 | $data = []; |
| 88 | 88 | foreach ($releases as $r) { |
| 89 | 89 | $data[] = [ |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | ]; |
| 98 | 98 | $bar->advance(); |
| 99 | 99 | } |
| 100 | - if (! empty($data)) { |
|
| 100 | + if (!empty($data)) { |
|
| 101 | 101 | $manticore->manticoreSearch->table('releases_rt')->replaceDocuments($data); |
| 102 | 102 | } |
| 103 | 103 | }); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $manticore->truncateRTIndex(['predb_rt']); |
| 115 | 115 | |
| 116 | 116 | $total = Predb::count(); |
| 117 | - if (! $total) { |
|
| 117 | + if (!$total) { |
|
| 118 | 118 | $this->warn('PreDB table is empty. Nothing to do.'); |
| 119 | 119 | exit(); |
| 120 | 120 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | ->select(['id', 'title', 'filename', 'source']) |
| 132 | 132 | ->groupBy('id') |
| 133 | 133 | ->orderBy('id') |
| 134 | - ->chunk($max, function ($pre) use ($manticore, $bar) { |
|
| 134 | + ->chunk($max, function($pre) use ($manticore, $bar) { |
|
| 135 | 135 | $data = []; |
| 136 | 136 | foreach ($pre as $p) { |
| 137 | 137 | $data[] = [ |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | ]; |
| 144 | 144 | $bar->advance(); |
| 145 | 145 | } |
| 146 | - if (! empty($data)) { |
|
| 146 | + if (!empty($data)) { |
|
| 147 | 147 | $manticore->manticoreSearch->table('predb_rt')->replaceDocuments($data); |
| 148 | 148 | } |
| 149 | 149 | }); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $data = ['body' => []]; |
| 158 | 158 | $elastic = new ElasticSearchSiteSearch; |
| 159 | 159 | $total = Release::count(); |
| 160 | - if (! $total) { |
|
| 160 | + if (!$total) { |
|
| 161 | 161 | $this->warn('Could not get database information for releases table.'); |
| 162 | 162 | exit(); |
| 163 | 163 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id', 'releases.postdate']) |
| 176 | 176 | ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename') |
| 177 | 177 | ->groupBy('id') |
| 178 | - ->chunk($max, function ($releases) use ($bar, $data) { |
|
| 178 | + ->chunk($max, function($releases) use ($bar, $data) { |
|
| 179 | 179 | foreach ($releases as $r) { |
| 180 | 180 | $searchName = str_replace(['.', '-'], ' ', $r->searchname); |
| 181 | 181 | $data['body'][] = [ |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | $data = ['body' => []]; |
| 209 | 209 | $elastic = new ElasticSearchSiteSearch; |
| 210 | 210 | $total = Predb::count(); |
| 211 | - if (! $total) { |
|
| 211 | + if (!$total) { |
|
| 212 | 212 | $this->warn('Could not get database information for predb table.'); |
| 213 | 213 | exit(); |
| 214 | 214 | } |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | ->select(['id', 'title', 'filename', 'source']) |
| 226 | 226 | ->groupBy('id') |
| 227 | 227 | ->orderBy('id') |
| 228 | - ->chunk($max, function ($pre) use ($bar, $data) { |
|
| 228 | + ->chunk($max, function($pre) use ($bar, $data) { |
|
| 229 | 229 | foreach ($pre as $p) { |
| 230 | 230 | $data['body'][] = [ |
| 231 | 231 | 'index' => [ |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | // Create each index |
| 97 | 97 | foreach ($indexes as $indexName => $schema) { |
| 98 | - if (! $this->createIndex($indexName, $schema, $dropExisting)) { |
|
| 98 | + if (!$this->createIndex($indexName, $schema, $dropExisting)) { |
|
| 99 | 99 | $hasErrors = true; |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $indices->drop(['index' => $indexName, 'body' => ['silent' => true]]); |
| 128 | 128 | $this->info("Successfully dropped {$indexName} index."); |
| 129 | 129 | } catch (ResponseException $e) { |
| 130 | - if (! str_contains($e->getMessage(), 'unknown index')) { |
|
| 130 | + if (!str_contains($e->getMessage(), 'unknown index')) { |
|
| 131 | 131 | $this->warn("Warning when dropping {$indexName} index: ".$e->getMessage()); |
| 132 | 132 | } |
| 133 | 133 | } |