47,7 → 47,7 |
// et utilise sphinx_search() (moteur_recherche_sphinx.php) |
// TODO: un test avec mysql_connect() sur le SPHINX_DSN tel que défini dans moteur_recherche_sphinx.php |
// pourrait être un plus. |
define('USE_SPHINX', FALSE); |
define('USE_SPHINX', TRUE); |
|
|
// +------------------------------------------------------------------------------------------------------+ |
58,7 → 58,7 |
'\{\{[[Mm]oteurRecherche'. |
'(?:\s*'. |
'(?:'. |
'(url="[^"]*")|'. |
'(url="[^"]*")|(sphinx="(?:0|1)")'. |
')'. |
')+'. |
'\s*\}\})'; |
143,6 → 143,7 |
$GLOBALS['_MOTEUR_RECHERCHE_']['variables'] = array(); |
$code_site = $_GEN_commun['url_site'];// identifiant du site courant. |
$url = $_GEN_commun['url']; |
$sphinx = array_key_exists('sphinx', $options) && $options['sphinx'] ? true : false; |
$url_id_type_site = GEN_URL_ID_TYPE_SITE; |
$indent_origine = 12;// Indentation de d�part en nombre d'espace |
$indent_pas = 4;// Pas d'indentation en nombre d'espace |
203,11 → 204,16 |
$moteur->ajouterRecherche($recherche_projet); |
} |
|
if(! USE_SPHINX) { |
$sphinx_connect = FALSE; |
if(USE_SPHINX && $sphinx) { |
require_once("moteur_recherche_sphinx.php"); |
$sphinx_connect = @mysql_connect(SPHINX_DSN, NULL, NULL, TRUE); |
error_log("sphinx: can't connect to " . SPHINX_DSN . ", traditionnal SQL fallback [moteur_recherche.php]"); |
} |
if(!$sphinx_connect) { |
// recherche traditionnelle |
$GLOBALS['_MOTEUR_RECHERCHE_']['resultat']['resultats'] = $moteur->rechercherMotif(); |
} else { |
require_once("moteur_recherche_sphinx.php"); |
// ce fichier/cette fonction peut-être réclamé plusieurs fois |
// car le motif du template '{{MoteurRecherche}}' est inclu récursivement, |
// (la première substitution fait réapparaître '{{MoteurRecherche}}') |