mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
MeiliSearch + Peers&Snatched table swip
This commit is contained in:
37
app/Console/Commands/MeiliSearchImport.php
Normal file
37
app/Console/Commands/MeiliSearchImport.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Repositories\MeiliSearchRepository;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class MeiliSearchImport extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'meilisearch:import';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$rep = new MeiliSearchRepository();
|
||||
$this->info("going to import torrents");
|
||||
$total = $rep->import();
|
||||
$this->info("import $total torrents.");
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
35
app/Console/Commands/MeiliSearchStats.php
Normal file
35
app/Console/Commands/MeiliSearchStats.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Repositories\MeiliSearchRepository;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class MeiliSearchStats extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'meilisearch:stats';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'get meilisearch stats info';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$rep = new MeiliSearchRepository();
|
||||
dump($rep->getClient()->stats());
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,7 @@ use App\Repositories\AgentAllowRepository;
|
||||
use App\Repositories\AttendanceRepository;
|
||||
use App\Repositories\ExamRepository;
|
||||
use App\Repositories\HitAndRunRepository;
|
||||
use App\Repositories\MeiliSearchRepository;
|
||||
use App\Repositories\PluginRepository;
|
||||
use App\Repositories\SearchBoxRepository;
|
||||
use App\Repositories\SearchRepository;
|
||||
@@ -95,10 +96,26 @@ class Test extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$r = log(10);
|
||||
$r2 = exp(10);
|
||||
$rep = new MeiliSearchRepository();
|
||||
// $r = $rep->doImportFromDatabase();
|
||||
// dd($r);
|
||||
// $r = $rep->import();
|
||||
|
||||
dd($r, $r2);
|
||||
$r = $rep->search([
|
||||
'search' => '200',
|
||||
'spstate' => 0,
|
||||
'incldead' => 0,
|
||||
'mode' => 4,
|
||||
// 'cat401' => 1,
|
||||
'sort' => '4',
|
||||
'type' => 'desc',
|
||||
'search_mode' => 0,
|
||||
'inclbookmarked' => 0,
|
||||
'approval_status' => 1,
|
||||
// 'size_end' => 20,
|
||||
// 'added_end' => '2023-02-11',
|
||||
], 1, 'incldead=0&spstate=1&inclbookmarked=0&approval_status=1&size_begin=&size_end=&seeders_begin=&seeders_end=&leechers_begin=&leechers_end=×_completed_begin=×_completed_end=&added_begin=&added_end=&search=200&search_area=0&search_mode=0');
|
||||
dd($r);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user