ajoute la recherche plein texte dans les cours et labs (bloc C)
Elasticsearch interne (jamais exposé, sécurité x-pack désactivée, cohérent avec le reste des services internes de ce serveur), tas JVM fixé à 512 Mo plutôt que le calcul automatique (jusqu'à 50 % de la RAM système, désastreux sur ce serveur à 31 Go réels). Appels HTTP directs depuis Laravel, pas de bibliothèque cliente pour un besoin aussi simple. Index reconstruit après chaque synchronisation du catalogue, page de recherche commune aux profs et aux élèves. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
e549f03e1b
commit
777dd1cbc8
20 changed files with 545 additions and 0 deletions
30
portail/app/Console/Commands/IndexerRecherche.php
Normal file
30
portail/app/Console/Commands/IndexerRecherche.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Services\Recherche\IndexRecherche;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Rejoue l'index de recherche (bloc C) depuis les tables labs/cours —
|
||||
* appelé après labs:synchroniser et cours:synchroniser, et disponible ici
|
||||
* pour une reconstruction manuelle (changement de mapping, par exemple).
|
||||
*/
|
||||
class IndexerRecherche extends Command
|
||||
{
|
||||
protected $signature = 'recherche:indexer';
|
||||
|
||||
protected $description = 'Reconstruit l’index de recherche (cours et labs) dans Elasticsearch';
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
if (! IndexRecherche::disponible()) {
|
||||
$this->warn('Elasticsearch non configuré : rien à indexer.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
IndexRecherche::reconstruire();
|
||||
$this->info('Index reconstruit.');
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ namespace App\Console\Commands;
|
|||
|
||||
use App\Models\Cours;
|
||||
use App\Services\Catalogue\CacheCatalogue;
|
||||
use App\Services\Recherche\IndexRecherche;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
|
@ -44,5 +45,6 @@ class SynchroniserCours extends Command
|
|||
}
|
||||
|
||||
CacheCatalogue::viderCours();
|
||||
IndexRecherche::reconstruire();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ namespace App\Console\Commands;
|
|||
use App\Models\Lab;
|
||||
use App\Services\Catalogue\CacheCatalogue;
|
||||
use App\Services\Labs\DefinitionLab;
|
||||
use App\Services\Recherche\IndexRecherche;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
|
|
@ -32,5 +33,6 @@ class SynchroniserLabs extends Command
|
|||
}
|
||||
|
||||
CacheCatalogue::viderLabs();
|
||||
IndexRecherche::reconstruire();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue