mirror of
https://gitlab.aliens-lyon.fr/savrillo/gpens.git
synced 2026-09-11 18:30:45 +02:00
Ajout de TNTSearch. Faut coder maintenant ...
This commit is contained in:
+11
-1
@@ -1,14 +1,24 @@
|
||||
<?php
|
||||
|
||||
use 'tntsearch/src/TNTSearch.php'
|
||||
|
||||
// Active les erreurs PHP.
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$tnt = new TNTSearch;
|
||||
|
||||
// Se connecte à la BDD (identifiants cachés)
|
||||
// Charge les paramètres de tnt dans $tntconfig
|
||||
include 'dbinit.php';
|
||||
|
||||
$tnt->loadConfig($tntconfig);
|
||||
|
||||
$indexer = $tnt->createIndex('tntsearch/sallesNoms.index');
|
||||
$indexer->query('SELECT id, nom FROM sallesAlias;');
|
||||
$indexer->setLanguage('french');
|
||||
$indexer->run();
|
||||
|
||||
if(isset($_GET["salle"])) {
|
||||
|
||||
@@ -57,7 +67,7 @@ if(isset($_GET["salle"])) {
|
||||
} else if (isset($_GET["research"])) {
|
||||
$research = $_GET["research"];
|
||||
|
||||
$stmt = $conn->prepare("SELECT salleID, nom FROM salleAlias WHERE MATCH nom AGAINST (? IN BOOLEAN MODE)");
|
||||
$stmt = $conn->prepare("SELECT salleID, nom FROM salleAlias WHERE MATCH nom AGAINST (? IN BOOLEAN MODE)");
|
||||
$stmt->execute([$research]);
|
||||
$res = $stmt->fetchAll();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user