Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 2117 → Rev 2118

/trunk/papyrus/applettes/moteur_recherche/moteur_recherche.php
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}}')
/trunk/papyrus/applettes/moteur_recherche/sphinx-min.conf
171,6 → 171,7
# SPIP
source spip : common
{
# sql_db = tela_prod_spip_actu
# bibliotheque/more_recherche_spip_article.class.php
# premier champ = index (obligatoire)