From 903dc305f34118855c39a34d8b764ffa15f5df53 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Mon, 31 Oct 2011 09:53:31 +0000 Subject: [PATCH 01/16] --- Sphinx.sh | 75 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 14 deletions(-) diff --git a/Sphinx.sh b/Sphinx.sh index a63cc83..4b80835 100755 --- a/Sphinx.sh +++ b/Sphinx.sh @@ -2,6 +2,36 @@ #This program as been create by Damien for Scores et decisions ste #Email : dlasserre@scores-decisions.com allVersion=("2.0.1" "0.9.9") +declare -A ERREURS +declare -A ASTUCES + +#Color declaration +ROUGE="\\033[1;31m" +NORMAL="\\033[0;39m" +CYAN="\\033[1;36m" +VERT="\\033[1;32m" + +BOLD="\\033[1m" +UNDERLINE="\\033[4m" +TEXTNONE="\\033[0m" + +#Var +dir="Exist" +log="Exist" +dbs="Exist" +sphinx="Exist" +sphinxlog="Exist" + +#Tab of erreurs and astuces +ERREURS=( + ["CHMOD"]="Execute the script with SUDO or in ROOT" + ["DIRECTORY"]="Directory not create" + ["FILE"]= "" + ["CMD"]="This command not exist" + ["NOCMD"]="Please enter options") + +ASTUCES=( + ["CREATE"]="Sphinx --create (prepare l'environement)"); function loadIndication() { while [ -d "/proc/$1" ] @@ -38,9 +68,10 @@ then ## if [ ! -e /dbs/sphinx ];then echo -e "/dbs/sphinx Doesn't exist !"; exit; fi - if [ ! -e /dbs/sphinxlog ];then echo -e "/dbs/sphinxlog Doesn't exist !"; exit; fi - if [ ! -e /usr/local/sphinx ];then echo -e "/usr/local/sphinx Doesn't exist !"; exit; fi - if [ ! -e /init.d/sphinxsearch ];then `cp initscript/sphinxsearch /etc/init.d/; update-rc.d sphinxsearch defaults`; fi + if [ ! -e /dbs/sphinxlog ];then `mkdir /dbs/sphinxlog`; exit; fi + if [ ! -e /usr/local/sphinx ];then `mkdir /dbs/sphinx`; exit; fi + if [ ! -e /init.d/sphinxsearch ];then `cp initscript/sphinxsearch /etc/init.d/; chmod +x /etc/init.d/sphinxsearch ;update-rc.d sphinxsearch defaults`; fi + if [ ! -e config/${HOSTNAME} ];then `mkdir config/${HOSTNAME}`;fi #Check if package in directory, if you want to download manually the package if [ ! -e sphinx-2.0.1.tar.gz ] || [ ! -e sphinx-0.9.9.tar.gz ] then @@ -87,20 +118,36 @@ then echo -e $NORMAL"- Complited" echo -e $NORMAL echo -e $CYAN"Compilation progress..."$ROUGE - #if [ $version != "2.0.1-beta" ];then `cd tmp/sphinx-$version ; make ` ; + #if [ $version != "2.0.1-beta" ];then `cd tmp/sphinx-$version ; make; make install ` ; #else - #`cd tmp/sphinx-$version/ ; make install 1> /dev/null`;fi + #`cd tmp/sphinx-$version/ ; make; make install`;fi echo -e $NORMAL" - Complited" echo -n "Machine MASTER ? (y/n) : "; read response - `touch /usr/local/sphinx/sphinx.conf`; - `cat config/${HOSTNAME}/sphinx.conf > /usr/local/sphinx/sphinx.conf`; - if [ $response = 'y' ];then - echo -e $ROUGE"Mode MASTER activated"$NORMAL - `cat config/${HOSTNAME}/*.conf-MysqlServer >> /usr/local/sphinx/sphinx.conf`; - else - echo -e $ROUGE"Mode SLAVE activated"$NORMAL - `cat config/${HOSTNAME}/*.conf-MysqlServerSlave >> /usr/local/sphinx/sphinx.conf`; - fi + `touch /usr/local/sphinx/sphinx.conf`; + echo -e $ROUGE"Mode MASTER activated"$NORMAL + echo -e "Tapez 'stop' pour quiter l'invite de création des indexes" + while [ indexe != "stop\n" ]; do + echo -e " Entrez indexe : "; read indexe + if [ $response = 'y' ];then + if [ -e config/base/Master/$indexe.conf-MysqlServer ] + then + `cp config/base/Master/$indexe.conf-MysqlServer config/${HOSTNAME}/` + echo -e "Indexe $indexes as been create !"; + else + break; + fi + else + if [ -e config/base/Slave/$indexe.conf-MysqlServer ] + then + `cp config/base/Slave/$indexe.conf-MysqlServer config/${HOSTNAME}/` + echo -e "Indexe $indexes as been create !"; + else + break; + fi + fi + done; + `cat config/base/sphinx.conf > /usr/local/sphinx/sphinx.conf `; + `cat config/${HOSTNAME}/*.conf-MysqlServer >> /usr/local/sphinx/sphinx.conf`; echo -e $VERT"The installation as been finish ! great ! thank's damien :)"$NORMAL exit ;; From 56ed01c0f21a544f2f55cd2b399fa88e4281fbb0 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Wed, 2 Nov 2011 08:08:48 +0000 Subject: [PATCH 02/16] --- config/Sphinx/act.conf-MysqlServer | 31 -------- config/Sphinx/act.conf-MysqlServerSlave | 31 -------- config/Sphinx/cmp.conf-MysqlServer | 40 ---------- config/Sphinx/cmp.conf-MysqlServerSlave | 40 ---------- config/Sphinx/dir.conf-MysqlServer | 45 ------------ config/Sphinx/dir.conf-MysqlServerSlave | 45 ------------ config/Sphinx/ent.conf-MysqlServer | 44 ----------- config/Sphinx/ent.conf-MysqlServerSlave | 44 ----------- config/Sphinx/histo.conf-MysqlServer | 39 ---------- config/Sphinx/sphinx.conf | 77 -------------------- config/SphinxHisto/act.conf-MysqlServer | 40 ---------- config/SphinxHisto/act.conf-MysqlServerSlave | 40 ---------- config/SphinxHisto/cmp.conf-MysqlServer | 40 ---------- config/SphinxHisto/cmp.conf-MysqlServerSlave | 40 ---------- config/SphinxHisto/dir.conf-MysqlServer | 59 --------------- config/SphinxHisto/dir.conf-MysqlServerSlave | 59 --------------- config/SphinxHisto/ent.conf-MysqlServer | 72 ------------------ config/SphinxHisto/ent.conf-MysqlServerSlave | 72 ------------------ config/SphinxHisto/histo.conf-MysqlServer | 39 ---------- config/SphinxHisto/sphinx.conf | 77 -------------------- config/sdsrvws02/act.conf-MysqlServer | 31 -------- config/sdsrvws02/act.conf-MysqlServerSlave | 31 -------- config/sdsrvws02/cmp.conf-MysqlServer | 40 ---------- config/sdsrvws02/cmp.conf-MysqlServerSlave | 40 ---------- config/sdsrvws02/dir.conf-MysqlServer | 45 ------------ config/sdsrvws02/dir.conf-MysqlServerSlave | 45 ------------ config/sdsrvws02/ent.conf-MysqlServer | 44 ----------- config/sdsrvws02/ent.conf-MysqlServerSlave | 44 ----------- config/sdsrvws02/histo.conf-MysqlServer | 39 ---------- config/sdsrvws02/sphinx.conf | 77 -------------------- 30 files changed, 1410 deletions(-) delete mode 100644 config/Sphinx/act.conf-MysqlServer delete mode 100644 config/Sphinx/act.conf-MysqlServerSlave delete mode 100644 config/Sphinx/cmp.conf-MysqlServer delete mode 100644 config/Sphinx/cmp.conf-MysqlServerSlave delete mode 100644 config/Sphinx/dir.conf-MysqlServer delete mode 100644 config/Sphinx/dir.conf-MysqlServerSlave delete mode 100644 config/Sphinx/ent.conf-MysqlServer delete mode 100644 config/Sphinx/ent.conf-MysqlServerSlave delete mode 100644 config/Sphinx/histo.conf-MysqlServer delete mode 100644 config/Sphinx/sphinx.conf delete mode 100644 config/SphinxHisto/act.conf-MysqlServer delete mode 100644 config/SphinxHisto/act.conf-MysqlServerSlave delete mode 100644 config/SphinxHisto/cmp.conf-MysqlServer delete mode 100644 config/SphinxHisto/cmp.conf-MysqlServerSlave delete mode 100644 config/SphinxHisto/dir.conf-MysqlServer delete mode 100644 config/SphinxHisto/dir.conf-MysqlServerSlave delete mode 100644 config/SphinxHisto/ent.conf-MysqlServer delete mode 100644 config/SphinxHisto/ent.conf-MysqlServerSlave delete mode 100644 config/SphinxHisto/histo.conf-MysqlServer delete mode 100644 config/SphinxHisto/sphinx.conf delete mode 100644 config/sdsrvws02/act.conf-MysqlServer delete mode 100644 config/sdsrvws02/act.conf-MysqlServerSlave delete mode 100644 config/sdsrvws02/cmp.conf-MysqlServer delete mode 100644 config/sdsrvws02/cmp.conf-MysqlServerSlave delete mode 100644 config/sdsrvws02/dir.conf-MysqlServer delete mode 100644 config/sdsrvws02/dir.conf-MysqlServerSlave delete mode 100644 config/sdsrvws02/ent.conf-MysqlServer delete mode 100644 config/sdsrvws02/ent.conf-MysqlServerSlave delete mode 100644 config/sdsrvws02/histo.conf-MysqlServer delete mode 100644 config/sdsrvws02/sphinx.conf diff --git a/config/Sphinx/act.conf-MysqlServer b/config/Sphinx/act.conf-MysqlServer deleted file mode 100644 index 9682316..0000000 --- a/config/Sphinx/act.conf-MysqlServer +++ /dev/null @@ -1,31 +0,0 @@ -source source_act -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, Siren1, RaisonSociale, Siren2, actif, dateLien, IF(dateUpdate>dateInsert,dateUpdate,dateInsert) as dateMaj, \ - source, Pmin*1 AS PminNum, MajMin, PpPm, IF(Pays='','FRA',Pays) AS Pays \ - FROM liens \ - WHERE ActionPart=1 AND Siren1>1000 AND Siren1 IN (SELECT DISTINCT SIREN FROM etablissements_old); - sql_attr_uint = actif - sql_attr_uint = source - sql_attr_uint = PminNum - sql_attr_str2ordinal= MajMin - sql_attr_str2ordinal= PpPm - sql_attr_str2ordinal= Pays -} - -index act -{ - source = source_act - path = /dbs/sphinx/act - docinfo = extern - morphology = none - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/Sphinx/act.conf-MysqlServerSlave b/config/Sphinx/act.conf-MysqlServerSlave deleted file mode 100644 index 9682316..0000000 --- a/config/Sphinx/act.conf-MysqlServerSlave +++ /dev/null @@ -1,31 +0,0 @@ -source source_act -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, Siren1, RaisonSociale, Siren2, actif, dateLien, IF(dateUpdate>dateInsert,dateUpdate,dateInsert) as dateMaj, \ - source, Pmin*1 AS PminNum, MajMin, PpPm, IF(Pays='','FRA',Pays) AS Pays \ - FROM liens \ - WHERE ActionPart=1 AND Siren1>1000 AND Siren1 IN (SELECT DISTINCT SIREN FROM etablissements_old); - sql_attr_uint = actif - sql_attr_uint = source - sql_attr_uint = PminNum - sql_attr_str2ordinal= MajMin - sql_attr_str2ordinal= PpPm - sql_attr_str2ordinal= Pays -} - -index act -{ - source = source_act - path = /dbs/sphinx/act - docinfo = extern - morphology = none - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/Sphinx/cmp.conf-MysqlServer b/config/Sphinx/cmp.conf-MysqlServer deleted file mode 100644 index d01a87e..0000000 --- a/config/Sphinx/cmp.conf-MysqlServer +++ /dev/null @@ -1,40 +0,0 @@ - -source comptage -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = root - sql_pass = scores - sql_db = jo - sql_port = 3306 - sql_query = SELECT id,ape_etab,ape_entrep,source,siren,nic,actif,siege,adr_cp,adr_dep,adr_com,(tel>100000000) AS tel,(fax>100000000) AS fax,cj,capital,age_entrep,age_etab,tca,tcaexp,teff_entrep,teff_etab,rang,dateCrea_etab,eff_entrep,eff_etab,nbEtab,bilType,bilAnnee,bilTca,bilCA,bilCAexp,bilRN FROM etablissements_act; - sql_attr_str2ordinal = bilType - sql_attr_uint = source - sql_attr_uint = actif - sql_attr_uint = siege - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = adr_com - sql_attr_uint = tel - sql_attr_uint = fax - sql_attr_uint = cj - sql_attr_uint = capital - sql_attr_uint = age_entrep - sql_attr_uint = age_etab - sql_attr_uint = tca - sql_attr_uint = tcaexp - sql_attr_uint = teff_entrep - sql_attr_uint = teff_etab - sql_attr_uint = rang - sql_attr_uint = dateCrea_etab - sql_attr_uint = eff_entrep - sql_attr_uint = eff_etab - sql_attr_uint = nbEtab - sql_attr_uint = bilAnnee - sql_attr_uint = bilTca - sql_attr_uint = bilCA - sql_attr_uint = bilCAexp - sql_attr_uint = bilRN - - sql_query_info = SELECT siren, nic, ape_etab,ape_entrep, raisonSociale, enseigne, sigle, adr_libVoie, adr_cp, adr_ville FROM etablissements WHERE id=$id; -} \ No newline at end of file diff --git a/config/Sphinx/cmp.conf-MysqlServerSlave b/config/Sphinx/cmp.conf-MysqlServerSlave deleted file mode 100644 index d01a87e..0000000 --- a/config/Sphinx/cmp.conf-MysqlServerSlave +++ /dev/null @@ -1,40 +0,0 @@ - -source comptage -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = root - sql_pass = scores - sql_db = jo - sql_port = 3306 - sql_query = SELECT id,ape_etab,ape_entrep,source,siren,nic,actif,siege,adr_cp,adr_dep,adr_com,(tel>100000000) AS tel,(fax>100000000) AS fax,cj,capital,age_entrep,age_etab,tca,tcaexp,teff_entrep,teff_etab,rang,dateCrea_etab,eff_entrep,eff_etab,nbEtab,bilType,bilAnnee,bilTca,bilCA,bilCAexp,bilRN FROM etablissements_act; - sql_attr_str2ordinal = bilType - sql_attr_uint = source - sql_attr_uint = actif - sql_attr_uint = siege - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = adr_com - sql_attr_uint = tel - sql_attr_uint = fax - sql_attr_uint = cj - sql_attr_uint = capital - sql_attr_uint = age_entrep - sql_attr_uint = age_etab - sql_attr_uint = tca - sql_attr_uint = tcaexp - sql_attr_uint = teff_entrep - sql_attr_uint = teff_etab - sql_attr_uint = rang - sql_attr_uint = dateCrea_etab - sql_attr_uint = eff_entrep - sql_attr_uint = eff_etab - sql_attr_uint = nbEtab - sql_attr_uint = bilAnnee - sql_attr_uint = bilTca - sql_attr_uint = bilCA - sql_attr_uint = bilCAexp - sql_attr_uint = bilRN - - sql_query_info = SELECT siren, nic, ape_etab,ape_entrep, raisonSociale, enseigne, sigle, adr_libVoie, adr_cp, adr_ville FROM etablissements WHERE id=$id; -} \ No newline at end of file diff --git a/config/Sphinx/dir.conf-MysqlServer b/config/Sphinx/dir.conf-MysqlServer deleted file mode 100644 index be3e753..0000000 --- a/config/Sphinx/dir.conf-MysqlServer +++ /dev/null @@ -1,45 +0,0 @@ -source source_dir -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, siren, actif, \ -IF(civilite='M',1,IF(civilite='MME' OR civilite='MLLE',2,0)) AS genre, \ -CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \ - YEAR(naissance_date) AS naiss_annee, \ -MONTH(naissance_date) AS naiss_mois, \ - DAY(naissance_date) AS naiss_jour, \ -naissance_lieu, adr_dep \ -FROM rncs_dirigeants; -# UNION \ -#SELECT id, siren, 0 AS actif, \ -#'' AS genre, \ -#CONCAT(nom,' ',nomUsage,' ',rs) AS nom, prenom, \ -#0 AS naiss_annee, \ -#0 AS naiss_mois, \ -#0 AS naiss_jour, \ -#'' AS naissance_lieu, 0 AS adr_dep \ -#FROM bodacc_dirigeants_histo; - sql_attr_uint = naiss_annee - sql_attr_uint = naiss_mois - sql_attr_uint = naiss_jour - sql_attr_uint = actif - sql_attr_uint = genre - sql_attr_uint = adr_dep -} - -index dir -{ - source = source_dir - path = /dbs/sphinx/dir - docinfo = extern - morphology = none - #ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/Sphinx/dir.conf-MysqlServerSlave b/config/Sphinx/dir.conf-MysqlServerSlave deleted file mode 100644 index be3e753..0000000 --- a/config/Sphinx/dir.conf-MysqlServerSlave +++ /dev/null @@ -1,45 +0,0 @@ -source source_dir -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, siren, actif, \ -IF(civilite='M',1,IF(civilite='MME' OR civilite='MLLE',2,0)) AS genre, \ -CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \ - YEAR(naissance_date) AS naiss_annee, \ -MONTH(naissance_date) AS naiss_mois, \ - DAY(naissance_date) AS naiss_jour, \ -naissance_lieu, adr_dep \ -FROM rncs_dirigeants; -# UNION \ -#SELECT id, siren, 0 AS actif, \ -#'' AS genre, \ -#CONCAT(nom,' ',nomUsage,' ',rs) AS nom, prenom, \ -#0 AS naiss_annee, \ -#0 AS naiss_mois, \ -#0 AS naiss_jour, \ -#'' AS naissance_lieu, 0 AS adr_dep \ -#FROM bodacc_dirigeants_histo; - sql_attr_uint = naiss_annee - sql_attr_uint = naiss_mois - sql_attr_uint = naiss_jour - sql_attr_uint = actif - sql_attr_uint = genre - sql_attr_uint = adr_dep -} - -index dir -{ - source = source_dir - path = /dbs/sphinx/dir - docinfo = extern - morphology = none - #ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/Sphinx/ent.conf-MysqlServer b/config/Sphinx/ent.conf-MysqlServer deleted file mode 100644 index 26e4abd..0000000 --- a/config/Sphinx/ent.conf-MysqlServer +++ /dev/null @@ -1,44 +0,0 @@ -source source_ent -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\ -' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \ -actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \ -adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \ -FROM etablissements_tmp; - sql_attr_str2ordinal = adr_typeVoie - sql_attr_uint = siren - sql_attr_uint = nic - sql_attr_uint = siege - sql_attr_uint = adr_num - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = actif - sql_attr_uint = cj - sql_attr_uint = sirenValide - sql_attr_uint = rang - -} - -index ent -{ - source = source_ent - path = /dbs/sphinx/ent - docinfo = extern - wordforms = /usr/local/sphinx/etc/wordforms.txt - abreviations = /usr/local/sphinx/etc/abreviations.txt - ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/Sphinx/ent.conf-MysqlServerSlave b/config/Sphinx/ent.conf-MysqlServerSlave deleted file mode 100644 index 84d34ac..0000000 --- a/config/Sphinx/ent.conf-MysqlServerSlave +++ /dev/null @@ -1,44 +0,0 @@ -source source_ent -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\ -' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \ -actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \ -adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \ -FROM etablissements; - sql_attr_str2ordinal = adr_typeVoie - sql_attr_uint = siren - sql_attr_uint = nic - sql_attr_uint = siege - sql_attr_uint = adr_num - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = actif - sql_attr_uint = cj - sql_attr_uint = sirenValide - sql_attr_uint = rang - -} - -index ent -{ - source = source_ent - path = /dbs/sphinx/ent - docinfo = extern - wordforms = /usr/local/sphinx/etc/wordforms.txt - abreviations = /usr/local/sphinx/etc/abreviations.txt - ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/Sphinx/histo.conf-MysqlServer b/config/Sphinx/histo.conf-MysqlServer deleted file mode 100644 index 29473ad..0000000 --- a/config/Sphinx/histo.conf-MysqlServer +++ /dev/null @@ -1,39 +0,0 @@ -# -# Sphinx configuration file sample -# -# WARNING! While this sample file mentions all available options, -# it contains (very) short helper descriptions only. Please refer to -# doc/sphinx.html for details. -# - -############################################################################# -## data source definition -############################################################################# - -source histo -{ - type = mysql - sql_host = 192.168.78.230 - sql_user = sphinx_histo - sql_pass = sphinx - sql_db = histobodacc - sql_port = 3306 # optional, default is 3306 - sql_query = SELECT id, nomFichier, annee1, dateBod, texte FROM bodacc_ocr; - sql_attr_uint = annee1 - sql_query_info = SELECT * FROM bodacc_ocr WHERE id=$id -} - -############################################################################# -## index definition -############################################################################# - -index histo -{ - source = histo - path = /home/sphinx/histo - docinfo = extern - morphology = none - min_word_len = 1 - charset_type = sbcs - html_strip = 1 -} diff --git a/config/Sphinx/sphinx.conf b/config/Sphinx/sphinx.conf deleted file mode 100644 index b390725..0000000 --- a/config/Sphinx/sphinx.conf +++ /dev/null @@ -1,77 +0,0 @@ - -############################################################################# -## indexer settings -############################################################################# - -indexer -{ - # memory limit, in bytes, kiloytes (16384K) or megabytes (256M) - # optional, default is 32M, max is 2047M, recommended is 256M to 1024M - mem_limit = 256 - - # maximum IO calls per second (for I/O throttling) - # optional, default is 0 (unlimited) - # - # max_iops = 40 - - - # maximum IO call size, bytes (for I/O throttling) - # optional, default is 0 (unlimited) - # - # max_iosize = 1048576 -} - -############################################################################# -## searchd settings -############################################################################# - -searchd -{ - # IP address to bind on - # optional, default is 0.0.0.0 (ie. listen on all interfaces) - # - # address = 127.0.0.1 - # address = 192.168.0.1 - - - # searchd TCP port number - # mandatory, default is 3312 - listen = 3312 - - # log file, searchd run info is logged here - # optional, default is 'searchd.log' - log = /dbs/sphinxlog/searchd.log - - # query log file, all search queries are logged here - # optional, default is empty (do not log queries) - query_log = /dbs/sphinxlog/query.log - - # client read timeout, seconds - # optional, default is 5 - read_timeout = 5 - - # maximum amount of children to fork (concurrent searches to run) - # optional, default is 0 (unlimited) - max_children = 30 - - # PID file, searchd process ID file name - # mandatory - pid_file = /var/log/searchd.pid - - # max amount of matches the daemon ever keeps in RAM, per-index - # WARNING, THERE'S ALSO PER-QUERY LIMIT, SEE SetLimits() API CALL - # default is 1000 (just like Google) - max_matches = 1000 - - # seamless rotate, prevents rotate stalls if precaching huge datasets - # optional, default is 1 - seamless_rotate = 0 - - # whether to forcibly preopen all indexes on startup - # optional, default is 0 (do not preopen) - preopen_indexes = 0 - - # whether to unlink .old index copies on succesful rotation. - # optional, default is 1 (do unlink) - unlink_old = 1 -} diff --git a/config/SphinxHisto/act.conf-MysqlServer b/config/SphinxHisto/act.conf-MysqlServer deleted file mode 100644 index 9b9e2bf..0000000 --- a/config/SphinxHisto/act.conf-MysqlServer +++ /dev/null @@ -1,40 +0,0 @@ - -source source_act -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, Siren1, RaisonSociale, Siren2, actif, dateLien, IF(dateUpdate > dateInsert, dateUpdate,dateInsert) as dateMaj, source, Pmin*1 AS PminNum, MajMin, PpPm, IF(Pays='','FRA',Pays) AS Pays FROM liens WHERE ActionPart=1 AND Siren1>1000 AND Siren1 IN (SELECT DISTINCT SIREN FROM etablissements_old); - sql_attr_uint = actif - sql_attr_uint = source - sql_attr_uint = PminNum - sql_attr_str2ordinal= MajMin - sql_attr_str2ordinal= PpPm -} - -index act -{ - source = source_act - path = /dbs/sphinx/act - docinfo = extern - morphology = none - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} - -index act_phx -{ - source = source_act - path = /dbs/sphinx/act_phx - docinfo = extern - morphology = libstemmer_francais - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/SphinxHisto/act.conf-MysqlServerSlave b/config/SphinxHisto/act.conf-MysqlServerSlave deleted file mode 100644 index 9b9e2bf..0000000 --- a/config/SphinxHisto/act.conf-MysqlServerSlave +++ /dev/null @@ -1,40 +0,0 @@ - -source source_act -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, Siren1, RaisonSociale, Siren2, actif, dateLien, IF(dateUpdate > dateInsert, dateUpdate,dateInsert) as dateMaj, source, Pmin*1 AS PminNum, MajMin, PpPm, IF(Pays='','FRA',Pays) AS Pays FROM liens WHERE ActionPart=1 AND Siren1>1000 AND Siren1 IN (SELECT DISTINCT SIREN FROM etablissements_old); - sql_attr_uint = actif - sql_attr_uint = source - sql_attr_uint = PminNum - sql_attr_str2ordinal= MajMin - sql_attr_str2ordinal= PpPm -} - -index act -{ - source = source_act - path = /dbs/sphinx/act - docinfo = extern - morphology = none - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} - -index act_phx -{ - source = source_act - path = /dbs/sphinx/act_phx - docinfo = extern - morphology = libstemmer_francais - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/SphinxHisto/cmp.conf-MysqlServer b/config/SphinxHisto/cmp.conf-MysqlServer deleted file mode 100644 index d01a87e..0000000 --- a/config/SphinxHisto/cmp.conf-MysqlServer +++ /dev/null @@ -1,40 +0,0 @@ - -source comptage -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = root - sql_pass = scores - sql_db = jo - sql_port = 3306 - sql_query = SELECT id,ape_etab,ape_entrep,source,siren,nic,actif,siege,adr_cp,adr_dep,adr_com,(tel>100000000) AS tel,(fax>100000000) AS fax,cj,capital,age_entrep,age_etab,tca,tcaexp,teff_entrep,teff_etab,rang,dateCrea_etab,eff_entrep,eff_etab,nbEtab,bilType,bilAnnee,bilTca,bilCA,bilCAexp,bilRN FROM etablissements_act; - sql_attr_str2ordinal = bilType - sql_attr_uint = source - sql_attr_uint = actif - sql_attr_uint = siege - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = adr_com - sql_attr_uint = tel - sql_attr_uint = fax - sql_attr_uint = cj - sql_attr_uint = capital - sql_attr_uint = age_entrep - sql_attr_uint = age_etab - sql_attr_uint = tca - sql_attr_uint = tcaexp - sql_attr_uint = teff_entrep - sql_attr_uint = teff_etab - sql_attr_uint = rang - sql_attr_uint = dateCrea_etab - sql_attr_uint = eff_entrep - sql_attr_uint = eff_etab - sql_attr_uint = nbEtab - sql_attr_uint = bilAnnee - sql_attr_uint = bilTca - sql_attr_uint = bilCA - sql_attr_uint = bilCAexp - sql_attr_uint = bilRN - - sql_query_info = SELECT siren, nic, ape_etab,ape_entrep, raisonSociale, enseigne, sigle, adr_libVoie, adr_cp, adr_ville FROM etablissements WHERE id=$id; -} \ No newline at end of file diff --git a/config/SphinxHisto/cmp.conf-MysqlServerSlave b/config/SphinxHisto/cmp.conf-MysqlServerSlave deleted file mode 100644 index d01a87e..0000000 --- a/config/SphinxHisto/cmp.conf-MysqlServerSlave +++ /dev/null @@ -1,40 +0,0 @@ - -source comptage -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = root - sql_pass = scores - sql_db = jo - sql_port = 3306 - sql_query = SELECT id,ape_etab,ape_entrep,source,siren,nic,actif,siege,adr_cp,adr_dep,adr_com,(tel>100000000) AS tel,(fax>100000000) AS fax,cj,capital,age_entrep,age_etab,tca,tcaexp,teff_entrep,teff_etab,rang,dateCrea_etab,eff_entrep,eff_etab,nbEtab,bilType,bilAnnee,bilTca,bilCA,bilCAexp,bilRN FROM etablissements_act; - sql_attr_str2ordinal = bilType - sql_attr_uint = source - sql_attr_uint = actif - sql_attr_uint = siege - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = adr_com - sql_attr_uint = tel - sql_attr_uint = fax - sql_attr_uint = cj - sql_attr_uint = capital - sql_attr_uint = age_entrep - sql_attr_uint = age_etab - sql_attr_uint = tca - sql_attr_uint = tcaexp - sql_attr_uint = teff_entrep - sql_attr_uint = teff_etab - sql_attr_uint = rang - sql_attr_uint = dateCrea_etab - sql_attr_uint = eff_entrep - sql_attr_uint = eff_etab - sql_attr_uint = nbEtab - sql_attr_uint = bilAnnee - sql_attr_uint = bilTca - sql_attr_uint = bilCA - sql_attr_uint = bilCAexp - sql_attr_uint = bilRN - - sql_query_info = SELECT siren, nic, ape_etab,ape_entrep, raisonSociale, enseigne, sigle, adr_libVoie, adr_cp, adr_ville FROM etablissements WHERE id=$id; -} \ No newline at end of file diff --git a/config/SphinxHisto/dir.conf-MysqlServer b/config/SphinxHisto/dir.conf-MysqlServer deleted file mode 100644 index 10ea1f0..0000000 --- a/config/SphinxHisto/dir.conf-MysqlServer +++ /dev/null @@ -1,59 +0,0 @@ - -source source_dir -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = -# sql_query = SELECT id, siren, actif, \ -#IF(civilite='M',1,IF(civilite='MME' OR civilite='MLLE',2,0)) AS genre, \ -#CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \ -# YEAR(naissance_date) AS naiss_annee, \ -#MONTH(naissance_date) AS naiss_mois, \ -# DAY(naissance_date) AS naiss_jour, \ -#naissance_lieu, adr_dep \ -#FROM rncs_dirigeants; - sql_query = SELECT id, siren, adr_dep, typeDir, dirSiren, civilite, CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \ - YEAR(naissance_date) AS naiss_annee, \ - MONTH(naissance_date) AS naiss_mois, \ - DAY(naissance_date) AS naiss_jour, \ - naissance_lieu, fonction_code, actif \ - FROM dirigeants_tmp; - sql_attr_str2ordinal= civilite - sql_attr_str2ordinal= typeDir - sql_attr_str2ordinal= fonction_code - sql_attr_uint = dirSiren - sql_attr_uint = naiss_annee - sql_attr_uint = naiss_mois - sql_attr_uint = naiss_jour - sql_attr_uint = actif -# sql_attr_uint = genre - sql_attr_uint = adr_dep -} - -index dir -{ - source = source_dir - path = /dbs/sphinx/dir - docinfo = extern - morphology = none - #ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} - -index dir_phx -{ - source = source_dir - path = /dbs/sphinx/dir_phx - docinfo = extern - morphology = libstemmer_francais - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/SphinxHisto/dir.conf-MysqlServerSlave b/config/SphinxHisto/dir.conf-MysqlServerSlave deleted file mode 100644 index 10ea1f0..0000000 --- a/config/SphinxHisto/dir.conf-MysqlServerSlave +++ /dev/null @@ -1,59 +0,0 @@ - -source source_dir -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = -# sql_query = SELECT id, siren, actif, \ -#IF(civilite='M',1,IF(civilite='MME' OR civilite='MLLE',2,0)) AS genre, \ -#CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \ -# YEAR(naissance_date) AS naiss_annee, \ -#MONTH(naissance_date) AS naiss_mois, \ -# DAY(naissance_date) AS naiss_jour, \ -#naissance_lieu, adr_dep \ -#FROM rncs_dirigeants; - sql_query = SELECT id, siren, adr_dep, typeDir, dirSiren, civilite, CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \ - YEAR(naissance_date) AS naiss_annee, \ - MONTH(naissance_date) AS naiss_mois, \ - DAY(naissance_date) AS naiss_jour, \ - naissance_lieu, fonction_code, actif \ - FROM dirigeants_tmp; - sql_attr_str2ordinal= civilite - sql_attr_str2ordinal= typeDir - sql_attr_str2ordinal= fonction_code - sql_attr_uint = dirSiren - sql_attr_uint = naiss_annee - sql_attr_uint = naiss_mois - sql_attr_uint = naiss_jour - sql_attr_uint = actif -# sql_attr_uint = genre - sql_attr_uint = adr_dep -} - -index dir -{ - source = source_dir - path = /dbs/sphinx/dir - docinfo = extern - morphology = none - #ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} - -index dir_phx -{ - source = source_dir - path = /dbs/sphinx/dir_phx - docinfo = extern - morphology = libstemmer_francais - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/SphinxHisto/ent.conf-MysqlServer b/config/SphinxHisto/ent.conf-MysqlServer deleted file mode 100644 index 9f46f0c..0000000 --- a/config/SphinxHisto/ent.conf-MysqlServer +++ /dev/null @@ -1,72 +0,0 @@ - -source source_ent -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\ -' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \ -actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \ -adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \ -FROM etablissements_tmp; - sql_attr_str2ordinal = adr_typeVoie - sql_attr_uint = siren - sql_attr_uint = nic - sql_attr_uint = siege - sql_attr_uint = adr_num - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = actif - sql_attr_uint = cj - sql_attr_uint = sirenValide - sql_attr_uint = rang - -} - -index ent -{ - source = source_ent - path = /dbs/sphinx/ent - docinfo = extern - wordforms = /usr/local/sphinx/etc/wordforms.txt - abreviations = /usr/local/sphinx/etc/abreviations.txt - ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} - -index ent_mns -{ - source = source_ent - path = /dbs/sphinx/ent_mns - docinfo = extern - wordforms = /usr/local/sphinx/etc/wordforms.txt - abreviations = /usr/local/sphinx/etc/abreviations.txt - non_significatifs = /usr/local/sphinx/etc/mots-non-significatifs.txt - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} - -index ent_phx -{ - source = source_ent - path = /dbs/sphinx/ent_phx - docinfo = extern - morphology = libstemmer_francais - wordforms = /usr/local/sphinx/etc/wordforms.txt - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/SphinxHisto/ent.conf-MysqlServerSlave b/config/SphinxHisto/ent.conf-MysqlServerSlave deleted file mode 100644 index 9f46f0c..0000000 --- a/config/SphinxHisto/ent.conf-MysqlServerSlave +++ /dev/null @@ -1,72 +0,0 @@ - -source source_ent -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\ -' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \ -actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \ -adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \ -FROM etablissements_tmp; - sql_attr_str2ordinal = adr_typeVoie - sql_attr_uint = siren - sql_attr_uint = nic - sql_attr_uint = siege - sql_attr_uint = adr_num - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = actif - sql_attr_uint = cj - sql_attr_uint = sirenValide - sql_attr_uint = rang - -} - -index ent -{ - source = source_ent - path = /dbs/sphinx/ent - docinfo = extern - wordforms = /usr/local/sphinx/etc/wordforms.txt - abreviations = /usr/local/sphinx/etc/abreviations.txt - ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} - -index ent_mns -{ - source = source_ent - path = /dbs/sphinx/ent_mns - docinfo = extern - wordforms = /usr/local/sphinx/etc/wordforms.txt - abreviations = /usr/local/sphinx/etc/abreviations.txt - non_significatifs = /usr/local/sphinx/etc/mots-non-significatifs.txt - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} - -index ent_phx -{ - source = source_ent - path = /dbs/sphinx/ent_phx - docinfo = extern - morphology = libstemmer_francais - wordforms = /usr/local/sphinx/etc/wordforms.txt - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/SphinxHisto/histo.conf-MysqlServer b/config/SphinxHisto/histo.conf-MysqlServer deleted file mode 100644 index 29473ad..0000000 --- a/config/SphinxHisto/histo.conf-MysqlServer +++ /dev/null @@ -1,39 +0,0 @@ -# -# Sphinx configuration file sample -# -# WARNING! While this sample file mentions all available options, -# it contains (very) short helper descriptions only. Please refer to -# doc/sphinx.html for details. -# - -############################################################################# -## data source definition -############################################################################# - -source histo -{ - type = mysql - sql_host = 192.168.78.230 - sql_user = sphinx_histo - sql_pass = sphinx - sql_db = histobodacc - sql_port = 3306 # optional, default is 3306 - sql_query = SELECT id, nomFichier, annee1, dateBod, texte FROM bodacc_ocr; - sql_attr_uint = annee1 - sql_query_info = SELECT * FROM bodacc_ocr WHERE id=$id -} - -############################################################################# -## index definition -############################################################################# - -index histo -{ - source = histo - path = /home/sphinx/histo - docinfo = extern - morphology = none - min_word_len = 1 - charset_type = sbcs - html_strip = 1 -} diff --git a/config/SphinxHisto/sphinx.conf b/config/SphinxHisto/sphinx.conf deleted file mode 100644 index b390725..0000000 --- a/config/SphinxHisto/sphinx.conf +++ /dev/null @@ -1,77 +0,0 @@ - -############################################################################# -## indexer settings -############################################################################# - -indexer -{ - # memory limit, in bytes, kiloytes (16384K) or megabytes (256M) - # optional, default is 32M, max is 2047M, recommended is 256M to 1024M - mem_limit = 256 - - # maximum IO calls per second (for I/O throttling) - # optional, default is 0 (unlimited) - # - # max_iops = 40 - - - # maximum IO call size, bytes (for I/O throttling) - # optional, default is 0 (unlimited) - # - # max_iosize = 1048576 -} - -############################################################################# -## searchd settings -############################################################################# - -searchd -{ - # IP address to bind on - # optional, default is 0.0.0.0 (ie. listen on all interfaces) - # - # address = 127.0.0.1 - # address = 192.168.0.1 - - - # searchd TCP port number - # mandatory, default is 3312 - listen = 3312 - - # log file, searchd run info is logged here - # optional, default is 'searchd.log' - log = /dbs/sphinxlog/searchd.log - - # query log file, all search queries are logged here - # optional, default is empty (do not log queries) - query_log = /dbs/sphinxlog/query.log - - # client read timeout, seconds - # optional, default is 5 - read_timeout = 5 - - # maximum amount of children to fork (concurrent searches to run) - # optional, default is 0 (unlimited) - max_children = 30 - - # PID file, searchd process ID file name - # mandatory - pid_file = /var/log/searchd.pid - - # max amount of matches the daemon ever keeps in RAM, per-index - # WARNING, THERE'S ALSO PER-QUERY LIMIT, SEE SetLimits() API CALL - # default is 1000 (just like Google) - max_matches = 1000 - - # seamless rotate, prevents rotate stalls if precaching huge datasets - # optional, default is 1 - seamless_rotate = 0 - - # whether to forcibly preopen all indexes on startup - # optional, default is 0 (do not preopen) - preopen_indexes = 0 - - # whether to unlink .old index copies on succesful rotation. - # optional, default is 1 (do unlink) - unlink_old = 1 -} diff --git a/config/sdsrvws02/act.conf-MysqlServer b/config/sdsrvws02/act.conf-MysqlServer deleted file mode 100644 index 9682316..0000000 --- a/config/sdsrvws02/act.conf-MysqlServer +++ /dev/null @@ -1,31 +0,0 @@ -source source_act -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, Siren1, RaisonSociale, Siren2, actif, dateLien, IF(dateUpdate>dateInsert,dateUpdate,dateInsert) as dateMaj, \ - source, Pmin*1 AS PminNum, MajMin, PpPm, IF(Pays='','FRA',Pays) AS Pays \ - FROM liens \ - WHERE ActionPart=1 AND Siren1>1000 AND Siren1 IN (SELECT DISTINCT SIREN FROM etablissements_old); - sql_attr_uint = actif - sql_attr_uint = source - sql_attr_uint = PminNum - sql_attr_str2ordinal= MajMin - sql_attr_str2ordinal= PpPm - sql_attr_str2ordinal= Pays -} - -index act -{ - source = source_act - path = /dbs/sphinx/act - docinfo = extern - morphology = none - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/sdsrvws02/act.conf-MysqlServerSlave b/config/sdsrvws02/act.conf-MysqlServerSlave deleted file mode 100644 index 9682316..0000000 --- a/config/sdsrvws02/act.conf-MysqlServerSlave +++ /dev/null @@ -1,31 +0,0 @@ -source source_act -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, Siren1, RaisonSociale, Siren2, actif, dateLien, IF(dateUpdate>dateInsert,dateUpdate,dateInsert) as dateMaj, \ - source, Pmin*1 AS PminNum, MajMin, PpPm, IF(Pays='','FRA',Pays) AS Pays \ - FROM liens \ - WHERE ActionPart=1 AND Siren1>1000 AND Siren1 IN (SELECT DISTINCT SIREN FROM etablissements_old); - sql_attr_uint = actif - sql_attr_uint = source - sql_attr_uint = PminNum - sql_attr_str2ordinal= MajMin - sql_attr_str2ordinal= PpPm - sql_attr_str2ordinal= Pays -} - -index act -{ - source = source_act - path = /dbs/sphinx/act - docinfo = extern - morphology = none - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/sdsrvws02/cmp.conf-MysqlServer b/config/sdsrvws02/cmp.conf-MysqlServer deleted file mode 100644 index d01a87e..0000000 --- a/config/sdsrvws02/cmp.conf-MysqlServer +++ /dev/null @@ -1,40 +0,0 @@ - -source comptage -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = root - sql_pass = scores - sql_db = jo - sql_port = 3306 - sql_query = SELECT id,ape_etab,ape_entrep,source,siren,nic,actif,siege,adr_cp,adr_dep,adr_com,(tel>100000000) AS tel,(fax>100000000) AS fax,cj,capital,age_entrep,age_etab,tca,tcaexp,teff_entrep,teff_etab,rang,dateCrea_etab,eff_entrep,eff_etab,nbEtab,bilType,bilAnnee,bilTca,bilCA,bilCAexp,bilRN FROM etablissements_act; - sql_attr_str2ordinal = bilType - sql_attr_uint = source - sql_attr_uint = actif - sql_attr_uint = siege - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = adr_com - sql_attr_uint = tel - sql_attr_uint = fax - sql_attr_uint = cj - sql_attr_uint = capital - sql_attr_uint = age_entrep - sql_attr_uint = age_etab - sql_attr_uint = tca - sql_attr_uint = tcaexp - sql_attr_uint = teff_entrep - sql_attr_uint = teff_etab - sql_attr_uint = rang - sql_attr_uint = dateCrea_etab - sql_attr_uint = eff_entrep - sql_attr_uint = eff_etab - sql_attr_uint = nbEtab - sql_attr_uint = bilAnnee - sql_attr_uint = bilTca - sql_attr_uint = bilCA - sql_attr_uint = bilCAexp - sql_attr_uint = bilRN - - sql_query_info = SELECT siren, nic, ape_etab,ape_entrep, raisonSociale, enseigne, sigle, adr_libVoie, adr_cp, adr_ville FROM etablissements WHERE id=$id; -} \ No newline at end of file diff --git a/config/sdsrvws02/cmp.conf-MysqlServerSlave b/config/sdsrvws02/cmp.conf-MysqlServerSlave deleted file mode 100644 index d01a87e..0000000 --- a/config/sdsrvws02/cmp.conf-MysqlServerSlave +++ /dev/null @@ -1,40 +0,0 @@ - -source comptage -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = root - sql_pass = scores - sql_db = jo - sql_port = 3306 - sql_query = SELECT id,ape_etab,ape_entrep,source,siren,nic,actif,siege,adr_cp,adr_dep,adr_com,(tel>100000000) AS tel,(fax>100000000) AS fax,cj,capital,age_entrep,age_etab,tca,tcaexp,teff_entrep,teff_etab,rang,dateCrea_etab,eff_entrep,eff_etab,nbEtab,bilType,bilAnnee,bilTca,bilCA,bilCAexp,bilRN FROM etablissements_act; - sql_attr_str2ordinal = bilType - sql_attr_uint = source - sql_attr_uint = actif - sql_attr_uint = siege - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = adr_com - sql_attr_uint = tel - sql_attr_uint = fax - sql_attr_uint = cj - sql_attr_uint = capital - sql_attr_uint = age_entrep - sql_attr_uint = age_etab - sql_attr_uint = tca - sql_attr_uint = tcaexp - sql_attr_uint = teff_entrep - sql_attr_uint = teff_etab - sql_attr_uint = rang - sql_attr_uint = dateCrea_etab - sql_attr_uint = eff_entrep - sql_attr_uint = eff_etab - sql_attr_uint = nbEtab - sql_attr_uint = bilAnnee - sql_attr_uint = bilTca - sql_attr_uint = bilCA - sql_attr_uint = bilCAexp - sql_attr_uint = bilRN - - sql_query_info = SELECT siren, nic, ape_etab,ape_entrep, raisonSociale, enseigne, sigle, adr_libVoie, adr_cp, adr_ville FROM etablissements WHERE id=$id; -} \ No newline at end of file diff --git a/config/sdsrvws02/dir.conf-MysqlServer b/config/sdsrvws02/dir.conf-MysqlServer deleted file mode 100644 index be3e753..0000000 --- a/config/sdsrvws02/dir.conf-MysqlServer +++ /dev/null @@ -1,45 +0,0 @@ -source source_dir -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, siren, actif, \ -IF(civilite='M',1,IF(civilite='MME' OR civilite='MLLE',2,0)) AS genre, \ -CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \ - YEAR(naissance_date) AS naiss_annee, \ -MONTH(naissance_date) AS naiss_mois, \ - DAY(naissance_date) AS naiss_jour, \ -naissance_lieu, adr_dep \ -FROM rncs_dirigeants; -# UNION \ -#SELECT id, siren, 0 AS actif, \ -#'' AS genre, \ -#CONCAT(nom,' ',nomUsage,' ',rs) AS nom, prenom, \ -#0 AS naiss_annee, \ -#0 AS naiss_mois, \ -#0 AS naiss_jour, \ -#'' AS naissance_lieu, 0 AS adr_dep \ -#FROM bodacc_dirigeants_histo; - sql_attr_uint = naiss_annee - sql_attr_uint = naiss_mois - sql_attr_uint = naiss_jour - sql_attr_uint = actif - sql_attr_uint = genre - sql_attr_uint = adr_dep -} - -index dir -{ - source = source_dir - path = /dbs/sphinx/dir - docinfo = extern - morphology = none - #ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/sdsrvws02/dir.conf-MysqlServerSlave b/config/sdsrvws02/dir.conf-MysqlServerSlave deleted file mode 100644 index be3e753..0000000 --- a/config/sdsrvws02/dir.conf-MysqlServerSlave +++ /dev/null @@ -1,45 +0,0 @@ -source source_dir -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, siren, actif, \ -IF(civilite='M',1,IF(civilite='MME' OR civilite='MLLE',2,0)) AS genre, \ -CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \ - YEAR(naissance_date) AS naiss_annee, \ -MONTH(naissance_date) AS naiss_mois, \ - DAY(naissance_date) AS naiss_jour, \ -naissance_lieu, adr_dep \ -FROM rncs_dirigeants; -# UNION \ -#SELECT id, siren, 0 AS actif, \ -#'' AS genre, \ -#CONCAT(nom,' ',nomUsage,' ',rs) AS nom, prenom, \ -#0 AS naiss_annee, \ -#0 AS naiss_mois, \ -#0 AS naiss_jour, \ -#'' AS naissance_lieu, 0 AS adr_dep \ -#FROM bodacc_dirigeants_histo; - sql_attr_uint = naiss_annee - sql_attr_uint = naiss_mois - sql_attr_uint = naiss_jour - sql_attr_uint = actif - sql_attr_uint = genre - sql_attr_uint = adr_dep -} - -index dir -{ - source = source_dir - path = /dbs/sphinx/dir - docinfo = extern - morphology = none - #ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/sdsrvws02/ent.conf-MysqlServer b/config/sdsrvws02/ent.conf-MysqlServer deleted file mode 100644 index 26e4abd..0000000 --- a/config/sdsrvws02/ent.conf-MysqlServer +++ /dev/null @@ -1,44 +0,0 @@ -source source_ent -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\ -' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \ -actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \ -adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \ -FROM etablissements_tmp; - sql_attr_str2ordinal = adr_typeVoie - sql_attr_uint = siren - sql_attr_uint = nic - sql_attr_uint = siege - sql_attr_uint = adr_num - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = actif - sql_attr_uint = cj - sql_attr_uint = sirenValide - sql_attr_uint = rang - -} - -index ent -{ - source = source_ent - path = /dbs/sphinx/ent - docinfo = extern - wordforms = /usr/local/sphinx/etc/wordforms.txt - abreviations = /usr/local/sphinx/etc/abreviations.txt - ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/sdsrvws02/ent.conf-MysqlServerSlave b/config/sdsrvws02/ent.conf-MysqlServerSlave deleted file mode 100644 index 84d34ac..0000000 --- a/config/sdsrvws02/ent.conf-MysqlServerSlave +++ /dev/null @@ -1,44 +0,0 @@ -source source_ent -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\ -' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \ -actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \ -adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \ -FROM etablissements; - sql_attr_str2ordinal = adr_typeVoie - sql_attr_uint = siren - sql_attr_uint = nic - sql_attr_uint = siege - sql_attr_uint = adr_num - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = actif - sql_attr_uint = cj - sql_attr_uint = sirenValide - sql_attr_uint = rang - -} - -index ent -{ - source = source_ent - path = /dbs/sphinx/ent - docinfo = extern - wordforms = /usr/local/sphinx/etc/wordforms.txt - abreviations = /usr/local/sphinx/etc/abreviations.txt - ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/sdsrvws02/histo.conf-MysqlServer b/config/sdsrvws02/histo.conf-MysqlServer deleted file mode 100644 index 29473ad..0000000 --- a/config/sdsrvws02/histo.conf-MysqlServer +++ /dev/null @@ -1,39 +0,0 @@ -# -# Sphinx configuration file sample -# -# WARNING! While this sample file mentions all available options, -# it contains (very) short helper descriptions only. Please refer to -# doc/sphinx.html for details. -# - -############################################################################# -## data source definition -############################################################################# - -source histo -{ - type = mysql - sql_host = 192.168.78.230 - sql_user = sphinx_histo - sql_pass = sphinx - sql_db = histobodacc - sql_port = 3306 # optional, default is 3306 - sql_query = SELECT id, nomFichier, annee1, dateBod, texte FROM bodacc_ocr; - sql_attr_uint = annee1 - sql_query_info = SELECT * FROM bodacc_ocr WHERE id=$id -} - -############################################################################# -## index definition -############################################################################# - -index histo -{ - source = histo - path = /home/sphinx/histo - docinfo = extern - morphology = none - min_word_len = 1 - charset_type = sbcs - html_strip = 1 -} diff --git a/config/sdsrvws02/sphinx.conf b/config/sdsrvws02/sphinx.conf deleted file mode 100644 index b390725..0000000 --- a/config/sdsrvws02/sphinx.conf +++ /dev/null @@ -1,77 +0,0 @@ - -############################################################################# -## indexer settings -############################################################################# - -indexer -{ - # memory limit, in bytes, kiloytes (16384K) or megabytes (256M) - # optional, default is 32M, max is 2047M, recommended is 256M to 1024M - mem_limit = 256 - - # maximum IO calls per second (for I/O throttling) - # optional, default is 0 (unlimited) - # - # max_iops = 40 - - - # maximum IO call size, bytes (for I/O throttling) - # optional, default is 0 (unlimited) - # - # max_iosize = 1048576 -} - -############################################################################# -## searchd settings -############################################################################# - -searchd -{ - # IP address to bind on - # optional, default is 0.0.0.0 (ie. listen on all interfaces) - # - # address = 127.0.0.1 - # address = 192.168.0.1 - - - # searchd TCP port number - # mandatory, default is 3312 - listen = 3312 - - # log file, searchd run info is logged here - # optional, default is 'searchd.log' - log = /dbs/sphinxlog/searchd.log - - # query log file, all search queries are logged here - # optional, default is empty (do not log queries) - query_log = /dbs/sphinxlog/query.log - - # client read timeout, seconds - # optional, default is 5 - read_timeout = 5 - - # maximum amount of children to fork (concurrent searches to run) - # optional, default is 0 (unlimited) - max_children = 30 - - # PID file, searchd process ID file name - # mandatory - pid_file = /var/log/searchd.pid - - # max amount of matches the daemon ever keeps in RAM, per-index - # WARNING, THERE'S ALSO PER-QUERY LIMIT, SEE SetLimits() API CALL - # default is 1000 (just like Google) - max_matches = 1000 - - # seamless rotate, prevents rotate stalls if precaching huge datasets - # optional, default is 1 - seamless_rotate = 0 - - # whether to forcibly preopen all indexes on startup - # optional, default is 0 (do not preopen) - preopen_indexes = 0 - - # whether to unlink .old index copies on succesful rotation. - # optional, default is 1 (do unlink) - unlink_old = 1 -} From a2c5eca093a4c231cd8822595d32a8426dad2837 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Wed, 2 Nov 2011 08:09:03 +0000 Subject: [PATCH 03/16] --- Sphinx.sh | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/Sphinx.sh b/Sphinx.sh index 4b80835..36d7d5e 100755 --- a/Sphinx.sh +++ b/Sphinx.sh @@ -1,10 +1,14 @@ #!/bin/bash #This program as been create by Damien for Scores et decisions ste #Email : dlasserre@scores-decisions.com +# Comatible uniquement sous linux allVersion=("2.0.1" "0.9.9") declare -A ERREURS declare -A ASTUCES +#en cours de developpement ! +declare -A ASTUCESDEV + #Color declaration ROUGE="\\033[1;31m" NORMAL="\\033[0;39m" @@ -26,7 +30,6 @@ sphinxlog="Exist" ERREURS=( ["CHMOD"]="Execute the script with SUDO or in ROOT" ["DIRECTORY"]="Directory not create" - ["FILE"]= "" ["CMD"]="This command not exist" ["NOCMD"]="Please enter options") @@ -43,13 +46,21 @@ function loadIndication() { done } +# Permet de verifier la valider du superadmin sous linux. if [ `id -u` = 0 ] #Need Root or Sudo then commande=('--configure' '--install' '--all') for i; do case $i in '--help') - `man SphinxHelp` #en cours de création du man ! + echo -e $ROUGE"*************************************************************************************************************************************"$NORMAL + echo -e "--install version : Vous permet d'installer configurer et crée les indexe et la libstemmer compilation, installation et configuration"; + echo -e "--delete : Vous permet de restaurer les parametres de la machines en supprimer la configuration et l'installation" + echo -e "--help : Vous permet d'acceser a l'aide de SphinxInstall" + echo -e "--refresh : Vous permet de rafraichire les indexes, dans le cas d'une modification des fichier source, exemple BDD ou port, mémoir etc..." + echo -e "--version : Vous retournes les dernieres version disponnibles en téléchargement sur Sphinx." + echo -e $ROUGE"**************************************************************************************************************************************"$NORMAL + exit; ;; '--delete') `rm -r indexeConf tmp sphinx-* wget* libste* *~ 2> /dev/null` @@ -65,8 +76,6 @@ then if [ ! -e /dbs ];then `mkdir /dbs`; dbs="Success"; fi #repertoire temporaire. if [ ! -e tmp ];then `mkdir tmp`; fi - ## - if [ ! -e /dbs/sphinx ];then echo -e "/dbs/sphinx Doesn't exist !"; exit; fi if [ ! -e /dbs/sphinxlog ];then `mkdir /dbs/sphinxlog`; exit; fi if [ ! -e /usr/local/sphinx ];then `mkdir /dbs/sphinx`; exit; fi @@ -118,12 +127,12 @@ then echo -e $NORMAL"- Complited" echo -e $NORMAL echo -e $CYAN"Compilation progress..."$ROUGE - #if [ $version != "2.0.1-beta" ];then `cd tmp/sphinx-$version ; make; make install ` ; - #else - #`cd tmp/sphinx-$version/ ; make; make install`;fi + if [ $version != "2.0.1-beta" ];then `cd tmp/sphinx-$version ; make; make install ` ; + else + `cd tmp/sphinx-$version/ ; make; make install`;fi echo -e $NORMAL" - Complited" echo -n "Machine MASTER ? (y/n) : "; read response - `touch /usr/local/sphinx/sphinx.conf`; + `touch /usr/local/sphinx/etc/sphinx.conf`; echo -e $ROUGE"Mode MASTER activated"$NORMAL echo -e "Tapez 'stop' pour quiter l'invite de création des indexes" while [ indexe != "stop\n" ]; do @@ -140,28 +149,21 @@ then if [ -e config/base/Slave/$indexe.conf-MysqlServer ] then `cp config/base/Slave/$indexe.conf-MysqlServer config/${HOSTNAME}/` - echo -e "Indexe $indexes as been create !"; + echo -e "Indexe ''$indexes'' as been create !"; else break; fi fi done; - `cat config/base/sphinx.conf > /usr/local/sphinx/sphinx.conf `; - `cat config/${HOSTNAME}/*.conf-MysqlServer >> /usr/local/sphinx/sphinx.conf`; + `cat config/base/sphinx.conf > /usr/local/sphinx/etc/sphinx.conf `; + `cat config/${HOSTNAME}/*.conf-MysqlServer >> /usr/local/sphinx/etc/sphinx.conf`; + `./Sphinx --refresh` echo -e $VERT"The installation as been finish ! great ! thank's damien :)"$NORMAL exit ;; '--refresh') - echo -n "Machine MASTER ? (y/n) : "; read response - `touch /usr/local/sphinx/sphinx.conf`; - `cat config/${HOSTNAME}/sphinx.conf > /usr/local/sphinx/sphinx.conf`; - if [ $response = 'y' ];then - echo -e $ROUGE"Mode MASTER activated"$NORMAL - `cat config/${HOSTNAME}/*.conf-MysqlServer >> /usr/local/sphinx/sphinx.conf`; - else - echo -e $ROUGE"Mode SLAVE activated"$NORMAL - `cat config/${HOSTNAME}/*.conf-MysqlServerSlave >> /usr/local/sphinx/sphinx.conf`; - fi + `cat config/base/sphinx.conf > /usr/local/sphinx/etc/sphinx.conf` + `cat config/${HOSTNAME}/* >> /usr/local/sphinx/etc/sphinx.conf` echo -e $VERT"The refresh as been finish ! great ! thank's damien :)"$NORMAL exit ;; From 3aaac414983b0f600643f1b611231fa3a4c371cf Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Wed, 2 Nov 2011 08:24:54 +0000 Subject: [PATCH 04/16] --- Sphinx.sh | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/Sphinx.sh b/Sphinx.sh index 36d7d5e..4159134 100755 --- a/Sphinx.sh +++ b/Sphinx.sh @@ -72,16 +72,16 @@ then echo -e "2. Past version : 0.9.9\n" ;; '--install') - #Environement for installation + if [ ! -e /dbs ];then `mkdir /dbs`; dbs="Success"; fi - #repertoire temporaire. + if [ ! -e tmp ];then `mkdir tmp`; fi if [ ! -e /dbs/sphinx ];then echo -e "/dbs/sphinx Doesn't exist !"; exit; fi if [ ! -e /dbs/sphinxlog ];then `mkdir /dbs/sphinxlog`; exit; fi if [ ! -e /usr/local/sphinx ];then `mkdir /dbs/sphinx`; exit; fi - if [ ! -e /init.d/sphinxsearch ];then `cp initscript/sphinxsearch /etc/init.d/; chmod +x /etc/init.d/sphinxsearch ;update-rc.d sphinxsearch defaults`; fi + if [ ! -e /init.d/sphinxsearch ];then `cp initscript/sphinxsearch /etc/init.d/ > /dev/null` ;`chmod +x /etc/init.d/sphinxsearch > /dev/null`; `update-rc.d sphinxsearch defaults > /dev/null`; fi if [ ! -e config/${HOSTNAME} ];then `mkdir config/${HOSTNAME}`;fi - #Check if package in directory, if you want to download manually the package + if [ ! -e sphinx-2.0.1.tar.gz ] || [ ! -e sphinx-0.9.9.tar.gz ] then if [ ! -z $2 ]; then @@ -167,6 +167,38 @@ then echo -e $VERT"The refresh as been finish ! great ! thank's damien :)"$NORMAL exit ;; + '--add') + `mkdir config/${HOSTANME}` + echo -n "Machine MASTER ? (y/n) : "; read response + `touch /usr/local/sphinx/etc/sphinx.conf`; + echo -e $ROUGE"Mode MASTER activated"$NORMAL + echo -e "Tapez 'stop' pour quiter l'invite de création des indexes" + while [ indexe != "stop\n" ]; do + echo -e " Entrez indexe : "; read indexe + if [ $response = 'y' ];then + if [ -e config/base/Master/$indexe.conf-MysqlServer ] + then + `cp config/base/Master/$indexe.conf-MysqlServer config/${HOSTNAME}/` + echo -e "Indexe $indexes as been create !"; + else + break; + fi + else + if [ -e config/base/Slave/$indexe.conf-MysqlServer ] + then + `cp config/base/Slave/$indexe.conf-MysqlServer config/${HOSTNAME}/` + echo -e "Indexe ''$indexes'' as been create !"; + else + break; + fi + fi + done; + `cat config/base/sphinx.conf > /usr/local/sphinx/etc/sphinx.conf `; + `cat config/${HOSTNAME}/*.conf-MysqlServer >> /usr/local/sphinx/etc/sphinx.conf`; + `./Sphinx --refresh` + echo -e $VERT"The installation as been finish ! great ! thank's damien :)"$NORMAL + exit + ;; *) #Default echo -e $ROUGE"[Erreur]" ${ERREURS["CMD"]} $NORMAL From bc010837c370e2c16530b3460a3d5918cfb3213a Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Mon, 7 Nov 2011 09:41:12 +0000 Subject: [PATCH 05/16] --- null | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100755 null diff --git a/null b/null new file mode 100755 index 0000000..e69de29 From e54f359f9024d27dd8f7d44c71696827a78edc77 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Mon, 7 Nov 2011 09:41:34 +0000 Subject: [PATCH 06/16] From 5814c7d2fe03dff37eb8a744263f91b828292779 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Mon, 7 Nov 2011 09:41:56 +0000 Subject: [PATCH 07/16] --- null | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 null diff --git a/null b/null deleted file mode 100755 index e69de29..0000000 From 598cc88065c8064b3eafb2e4114714d31f3a13e1 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Mon, 7 Nov 2011 17:12:26 +0000 Subject: [PATCH 08/16] Fichier de configuration --- config/base/Master/act.conf-MysqlServer | 31 +++++++++ config/base/Master/cmp.conf-MysqlServer | 40 +++++++++++ config/base/Master/dir.conf-MysqlServer | 45 ++++++++++++ config/base/Master/ent.conf-MysqlServer | 41 +++++++++++ config/base/Master/histo.conf-MysqlServer | 23 ++++++ config/base/Slave/act.conf-MysqlServerSlave | 31 +++++++++ config/base/Slave/cmp.conf-MysqlServerSlave | 40 +++++++++++ config/base/Slave/dir.conf-MysqlServerSlave | 45 ++++++++++++ config/base/Slave/ent.conf-MysqlServerSlave | 44 ++++++++++++ config/base/sphinx.conf | 77 +++++++++++++++++++++ 10 files changed, 417 insertions(+) create mode 100644 config/base/Master/act.conf-MysqlServer create mode 100644 config/base/Master/cmp.conf-MysqlServer create mode 100644 config/base/Master/dir.conf-MysqlServer create mode 100644 config/base/Master/ent.conf-MysqlServer create mode 100644 config/base/Master/histo.conf-MysqlServer create mode 100644 config/base/Slave/act.conf-MysqlServerSlave create mode 100644 config/base/Slave/cmp.conf-MysqlServerSlave create mode 100644 config/base/Slave/dir.conf-MysqlServerSlave create mode 100644 config/base/Slave/ent.conf-MysqlServerSlave create mode 100644 config/base/sphinx.conf diff --git a/config/base/Master/act.conf-MysqlServer b/config/base/Master/act.conf-MysqlServer new file mode 100644 index 0000000..9682316 --- /dev/null +++ b/config/base/Master/act.conf-MysqlServer @@ -0,0 +1,31 @@ +source source_act +{ + type = mysql + sql_host = 192.168.3.30 + sql_user = sphinx + sql_pass = indexer + sql_db = jo + sql_query_pre = + sql_query = SELECT id, Siren1, RaisonSociale, Siren2, actif, dateLien, IF(dateUpdate>dateInsert,dateUpdate,dateInsert) as dateMaj, \ + source, Pmin*1 AS PminNum, MajMin, PpPm, IF(Pays='','FRA',Pays) AS Pays \ + FROM liens \ + WHERE ActionPart=1 AND Siren1>1000 AND Siren1 IN (SELECT DISTINCT SIREN FROM etablissements_old); + sql_attr_uint = actif + sql_attr_uint = source + sql_attr_uint = PminNum + sql_attr_str2ordinal= MajMin + sql_attr_str2ordinal= PpPm + sql_attr_str2ordinal= Pays +} + +index act +{ + source = source_act + path = /dbs/sphinx/act + docinfo = extern + morphology = none + charset_type = sbcs + charset_table = 0..9, A..Z->a..z, a..z, \ +U+23, U+25, U+26, U+2B, U+3D, U+40, \ +U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF +} \ No newline at end of file diff --git a/config/base/Master/cmp.conf-MysqlServer b/config/base/Master/cmp.conf-MysqlServer new file mode 100644 index 0000000..d01a87e --- /dev/null +++ b/config/base/Master/cmp.conf-MysqlServer @@ -0,0 +1,40 @@ + +source comptage +{ + type = mysql + sql_host = 192.168.3.30 + sql_user = root + sql_pass = scores + sql_db = jo + sql_port = 3306 + sql_query = SELECT id,ape_etab,ape_entrep,source,siren,nic,actif,siege,adr_cp,adr_dep,adr_com,(tel>100000000) AS tel,(fax>100000000) AS fax,cj,capital,age_entrep,age_etab,tca,tcaexp,teff_entrep,teff_etab,rang,dateCrea_etab,eff_entrep,eff_etab,nbEtab,bilType,bilAnnee,bilTca,bilCA,bilCAexp,bilRN FROM etablissements_act; + sql_attr_str2ordinal = bilType + sql_attr_uint = source + sql_attr_uint = actif + sql_attr_uint = siege + sql_attr_uint = adr_cp + sql_attr_uint = adr_dep + sql_attr_uint = adr_com + sql_attr_uint = tel + sql_attr_uint = fax + sql_attr_uint = cj + sql_attr_uint = capital + sql_attr_uint = age_entrep + sql_attr_uint = age_etab + sql_attr_uint = tca + sql_attr_uint = tcaexp + sql_attr_uint = teff_entrep + sql_attr_uint = teff_etab + sql_attr_uint = rang + sql_attr_uint = dateCrea_etab + sql_attr_uint = eff_entrep + sql_attr_uint = eff_etab + sql_attr_uint = nbEtab + sql_attr_uint = bilAnnee + sql_attr_uint = bilTca + sql_attr_uint = bilCA + sql_attr_uint = bilCAexp + sql_attr_uint = bilRN + + sql_query_info = SELECT siren, nic, ape_etab,ape_entrep, raisonSociale, enseigne, sigle, adr_libVoie, adr_cp, adr_ville FROM etablissements WHERE id=$id; +} \ No newline at end of file diff --git a/config/base/Master/dir.conf-MysqlServer b/config/base/Master/dir.conf-MysqlServer new file mode 100644 index 0000000..be3e753 --- /dev/null +++ b/config/base/Master/dir.conf-MysqlServer @@ -0,0 +1,45 @@ +source source_dir +{ + type = mysql + sql_host = 192.168.3.30 + sql_user = sphinx + sql_pass = indexer + sql_db = jo + sql_query_pre = + sql_query = SELECT id, siren, actif, \ +IF(civilite='M',1,IF(civilite='MME' OR civilite='MLLE',2,0)) AS genre, \ +CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \ + YEAR(naissance_date) AS naiss_annee, \ +MONTH(naissance_date) AS naiss_mois, \ + DAY(naissance_date) AS naiss_jour, \ +naissance_lieu, adr_dep \ +FROM rncs_dirigeants; +# UNION \ +#SELECT id, siren, 0 AS actif, \ +#'' AS genre, \ +#CONCAT(nom,' ',nomUsage,' ',rs) AS nom, prenom, \ +#0 AS naiss_annee, \ +#0 AS naiss_mois, \ +#0 AS naiss_jour, \ +#'' AS naissance_lieu, 0 AS adr_dep \ +#FROM bodacc_dirigeants_histo; + sql_attr_uint = naiss_annee + sql_attr_uint = naiss_mois + sql_attr_uint = naiss_jour + sql_attr_uint = actif + sql_attr_uint = genre + sql_attr_uint = adr_dep +} + +index dir +{ + source = source_dir + path = /dbs/sphinx/dir + docinfo = extern + morphology = none + #ispell_aff = /usr/local/sphinx/etc/francais.aff + charset_type = sbcs + charset_table = 0..9, A..Z->a..z, a..z, \ +U+23, U+25, U+26, U+2B, U+3D, U+40, \ +U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF +} \ No newline at end of file diff --git a/config/base/Master/ent.conf-MysqlServer b/config/base/Master/ent.conf-MysqlServer new file mode 100644 index 0000000..831d82d --- /dev/null +++ b/config/base/Master/ent.conf-MysqlServer @@ -0,0 +1,41 @@ +source source_ent +{ + type = mysql + sql_host = 192.168.78.230 + sql_user = sphinx + sql_pass = indexer + sql_db = jo + sql_query_pre = + sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\ +' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\ +REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\ +'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\ +REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\ +'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \ +actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \ +adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \ +FROM etablissements_tmp; + sql_attr_str2ordinal = adr_typeVoie + sql_attr_uint = siren + sql_attr_uint = nic + sql_attr_uint = siege + sql_attr_uint = adr_num + sql_attr_uint = adr_cp + sql_attr_uint = adr_dep + sql_attr_uint = actif + sql_attr_uint = cj + sql_attr_uint = sirenValide + sql_attr_uint = rang + +} + +index ent +{ + source = source_ent + path = /dbs/sphinx/ent + docinfo = extern + charset_type = sbcs + charset_table = 0..9, A..Z->a..z, a..z, \ +U+23, U+25, U+26, U+2B, U+3D, U+40, \ +U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF +} \ No newline at end of file diff --git a/config/base/Master/histo.conf-MysqlServer b/config/base/Master/histo.conf-MysqlServer new file mode 100644 index 0000000..e58a6ed --- /dev/null +++ b/config/base/Master/histo.conf-MysqlServer @@ -0,0 +1,23 @@ +source histo +{ + type = mysql + sql_host = 192.168.78.230 + sql_user = sphinx_histo + sql_pass = sphinx + sql_db = histobodacc + sql_port = 3306 # optional, default is 3306 + sql_query = SELECT id, nomFichier, annee1, dateBod, texte FROM bodacc_ocr; + sql_attr_uint = annee1 + sql_query_info = SELECT * FROM bodacc_ocr WHERE id=$id +} + +index histo +{ + source = histo + path = /home/sphinx/histo + docinfo = extern + morphology = none + min_word_len = 1 + charset_type = sbcs + html_strip = 1 +} diff --git a/config/base/Slave/act.conf-MysqlServerSlave b/config/base/Slave/act.conf-MysqlServerSlave new file mode 100644 index 0000000..9682316 --- /dev/null +++ b/config/base/Slave/act.conf-MysqlServerSlave @@ -0,0 +1,31 @@ +source source_act +{ + type = mysql + sql_host = 192.168.3.30 + sql_user = sphinx + sql_pass = indexer + sql_db = jo + sql_query_pre = + sql_query = SELECT id, Siren1, RaisonSociale, Siren2, actif, dateLien, IF(dateUpdate>dateInsert,dateUpdate,dateInsert) as dateMaj, \ + source, Pmin*1 AS PminNum, MajMin, PpPm, IF(Pays='','FRA',Pays) AS Pays \ + FROM liens \ + WHERE ActionPart=1 AND Siren1>1000 AND Siren1 IN (SELECT DISTINCT SIREN FROM etablissements_old); + sql_attr_uint = actif + sql_attr_uint = source + sql_attr_uint = PminNum + sql_attr_str2ordinal= MajMin + sql_attr_str2ordinal= PpPm + sql_attr_str2ordinal= Pays +} + +index act +{ + source = source_act + path = /dbs/sphinx/act + docinfo = extern + morphology = none + charset_type = sbcs + charset_table = 0..9, A..Z->a..z, a..z, \ +U+23, U+25, U+26, U+2B, U+3D, U+40, \ +U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF +} \ No newline at end of file diff --git a/config/base/Slave/cmp.conf-MysqlServerSlave b/config/base/Slave/cmp.conf-MysqlServerSlave new file mode 100644 index 0000000..d01a87e --- /dev/null +++ b/config/base/Slave/cmp.conf-MysqlServerSlave @@ -0,0 +1,40 @@ + +source comptage +{ + type = mysql + sql_host = 192.168.3.30 + sql_user = root + sql_pass = scores + sql_db = jo + sql_port = 3306 + sql_query = SELECT id,ape_etab,ape_entrep,source,siren,nic,actif,siege,adr_cp,adr_dep,adr_com,(tel>100000000) AS tel,(fax>100000000) AS fax,cj,capital,age_entrep,age_etab,tca,tcaexp,teff_entrep,teff_etab,rang,dateCrea_etab,eff_entrep,eff_etab,nbEtab,bilType,bilAnnee,bilTca,bilCA,bilCAexp,bilRN FROM etablissements_act; + sql_attr_str2ordinal = bilType + sql_attr_uint = source + sql_attr_uint = actif + sql_attr_uint = siege + sql_attr_uint = adr_cp + sql_attr_uint = adr_dep + sql_attr_uint = adr_com + sql_attr_uint = tel + sql_attr_uint = fax + sql_attr_uint = cj + sql_attr_uint = capital + sql_attr_uint = age_entrep + sql_attr_uint = age_etab + sql_attr_uint = tca + sql_attr_uint = tcaexp + sql_attr_uint = teff_entrep + sql_attr_uint = teff_etab + sql_attr_uint = rang + sql_attr_uint = dateCrea_etab + sql_attr_uint = eff_entrep + sql_attr_uint = eff_etab + sql_attr_uint = nbEtab + sql_attr_uint = bilAnnee + sql_attr_uint = bilTca + sql_attr_uint = bilCA + sql_attr_uint = bilCAexp + sql_attr_uint = bilRN + + sql_query_info = SELECT siren, nic, ape_etab,ape_entrep, raisonSociale, enseigne, sigle, adr_libVoie, adr_cp, adr_ville FROM etablissements WHERE id=$id; +} \ No newline at end of file diff --git a/config/base/Slave/dir.conf-MysqlServerSlave b/config/base/Slave/dir.conf-MysqlServerSlave new file mode 100644 index 0000000..be3e753 --- /dev/null +++ b/config/base/Slave/dir.conf-MysqlServerSlave @@ -0,0 +1,45 @@ +source source_dir +{ + type = mysql + sql_host = 192.168.3.30 + sql_user = sphinx + sql_pass = indexer + sql_db = jo + sql_query_pre = + sql_query = SELECT id, siren, actif, \ +IF(civilite='M',1,IF(civilite='MME' OR civilite='MLLE',2,0)) AS genre, \ +CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \ + YEAR(naissance_date) AS naiss_annee, \ +MONTH(naissance_date) AS naiss_mois, \ + DAY(naissance_date) AS naiss_jour, \ +naissance_lieu, adr_dep \ +FROM rncs_dirigeants; +# UNION \ +#SELECT id, siren, 0 AS actif, \ +#'' AS genre, \ +#CONCAT(nom,' ',nomUsage,' ',rs) AS nom, prenom, \ +#0 AS naiss_annee, \ +#0 AS naiss_mois, \ +#0 AS naiss_jour, \ +#'' AS naissance_lieu, 0 AS adr_dep \ +#FROM bodacc_dirigeants_histo; + sql_attr_uint = naiss_annee + sql_attr_uint = naiss_mois + sql_attr_uint = naiss_jour + sql_attr_uint = actif + sql_attr_uint = genre + sql_attr_uint = adr_dep +} + +index dir +{ + source = source_dir + path = /dbs/sphinx/dir + docinfo = extern + morphology = none + #ispell_aff = /usr/local/sphinx/etc/francais.aff + charset_type = sbcs + charset_table = 0..9, A..Z->a..z, a..z, \ +U+23, U+25, U+26, U+2B, U+3D, U+40, \ +U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF +} \ No newline at end of file diff --git a/config/base/Slave/ent.conf-MysqlServerSlave b/config/base/Slave/ent.conf-MysqlServerSlave new file mode 100644 index 0000000..84d34ac --- /dev/null +++ b/config/base/Slave/ent.conf-MysqlServerSlave @@ -0,0 +1,44 @@ +source source_ent +{ + type = mysql + sql_host = 192.168.3.30 + sql_user = sphinx + sql_pass = indexer + sql_db = jo + sql_query_pre = + sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\ +' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\ +REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\ +'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\ +REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\ +'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \ +actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \ +adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \ +FROM etablissements; + sql_attr_str2ordinal = adr_typeVoie + sql_attr_uint = siren + sql_attr_uint = nic + sql_attr_uint = siege + sql_attr_uint = adr_num + sql_attr_uint = adr_cp + sql_attr_uint = adr_dep + sql_attr_uint = actif + sql_attr_uint = cj + sql_attr_uint = sirenValide + sql_attr_uint = rang + +} + +index ent +{ + source = source_ent + path = /dbs/sphinx/ent + docinfo = extern + wordforms = /usr/local/sphinx/etc/wordforms.txt + abreviations = /usr/local/sphinx/etc/abreviations.txt + ispell_aff = /usr/local/sphinx/etc/francais.aff + charset_type = sbcs + charset_table = 0..9, A..Z->a..z, a..z, \ +U+23, U+25, U+26, U+2B, U+3D, U+40, \ +U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF +} \ No newline at end of file diff --git a/config/base/sphinx.conf b/config/base/sphinx.conf new file mode 100644 index 0000000..893f8f9 --- /dev/null +++ b/config/base/sphinx.conf @@ -0,0 +1,77 @@ + +############################################################################# +## indexer settings +############################################################################# + +indexer +{ + # memory limit, in bytes, kiloytes (16384K) or megabytes (256M) + # optional, default is 32M, max is 2047M, recommended is 256M to 1024M + mem_limit = 2047M + + # maximum IO calls per second (for I/O throttling) + # optional, default is 0 (unlimited) + # + # max_iops = 40 + + + # maximum IO call size, bytes (for I/O throttling) + # optional, default is 0 (unlimited) + # + # max_iosize = 1048576 +} + +############################################################################# +## searchd settings +############################################################################# + +searchd +{ + # IP address to bind on + # optional, default is 0.0.0.0 (ie. listen on all interfaces) + # + # address = 127.0.0.1 + # address = 192.168.0.1 + + + # searchd TCP port number + # mandatory, default is 3312 + listen = 3312 + + # log file, searchd run info is logged here + # optional, default is 'searchd.log' + log = /dbs/sphinxlog/searchd.log + + # query log file, all search queries are logged here + # optional, default is empty (do not log queries) + query_log = /dbs/sphinxlog/query.log + + # client read timeout, seconds + # optional, default is 5 + read_timeout = 5 + + # maximum amount of children to fork (concurrent searches to run) + # optional, default is 0 (unlimited) + max_children = 30 + + # PID file, searchd process ID file name + # mandatory + pid_file = /var/log/searchd.pid + + # max amount of matches the daemon ever keeps in RAM, per-index + # WARNING, THERE'S ALSO PER-QUERY LIMIT, SEE SetLimits() API CALL + # default is 1000 (just like Google) + max_matches = 1000 + + # seamless rotate, prevents rotate stalls if precaching huge datasets + # optional, default is 1 + seamless_rotate = 0 + + # whether to forcibly preopen all indexes on startup + # optional, default is 0 (do not preopen) + preopen_indexes = 0 + + # whether to unlink .old index copies on succesful rotation. + # optional, default is 1 (do unlink) + unlink_old = 1 +} From 3978dc93280ed873dc37397ed71cc58391b50425 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Tue, 8 Nov 2011 14:08:29 +0000 Subject: [PATCH 09/16] =?UTF-8?q?Modification=20de=20la=20configuration=20?= =?UTF-8?q?et=20l'installation=20de=20sphinx=20Suivit=20mail=20de=20michae?= =?UTF-8?q?l.=20Ce=20d=C3=A9compose=20en=20deux=20partie=20l'installation?= =?UTF-8?q?=20et=20la=20configuration=20des=20donn=C3=A9es.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sphinx.sh => Bash pour l'installation configuration.php => php pour la creation de la configuration. --- Sphinx.sh | 103 +++--------------- .../MysqlServer/ent.conf} | 2 +- config/{base => Sphinx}/sphinx.conf | 0 .../MysqlServer/act.conf} | 2 +- .../MysqlServer/dir.conf} | 2 +- config/SphinxHisto/MysqlServer/histo.conf | 0 config/SphinxHisto/sphinx.conf | 77 +++++++++++++ config/base/Master/cmp.conf-MysqlServer | 40 ------- config/base/Master/dir.conf-MysqlServer | 45 -------- config/base/Master/histo.conf-MysqlServer | 23 ---- config/base/Slave/act.conf-MysqlServerSlave | 31 ------ config/base/Slave/cmp.conf-MysqlServerSlave | 40 ------- config/base/Slave/ent.conf-MysqlServerSlave | 44 -------- configure.php | 92 ++++++++++++++++ 14 files changed, 185 insertions(+), 316 deletions(-) rename config/{base/Master/ent.conf-MysqlServer => Sphinx/MysqlServer/ent.conf} (99%) rename config/{base => Sphinx}/sphinx.conf (100%) rename config/{base/Master/act.conf-MysqlServer => SphinxHisto/MysqlServer/act.conf} (99%) rename config/{base/Slave/dir.conf-MysqlServerSlave => SphinxHisto/MysqlServer/dir.conf} (99%) create mode 100644 config/SphinxHisto/MysqlServer/histo.conf create mode 100644 config/SphinxHisto/sphinx.conf delete mode 100644 config/base/Master/cmp.conf-MysqlServer delete mode 100644 config/base/Master/dir.conf-MysqlServer delete mode 100644 config/base/Master/histo.conf-MysqlServer delete mode 100644 config/base/Slave/act.conf-MysqlServerSlave delete mode 100644 config/base/Slave/cmp.conf-MysqlServerSlave delete mode 100644 config/base/Slave/ent.conf-MysqlServerSlave create mode 100644 configure.php diff --git a/Sphinx.sh b/Sphinx.sh index 4159134..5b0cc28 100755 --- a/Sphinx.sh +++ b/Sphinx.sh @@ -1,20 +1,15 @@ #!/bin/bash -#This program as been create by Damien for Scores et decisions ste -#Email : dlasserre@scores-decisions.com -# Comatible uniquement sous linux + allVersion=("2.0.1" "0.9.9") declare -A ERREURS declare -A ASTUCES -#en cours de developpement ! declare -A ASTUCESDEV -#Color declaration ROUGE="\\033[1;31m" NORMAL="\\033[0;39m" CYAN="\\033[1;36m" VERT="\\033[1;32m" - BOLD="\\033[1m" UNDERLINE="\\033[4m" TEXTNONE="\\033[0m" @@ -26,7 +21,6 @@ dbs="Exist" sphinx="Exist" sphinxlog="Exist" -#Tab of erreurs and astuces ERREURS=( ["CHMOD"]="Execute the script with SUDO or in ROOT" ["DIRECTORY"]="Directory not create" @@ -46,21 +40,18 @@ function loadIndication() { done } -# Permet de verifier la valider du superadmin sous linux. if [ `id -u` = 0 ] #Need Root or Sudo then - commande=('--configure' '--install' '--all') + commande=('--install' '--all') for i; do case $i in '--help') - echo -e $ROUGE"*************************************************************************************************************************************"$NORMAL + echo -e $ROUGE"*************************************************************************************************************************************"$NORMAL echo -e "--install version : Vous permet d'installer configurer et crée les indexe et la libstemmer compilation, installation et configuration"; - echo -e "--delete : Vous permet de restaurer les parametres de la machines en supprimer la configuration et l'installation" - echo -e "--help : Vous permet d'acceser a l'aide de SphinxInstall" - echo -e "--refresh : Vous permet de rafraichire les indexes, dans le cas d'une modification des fichier source, exemple BDD ou port, mémoir etc..." - echo -e "--version : Vous retournes les dernieres version disponnibles en téléchargement sur Sphinx." - echo -e $ROUGE"**************************************************************************************************************************************"$NORMAL - exit; + echo -e "--delete : Vous permet de restaurer les parametres de la machines en supprimer la configuration et l'installation" + echo -e "--version : Vous retournes les dernieres version disponnibles en téléchargement sur Sphinx." + echo -e $ROUGE"**************************************************************************************************************************************"$NORMAL + exit; ;; '--delete') `rm -r indexeConf tmp sphinx-* wget* libste* *~ 2> /dev/null` @@ -72,16 +63,13 @@ then echo -e "2. Past version : 0.9.9\n" ;; '--install') - if [ ! -e /dbs ];then `mkdir /dbs`; dbs="Success"; fi - if [ ! -e tmp ];then `mkdir tmp`; fi if [ ! -e /dbs/sphinx ];then echo -e "/dbs/sphinx Doesn't exist !"; exit; fi if [ ! -e /dbs/sphinxlog ];then `mkdir /dbs/sphinxlog`; exit; fi - if [ ! -e /usr/local/sphinx ];then `mkdir /dbs/sphinx`; exit; fi - if [ ! -e /init.d/sphinxsearch ];then `cp initscript/sphinxsearch /etc/init.d/ > /dev/null` ;`chmod +x /etc/init.d/sphinxsearch > /dev/null`; `update-rc.d sphinxsearch defaults > /dev/null`; fi - if [ ! -e config/${HOSTNAME} ];then `mkdir config/${HOSTNAME}`;fi - + if [ ! -e /usr/local/sphinx ];then `mkdir /dbs/sphinx`; exit; fi + if [ ! -e /init.d/sphinxsearch ];then `cp initscript/sphinxsearch /etc/init.d/ > /dev/null` ;`chmod +x /etc/init.d/sphinxsearch > /dev/null`; `update-rc.d sphinxsearch defaults > /dev/null`; fi + if [ ! -e config/${HOSTNAME} ];then `mkdir config/${HOSTNAME}`;fi if [ ! -e sphinx-2.0.1.tar.gz ] || [ ! -e sphinx-0.9.9.tar.gz ] then if [ ! -z $2 ]; then @@ -129,76 +117,11 @@ then echo -e $CYAN"Compilation progress..."$ROUGE if [ $version != "2.0.1-beta" ];then `cd tmp/sphinx-$version ; make; make install ` ; else - `cd tmp/sphinx-$version/ ; make; make install`;fi + `cd tmp/sphinx-$version/ ; make; make install`;fi echo -e $NORMAL" - Complited" - echo -n "Machine MASTER ? (y/n) : "; read response - `touch /usr/local/sphinx/etc/sphinx.conf`; - echo -e $ROUGE"Mode MASTER activated"$NORMAL - echo -e "Tapez 'stop' pour quiter l'invite de création des indexes" - while [ indexe != "stop\n" ]; do - echo -e " Entrez indexe : "; read indexe - if [ $response = 'y' ];then - if [ -e config/base/Master/$indexe.conf-MysqlServer ] - then - `cp config/base/Master/$indexe.conf-MysqlServer config/${HOSTNAME}/` - echo -e "Indexe $indexes as been create !"; - else - break; - fi - else - if [ -e config/base/Slave/$indexe.conf-MysqlServer ] - then - `cp config/base/Slave/$indexe.conf-MysqlServer config/${HOSTNAME}/` - echo -e "Indexe ''$indexes'' as been create !"; - else - break; - fi - fi - done; - `cat config/base/sphinx.conf > /usr/local/sphinx/etc/sphinx.conf `; - `cat config/${HOSTNAME}/*.conf-MysqlServer >> /usr/local/sphinx/etc/sphinx.conf`; - `./Sphinx --refresh` - echo -e $VERT"The installation as been finish ! great ! thank's damien :)"$NORMAL - exit + echo -e $VERT"The installation as been finish ! great ! thank's damien :)"$NORMAL + exit ;; - '--refresh') - `cat config/base/sphinx.conf > /usr/local/sphinx/etc/sphinx.conf` - `cat config/${HOSTNAME}/* >> /usr/local/sphinx/etc/sphinx.conf` - echo -e $VERT"The refresh as been finish ! great ! thank's damien :)"$NORMAL - exit - ;; - '--add') - `mkdir config/${HOSTANME}` - echo -n "Machine MASTER ? (y/n) : "; read response - `touch /usr/local/sphinx/etc/sphinx.conf`; - echo -e $ROUGE"Mode MASTER activated"$NORMAL - echo -e "Tapez 'stop' pour quiter l'invite de création des indexes" - while [ indexe != "stop\n" ]; do - echo -e " Entrez indexe : "; read indexe - if [ $response = 'y' ];then - if [ -e config/base/Master/$indexe.conf-MysqlServer ] - then - `cp config/base/Master/$indexe.conf-MysqlServer config/${HOSTNAME}/` - echo -e "Indexe $indexes as been create !"; - else - break; - fi - else - if [ -e config/base/Slave/$indexe.conf-MysqlServer ] - then - `cp config/base/Slave/$indexe.conf-MysqlServer config/${HOSTNAME}/` - echo -e "Indexe ''$indexes'' as been create !"; - else - break; - fi - fi - done; - `cat config/base/sphinx.conf > /usr/local/sphinx/etc/sphinx.conf `; - `cat config/${HOSTNAME}/*.conf-MysqlServer >> /usr/local/sphinx/etc/sphinx.conf`; - `./Sphinx --refresh` - echo -e $VERT"The installation as been finish ! great ! thank's damien :)"$NORMAL - exit - ;; *) #Default echo -e $ROUGE"[Erreur]" ${ERREURS["CMD"]} $NORMAL diff --git a/config/base/Master/ent.conf-MysqlServer b/config/Sphinx/MysqlServer/ent.conf similarity index 99% rename from config/base/Master/ent.conf-MysqlServer rename to config/Sphinx/MysqlServer/ent.conf index 831d82d..b9f7f15 100644 --- a/config/base/Master/ent.conf-MysqlServer +++ b/config/Sphinx/MysqlServer/ent.conf @@ -38,4 +38,4 @@ index ent charset_table = 0..9, A..Z->a..z, a..z, \ U+23, U+25, U+26, U+2B, U+3D, U+40, \ U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file +} diff --git a/config/base/sphinx.conf b/config/Sphinx/sphinx.conf similarity index 100% rename from config/base/sphinx.conf rename to config/Sphinx/sphinx.conf diff --git a/config/base/Master/act.conf-MysqlServer b/config/SphinxHisto/MysqlServer/act.conf similarity index 99% rename from config/base/Master/act.conf-MysqlServer rename to config/SphinxHisto/MysqlServer/act.conf index 9682316..990ea7b 100644 --- a/config/base/Master/act.conf-MysqlServer +++ b/config/SphinxHisto/MysqlServer/act.conf @@ -28,4 +28,4 @@ index act charset_table = 0..9, A..Z->a..z, a..z, \ U+23, U+25, U+26, U+2B, U+3D, U+40, \ U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file +} diff --git a/config/base/Slave/dir.conf-MysqlServerSlave b/config/SphinxHisto/MysqlServer/dir.conf similarity index 99% rename from config/base/Slave/dir.conf-MysqlServerSlave rename to config/SphinxHisto/MysqlServer/dir.conf index be3e753..bd52a74 100644 --- a/config/base/Slave/dir.conf-MysqlServerSlave +++ b/config/SphinxHisto/MysqlServer/dir.conf @@ -42,4 +42,4 @@ index dir charset_table = 0..9, A..Z->a..z, a..z, \ U+23, U+25, U+26, U+2B, U+3D, U+40, \ U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file +} diff --git a/config/SphinxHisto/MysqlServer/histo.conf b/config/SphinxHisto/MysqlServer/histo.conf new file mode 100644 index 0000000..e69de29 diff --git a/config/SphinxHisto/sphinx.conf b/config/SphinxHisto/sphinx.conf new file mode 100644 index 0000000..893f8f9 --- /dev/null +++ b/config/SphinxHisto/sphinx.conf @@ -0,0 +1,77 @@ + +############################################################################# +## indexer settings +############################################################################# + +indexer +{ + # memory limit, in bytes, kiloytes (16384K) or megabytes (256M) + # optional, default is 32M, max is 2047M, recommended is 256M to 1024M + mem_limit = 2047M + + # maximum IO calls per second (for I/O throttling) + # optional, default is 0 (unlimited) + # + # max_iops = 40 + + + # maximum IO call size, bytes (for I/O throttling) + # optional, default is 0 (unlimited) + # + # max_iosize = 1048576 +} + +############################################################################# +## searchd settings +############################################################################# + +searchd +{ + # IP address to bind on + # optional, default is 0.0.0.0 (ie. listen on all interfaces) + # + # address = 127.0.0.1 + # address = 192.168.0.1 + + + # searchd TCP port number + # mandatory, default is 3312 + listen = 3312 + + # log file, searchd run info is logged here + # optional, default is 'searchd.log' + log = /dbs/sphinxlog/searchd.log + + # query log file, all search queries are logged here + # optional, default is empty (do not log queries) + query_log = /dbs/sphinxlog/query.log + + # client read timeout, seconds + # optional, default is 5 + read_timeout = 5 + + # maximum amount of children to fork (concurrent searches to run) + # optional, default is 0 (unlimited) + max_children = 30 + + # PID file, searchd process ID file name + # mandatory + pid_file = /var/log/searchd.pid + + # max amount of matches the daemon ever keeps in RAM, per-index + # WARNING, THERE'S ALSO PER-QUERY LIMIT, SEE SetLimits() API CALL + # default is 1000 (just like Google) + max_matches = 1000 + + # seamless rotate, prevents rotate stalls if precaching huge datasets + # optional, default is 1 + seamless_rotate = 0 + + # whether to forcibly preopen all indexes on startup + # optional, default is 0 (do not preopen) + preopen_indexes = 0 + + # whether to unlink .old index copies on succesful rotation. + # optional, default is 1 (do unlink) + unlink_old = 1 +} diff --git a/config/base/Master/cmp.conf-MysqlServer b/config/base/Master/cmp.conf-MysqlServer deleted file mode 100644 index d01a87e..0000000 --- a/config/base/Master/cmp.conf-MysqlServer +++ /dev/null @@ -1,40 +0,0 @@ - -source comptage -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = root - sql_pass = scores - sql_db = jo - sql_port = 3306 - sql_query = SELECT id,ape_etab,ape_entrep,source,siren,nic,actif,siege,adr_cp,adr_dep,adr_com,(tel>100000000) AS tel,(fax>100000000) AS fax,cj,capital,age_entrep,age_etab,tca,tcaexp,teff_entrep,teff_etab,rang,dateCrea_etab,eff_entrep,eff_etab,nbEtab,bilType,bilAnnee,bilTca,bilCA,bilCAexp,bilRN FROM etablissements_act; - sql_attr_str2ordinal = bilType - sql_attr_uint = source - sql_attr_uint = actif - sql_attr_uint = siege - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = adr_com - sql_attr_uint = tel - sql_attr_uint = fax - sql_attr_uint = cj - sql_attr_uint = capital - sql_attr_uint = age_entrep - sql_attr_uint = age_etab - sql_attr_uint = tca - sql_attr_uint = tcaexp - sql_attr_uint = teff_entrep - sql_attr_uint = teff_etab - sql_attr_uint = rang - sql_attr_uint = dateCrea_etab - sql_attr_uint = eff_entrep - sql_attr_uint = eff_etab - sql_attr_uint = nbEtab - sql_attr_uint = bilAnnee - sql_attr_uint = bilTca - sql_attr_uint = bilCA - sql_attr_uint = bilCAexp - sql_attr_uint = bilRN - - sql_query_info = SELECT siren, nic, ape_etab,ape_entrep, raisonSociale, enseigne, sigle, adr_libVoie, adr_cp, adr_ville FROM etablissements WHERE id=$id; -} \ No newline at end of file diff --git a/config/base/Master/dir.conf-MysqlServer b/config/base/Master/dir.conf-MysqlServer deleted file mode 100644 index be3e753..0000000 --- a/config/base/Master/dir.conf-MysqlServer +++ /dev/null @@ -1,45 +0,0 @@ -source source_dir -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, siren, actif, \ -IF(civilite='M',1,IF(civilite='MME' OR civilite='MLLE',2,0)) AS genre, \ -CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \ - YEAR(naissance_date) AS naiss_annee, \ -MONTH(naissance_date) AS naiss_mois, \ - DAY(naissance_date) AS naiss_jour, \ -naissance_lieu, adr_dep \ -FROM rncs_dirigeants; -# UNION \ -#SELECT id, siren, 0 AS actif, \ -#'' AS genre, \ -#CONCAT(nom,' ',nomUsage,' ',rs) AS nom, prenom, \ -#0 AS naiss_annee, \ -#0 AS naiss_mois, \ -#0 AS naiss_jour, \ -#'' AS naissance_lieu, 0 AS adr_dep \ -#FROM bodacc_dirigeants_histo; - sql_attr_uint = naiss_annee - sql_attr_uint = naiss_mois - sql_attr_uint = naiss_jour - sql_attr_uint = actif - sql_attr_uint = genre - sql_attr_uint = adr_dep -} - -index dir -{ - source = source_dir - path = /dbs/sphinx/dir - docinfo = extern - morphology = none - #ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/base/Master/histo.conf-MysqlServer b/config/base/Master/histo.conf-MysqlServer deleted file mode 100644 index e58a6ed..0000000 --- a/config/base/Master/histo.conf-MysqlServer +++ /dev/null @@ -1,23 +0,0 @@ -source histo -{ - type = mysql - sql_host = 192.168.78.230 - sql_user = sphinx_histo - sql_pass = sphinx - sql_db = histobodacc - sql_port = 3306 # optional, default is 3306 - sql_query = SELECT id, nomFichier, annee1, dateBod, texte FROM bodacc_ocr; - sql_attr_uint = annee1 - sql_query_info = SELECT * FROM bodacc_ocr WHERE id=$id -} - -index histo -{ - source = histo - path = /home/sphinx/histo - docinfo = extern - morphology = none - min_word_len = 1 - charset_type = sbcs - html_strip = 1 -} diff --git a/config/base/Slave/act.conf-MysqlServerSlave b/config/base/Slave/act.conf-MysqlServerSlave deleted file mode 100644 index 9682316..0000000 --- a/config/base/Slave/act.conf-MysqlServerSlave +++ /dev/null @@ -1,31 +0,0 @@ -source source_act -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, Siren1, RaisonSociale, Siren2, actif, dateLien, IF(dateUpdate>dateInsert,dateUpdate,dateInsert) as dateMaj, \ - source, Pmin*1 AS PminNum, MajMin, PpPm, IF(Pays='','FRA',Pays) AS Pays \ - FROM liens \ - WHERE ActionPart=1 AND Siren1>1000 AND Siren1 IN (SELECT DISTINCT SIREN FROM etablissements_old); - sql_attr_uint = actif - sql_attr_uint = source - sql_attr_uint = PminNum - sql_attr_str2ordinal= MajMin - sql_attr_str2ordinal= PpPm - sql_attr_str2ordinal= Pays -} - -index act -{ - source = source_act - path = /dbs/sphinx/act - docinfo = extern - morphology = none - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/config/base/Slave/cmp.conf-MysqlServerSlave b/config/base/Slave/cmp.conf-MysqlServerSlave deleted file mode 100644 index d01a87e..0000000 --- a/config/base/Slave/cmp.conf-MysqlServerSlave +++ /dev/null @@ -1,40 +0,0 @@ - -source comptage -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = root - sql_pass = scores - sql_db = jo - sql_port = 3306 - sql_query = SELECT id,ape_etab,ape_entrep,source,siren,nic,actif,siege,adr_cp,adr_dep,adr_com,(tel>100000000) AS tel,(fax>100000000) AS fax,cj,capital,age_entrep,age_etab,tca,tcaexp,teff_entrep,teff_etab,rang,dateCrea_etab,eff_entrep,eff_etab,nbEtab,bilType,bilAnnee,bilTca,bilCA,bilCAexp,bilRN FROM etablissements_act; - sql_attr_str2ordinal = bilType - sql_attr_uint = source - sql_attr_uint = actif - sql_attr_uint = siege - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = adr_com - sql_attr_uint = tel - sql_attr_uint = fax - sql_attr_uint = cj - sql_attr_uint = capital - sql_attr_uint = age_entrep - sql_attr_uint = age_etab - sql_attr_uint = tca - sql_attr_uint = tcaexp - sql_attr_uint = teff_entrep - sql_attr_uint = teff_etab - sql_attr_uint = rang - sql_attr_uint = dateCrea_etab - sql_attr_uint = eff_entrep - sql_attr_uint = eff_etab - sql_attr_uint = nbEtab - sql_attr_uint = bilAnnee - sql_attr_uint = bilTca - sql_attr_uint = bilCA - sql_attr_uint = bilCAexp - sql_attr_uint = bilRN - - sql_query_info = SELECT siren, nic, ape_etab,ape_entrep, raisonSociale, enseigne, sigle, adr_libVoie, adr_cp, adr_ville FROM etablissements WHERE id=$id; -} \ No newline at end of file diff --git a/config/base/Slave/ent.conf-MysqlServerSlave b/config/base/Slave/ent.conf-MysqlServerSlave deleted file mode 100644 index 84d34ac..0000000 --- a/config/base/Slave/ent.conf-MysqlServerSlave +++ /dev/null @@ -1,44 +0,0 @@ -source source_ent -{ - type = mysql - sql_host = 192.168.3.30 - sql_user = sphinx - sql_pass = indexer - sql_db = jo - sql_query_pre = - sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\ -' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\ -REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\ -'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \ -actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \ -adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \ -FROM etablissements; - sql_attr_str2ordinal = adr_typeVoie - sql_attr_uint = siren - sql_attr_uint = nic - sql_attr_uint = siege - sql_attr_uint = adr_num - sql_attr_uint = adr_cp - sql_attr_uint = adr_dep - sql_attr_uint = actif - sql_attr_uint = cj - sql_attr_uint = sirenValide - sql_attr_uint = rang - -} - -index ent -{ - source = source_ent - path = /dbs/sphinx/ent - docinfo = extern - wordforms = /usr/local/sphinx/etc/wordforms.txt - abreviations = /usr/local/sphinx/etc/abreviations.txt - ispell_aff = /usr/local/sphinx/etc/francais.aff - charset_type = sbcs - charset_table = 0..9, A..Z->a..z, a..z, \ -U+23, U+25, U+26, U+2B, U+3D, U+40, \ -U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF -} \ No newline at end of file diff --git a/configure.php b/configure.php new file mode 100644 index 0000000..db2e230 --- /dev/null +++ b/configure.php @@ -0,0 +1,92 @@ +hostname = exec('echo $(hostname)'); + $this->sphinx = 'sphinx.conf'; + $this->dirname = 'config/'.$this->hostname.'/'; + (file_exists($this->sphinx))?unlink($this->sphinx):''; + } + + + public function printIndexes($nbServer) + { + $dir = opendir($this->dirname.$this->sql[$nbServer].'/'); + $i = 1; + + while($file = readdir($dir)) { + if($file != '.' and $file != '..') { + echo "\t\t".'['.$i.'] '. $file."\n"; + $this->indexes[$i] = $file;$i++; + } + } + if(count($this->indexes) == 0) { + echo "\tAucun indexes dans le repertoire : '".$this->dirname.$this->sql[$nbServer]."' \n"; + exit; + } + } + + public function printMysqlServer() + { + $dir = opendir($this->dirname); + $i = 1; + + while($rep = readdir($dir)) { + if($rep != '.' and $rep != '..' and is_dir($this->dirname.$rep)) { + echo "\t".'['.$i.'] '.$rep."\n"; + $this->sql[$i] = $rep; + $this->printIndexes($i); + $i++; + } + } + if(count($this->sql) == 0) { + echo "\tAucun serveurs dans le repertoire : '".$this->dirname."' \n"; + exit; + } + } + + public function createConfig($mySqlServer, $index) + { + $dirname = $this->dirname.$mySqlServer.'/'; + $dir = opendir($dirname); + + if(file_exists($dirname.$index)) { + file_put_contents($this->sphinx, file_get_contents($dirname.$index), FILE_APPEND); + return (true); + } + return (false); + } + + public function inviteDeCommande() + { + $handle = fopen('.', 'r'); + $server = ''; + + fwrite(STDOUT, "\n - Serveurs SQL disponnible :\n"); + $this->printMysqlServer(); + while($server != "exit\n") { + echo "Selectionnez Server et Indexe : "; + $server = fgets(STDIN); + $indexes = explode(' ', $server); + if(isset($this->sql[intval($indexes[0])]) and isset($this->indexes[intval($indexes[1])])) { + $this->createConfig($this->sql[intval($indexes[0])], $this->indexes[intval($indexes[1])]); + echo 'Indexe ajouté !'."\n"; + } else + echo 'Cet indexe n\'existe pas !'."\n"; + } + file_put_contents($this->sphinx, file_get_contents($this->dirname.$this->sphinx), FILE_APPEND); + exec('sudo mv '.$this->sphinx.' /usr/local/sphinx/etc/'.$this->sphinx); + } + +} + +$a = new configure(); +$a->inviteDeCommande(); From 92c897def6ecf86a70465aa15d2b156a9d5617d5 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Tue, 8 Nov 2011 14:29:41 +0000 Subject: [PATCH 10/16] Ajout de la conf Historique. --- config/SphinxHisto/MysqlServer/histo.conf | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/config/SphinxHisto/MysqlServer/histo.conf b/config/SphinxHisto/MysqlServer/histo.conf index e69de29..ee22bf6 100644 --- a/config/SphinxHisto/MysqlServer/histo.conf +++ b/config/SphinxHisto/MysqlServer/histo.conf @@ -0,0 +1,23 @@ +ource histo +{ + type = mysql + sql_host = 192.168.78.230 + sql_user = sphinx_histo + sql_pass = sphinx + sql_db = histobodacc + sql_port = 3306 # optional, default is 3306 + sql_query = SELECT id, nomFichier, annee1, dateBod, texte FROM bodacc_ocr; + sql_attr_uint = annee1 + sql_query_info = SELECT * FROM bodacc_ocr WHERE id=$id +} + +index histo +{ + source = histo + path = /home/sphinx/histo + docinfo = extern + morphology = none + min_word_len = 1 + charset_type = sbcs + html_strip = 1 +} From 37a44bf6b011bdea0f9d5baa0ffe9c8a7378becd Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 8 Nov 2011 14:33:36 +0000 Subject: [PATCH 11/16] =?UTF-8?q?seamless=5Frotate=20=C3=A0=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/Sphinx/sphinx.conf | 2 +- config/SphinxHisto/sphinx.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/Sphinx/sphinx.conf b/config/Sphinx/sphinx.conf index 893f8f9..36fd0cf 100644 --- a/config/Sphinx/sphinx.conf +++ b/config/Sphinx/sphinx.conf @@ -65,7 +65,7 @@ searchd # seamless rotate, prevents rotate stalls if precaching huge datasets # optional, default is 1 - seamless_rotate = 0 + seamless_rotate = 1 # whether to forcibly preopen all indexes on startup # optional, default is 0 (do not preopen) diff --git a/config/SphinxHisto/sphinx.conf b/config/SphinxHisto/sphinx.conf index 893f8f9..36fd0cf 100644 --- a/config/SphinxHisto/sphinx.conf +++ b/config/SphinxHisto/sphinx.conf @@ -65,7 +65,7 @@ searchd # seamless rotate, prevents rotate stalls if precaching huge datasets # optional, default is 1 - seamless_rotate = 0 + seamless_rotate = 1 # whether to forcibly preopen all indexes on startup # optional, default is 0 (do not preopen) From 31addc4a5a00b00f8565ebe4adeeb04624f677b5 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 8 Nov 2011 14:35:24 +0000 Subject: [PATCH 12/16] Configuration pour srvws02 --- config/srvws02/sphinx.conf | 77 +++++++++++++++++++++++++++++++++ config/srvws02/srvws02/dir.conf | 36 +++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 config/srvws02/sphinx.conf create mode 100644 config/srvws02/srvws02/dir.conf diff --git a/config/srvws02/sphinx.conf b/config/srvws02/sphinx.conf new file mode 100644 index 0000000..b518273 --- /dev/null +++ b/config/srvws02/sphinx.conf @@ -0,0 +1,77 @@ + +############################################################################# +## indexer settings +############################################################################# + +indexer +{ + # memory limit, in bytes, kiloytes (16384K) or megabytes (256M) + # optional, default is 32M, max is 2047M, recommended is 256M to 1024M + mem_limit = 1024M + + # maximum IO calls per second (for I/O throttling) + # optional, default is 0 (unlimited) + # + max_iops = 40 + + + # maximum IO call size, bytes (for I/O throttling) + # optional, default is 0 (unlimited) + # + # max_iosize = 1048576 +} + +############################################################################# +## searchd settings +############################################################################# + +searchd +{ + # IP address to bind on + # optional, default is 0.0.0.0 (ie. listen on all interfaces) + # + # address = 127.0.0.1 + # address = 192.168.0.1 + + + # searchd TCP port number + # mandatory, default is 3312 + listen = 9312 + + # log file, searchd run info is logged here + # optional, default is 'searchd.log' + log = /dbs/sphinxlog/searchd.log + + # query log file, all search queries are logged here + # optional, default is empty (do not log queries) + query_log = /dbs/sphinxlog/query.log + + # client read timeout, seconds + # optional, default is 5 + read_timeout = 5 + + # maximum amount of children to fork (concurrent searches to run) + # optional, default is 0 (unlimited) + max_children = 30 + + # PID file, searchd process ID file name + # mandatory + pid_file = /var/log/searchd.pid + + # max amount of matches the daemon ever keeps in RAM, per-index + # WARNING, THERE'S ALSO PER-QUERY LIMIT, SEE SetLimits() API CALL + # default is 1000 (just like Google) + max_matches = 1000 + + # seamless rotate, prevents rotate stalls if precaching huge datasets + # optional, default is 1 + seamless_rotate = 1 + + # whether to forcibly preopen all indexes on startup + # optional, default is 0 (do not preopen) + preopen_indexes = 0 + + # whether to unlink .old index copies on succesful rotation. + # optional, default is 1 (do unlink) + unlink_old = 1 +} diff --git a/config/srvws02/srvws02/dir.conf b/config/srvws02/srvws02/dir.conf new file mode 100644 index 0000000..51eca0c --- /dev/null +++ b/config/srvws02/srvws02/dir.conf @@ -0,0 +1,36 @@ +source source_dir +{ + type = mysql + sql_host = 192.168.3.24 + sql_user = sphinx + sql_pass = indexer + sql_db = jo + sql_query_pre = + sql_query = SELECT id, siren, actif, \ + IF(civilite='M',1,IF(civilite='MME' OR civilite='MLLE',2,0)) AS genre, \ + CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \ + YEAR(naissance_date) AS naiss_annee, \ + MONTH(naissance_date) AS naiss_mois, \ + DAY(naissance_date) AS naiss_jour, \ + naissance_lieu, adr_dep \ + FROM rncs_dirigeants; + sql_attr_uint = naiss_annee + sql_attr_uint = naiss_mois + sql_attr_uint = naiss_jour + sql_attr_uint = actif + sql_attr_uint = genre + sql_attr_uint = adr_dep +} + +index dir +{ + source = source_dir + path = /dbs/sphinx/dir + docinfo = extern + morphology = none + #ispell_aff = /usr/local/sphinx/etc/francais.aff + charset_type = sbcs + charset_table = 0..9, A..Z->a..z, a..z, \ + U+23, U+25, U+26, U+2B, U+3D, U+40, \ + U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF +} From eefc57f0926016805ffe7a286d34a54dfc515e3a Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Tue, 8 Nov 2011 14:47:21 +0000 Subject: [PATCH 13/16] modification d'une condition fausse dans le bash. --- Sphinx.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sphinx.sh b/Sphinx.sh index 5b0cc28..3f23075 100755 --- a/Sphinx.sh +++ b/Sphinx.sh @@ -63,11 +63,11 @@ then echo -e "2. Past version : 0.9.9\n" ;; '--install') - if [ ! -e /dbs ];then `mkdir /dbs`; dbs="Success"; fi + if [ ! -e /dbs ];then echo -e "/dbs not exist !"; exit; fi if [ ! -e tmp ];then `mkdir tmp`; fi if [ ! -e /dbs/sphinx ];then echo -e "/dbs/sphinx Doesn't exist !"; exit; fi - if [ ! -e /dbs/sphinxlog ];then `mkdir /dbs/sphinxlog`; exit; fi - if [ ! -e /usr/local/sphinx ];then `mkdir /dbs/sphinx`; exit; fi + if [ ! -e /usr/local/sphinx ];then `mkdir /dbs/sphinx`; fi + if [ ! -e /dbs/sphinxlog ];then `mkdir /dbs/sphinxlog`; fi if [ ! -e /init.d/sphinxsearch ];then `cp initscript/sphinxsearch /etc/init.d/ > /dev/null` ;`chmod +x /etc/init.d/sphinxsearch > /dev/null`; `update-rc.d sphinxsearch defaults > /dev/null`; fi if [ ! -e config/${HOSTNAME} ];then `mkdir config/${HOSTNAME}`;fi if [ ! -e sphinx-2.0.1.tar.gz ] || [ ! -e sphinx-0.9.9.tar.gz ] From 1a8492a0a7de8710342d02bc1142380eb190ca12 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Tue, 8 Nov 2011 14:50:38 +0000 Subject: [PATCH 14/16] =?UTF-8?q?Modification=20du=20/dbs/sphinx=20il=20pe?= =?UTF-8?q?ut=20cr=C3=A9er=20le=20dossier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sphinx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sphinx.sh b/Sphinx.sh index 3f23075..2028907 100755 --- a/Sphinx.sh +++ b/Sphinx.sh @@ -65,7 +65,7 @@ then '--install') if [ ! -e /dbs ];then echo -e "/dbs not exist !"; exit; fi if [ ! -e tmp ];then `mkdir tmp`; fi - if [ ! -e /dbs/sphinx ];then echo -e "/dbs/sphinx Doesn't exist !"; exit; fi + if [ ! -e /dbs/sphinx ];then echo -e "/dbs/sphinx Doesn't exist !"; `mkdir /dbs/sphinx` fi if [ ! -e /usr/local/sphinx ];then `mkdir /dbs/sphinx`; fi if [ ! -e /dbs/sphinxlog ];then `mkdir /dbs/sphinxlog`; fi if [ ! -e /init.d/sphinxsearch ];then `cp initscript/sphinxsearch /etc/init.d/ > /dev/null` ;`chmod +x /etc/init.d/sphinxsearch > /dev/null`; `update-rc.d sphinxsearch defaults > /dev/null`; fi From 3292083c2b315de86ca2414ecac5c6820140c46e Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 8 Nov 2011 15:16:56 +0000 Subject: [PATCH 15/16] Suppression indexerOld --- indexer/sh/indexerOld.sh | 42 ---------------------------------------- 1 file changed, 42 deletions(-) delete mode 100755 indexer/sh/indexerOld.sh diff --git a/indexer/sh/indexerOld.sh b/indexer/sh/indexerOld.sh deleted file mode 100755 index 0bf8be5..0000000 --- a/indexer/sh/indexerOld.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -PATH_BIN=/usr/local/sphinx/bin -PATH_LOG=/dbs/sphinxlog - -DATE=`date '+%Y-%m-%d %H-%M-%S'` - -echo "DEBUT de l'indexation ==== $(date +%H:%M:%S)" >> $PATH_LOG/indexerEtab-$(date +%F).log - -# nombre de lignes dans la table etab -output=$(mysql -h192.168.3.30 -usphinx -pindexer jo < sql/countEtab.sql) -for line in "$output"; do - etab="$line" -done -# Suppression fin de ligne -etab=$(echo $etab|sed -e "s/^[etab ]*//g"||sed -e "s/[ ]*$//g") -# Cast de la variable au cas ou -#etab=$(echo $etab| gawk '{print + 0}') - -# nombre de lignes dans la table etab_tmp -output=$(mysql -h192.168.3.30 -usphinx -pindexer jo < sql/countEtab_tmp.sql) -for line in "$output"; do - etab_tmp="$line" -done -# Suppression fin de ligne -etab_tmp=$(echo $etab_tmp|sed -e "s/^[etab_tmp ]*//g"||sed -e "s/[ ]*$//g") -# Cast de la variable au cas ou -#etab_tmp=$(echo $etab_tmp| gawk '{print + 0}') - -# Comparaison du nombre de lignes entre etab (ancien) et etab_tmp (nouveau) -if test $etab_tmp -gt $etab; then - echo "Il y a $etab_tmp lignes dans la nouvelle table etablissement ($etab lignes dans l'ancienne)" >> $PATH_LOG/indexerEtab-$(date +%F).log -# $PATH_BIN/indexer --rotate --all >> $PATH_LOG/indexer-$(date +%F).log - $PATH_BIN/indexer --rotate ent ent_mns ent_phx >> $PATH_LOG/indexerEtab-$(date +%F).log - echo "Sphinx - terminé : $(date +%H:%M:%S)" >> $PATH_LOG/indexerEtab-$(date +%F).log - mysql -f -uroot -h192.168.3.30 -pscores jo < finIndexationEtab.sql >> $PATH_LOG/indexerEtab-$(date +%F).log -else - # Il y a plus de lignes dans l'ancienne table etablissements ==> On ne fait rien - echo "Il n'y a pas assez de lignes dans la nouvelle table etablissement ($etab_tmp / $etab) !" >> $PATH_LOG/indexerEtab-$(date +%F).log - exit -fi - -echo "FIN ===== $(date +%H:%M:%S)" >> $PATH_LOG/indexerEtab-$(date +%F).log From 215c193982a143d78c7255f74b39150d1d596461 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Tue, 8 Nov 2011 16:04:53 +0000 Subject: [PATCH 16/16] Modification des condition pour le /dbs --- Sphinx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sphinx.sh b/Sphinx.sh index 2028907..41c8137 100755 --- a/Sphinx.sh +++ b/Sphinx.sh @@ -65,7 +65,7 @@ then '--install') if [ ! -e /dbs ];then echo -e "/dbs not exist !"; exit; fi if [ ! -e tmp ];then `mkdir tmp`; fi - if [ ! -e /dbs/sphinx ];then echo -e "/dbs/sphinx Doesn't exist !"; `mkdir /dbs/sphinx` fi + if [ ! -e /dbs/sphinx ];then `mkdir /dbs/sphinx`; fi if [ ! -e /usr/local/sphinx ];then `mkdir /dbs/sphinx`; fi if [ ! -e /dbs/sphinxlog ];then `mkdir /dbs/sphinxlog`; fi if [ ! -e /init.d/sphinxsearch ];then `cp initscript/sphinxsearch /etc/init.d/ > /dev/null` ;`chmod +x /etc/init.d/sphinxsearch > /dev/null`; `update-rc.d sphinxsearch defaults > /dev/null`; fi