From e041f5484220999360f72603cab9dd754e516d1a Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Wed, 16 Nov 2011 13:47:57 +0000 Subject: [PATCH 1/7] Modification du configuration.php pour ne lister que les .conf et pas les autre fichiers dans les indexes --- configure.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.php b/configure.php index db2e230..2e97b30 100644 --- a/configure.php +++ b/configure.php @@ -23,7 +23,8 @@ Class configure $i = 1; while($file = readdir($dir)) { - if($file != '.' and $file != '..') { + $extension = explode('.', $file); + if($file != '.' and $file != '..' and $extension[1] == 'conf') { echo "\t\t".'['.$i.'] '. $file."\n"; $this->indexes[$i] = $file;$i++; } @@ -36,7 +37,7 @@ Class configure public function printMysqlServer() { - $dir = opendir($this->dirname); + $dir = opendir($this->dirname); $i = 1; while($rep = readdir($dir)) { From fb43745934e4646bffb32a97e589e780e527ddb6 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 21 Nov 2011 11:08:28 +0000 Subject: [PATCH 2/7] Ajout fichier en developpement --- config/Sphinx/Dev/act.conf | 32 +++++++++++++++++++++++++++ config/Sphinx/Dev/dir.conf | 36 ++++++++++++++++++++++++++++++ config/Sphinx/Dev/ent.conf | 40 ++++++++++++++++++++++++++++++++++ config/Sphinx/Dev/enttmp.conf | 41 +++++++++++++++++++++++++++++++++++ config/Sphinx/Dev/histo.conf | 23 ++++++++++++++++++++ 5 files changed, 172 insertions(+) create mode 100644 config/Sphinx/Dev/act.conf create mode 100644 config/Sphinx/Dev/dir.conf create mode 100644 config/Sphinx/Dev/ent.conf create mode 100644 config/Sphinx/Dev/enttmp.conf create mode 100644 config/Sphinx/Dev/histo.conf diff --git a/config/Sphinx/Dev/act.conf b/config/Sphinx/Dev/act.conf new file mode 100644 index 0000000..0b64120 --- /dev/null +++ b/config/Sphinx/Dev/act.conf @@ -0,0 +1,32 @@ +source source_act +{ + type = mysql + sql_host = 192.168.78.230 + 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 +} diff --git a/config/Sphinx/Dev/dir.conf b/config/Sphinx/Dev/dir.conf new file mode 100644 index 0000000..609fb58 --- /dev/null +++ b/config/Sphinx/Dev/dir.conf @@ -0,0 +1,36 @@ +source dir +{ + 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, 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 + 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 +} diff --git a/config/Sphinx/Dev/ent.conf b/config/Sphinx/Dev/ent.conf new file mode 100644 index 0000000..3c1347c --- /dev/null +++ b/config/Sphinx/Dev/ent.conf @@ -0,0 +1,40 @@ +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; + 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 = 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 +} diff --git a/config/Sphinx/Dev/enttmp.conf b/config/Sphinx/Dev/enttmp.conf new file mode 100644 index 0000000..609cf1d --- /dev/null +++ b/config/Sphinx/Dev/enttmp.conf @@ -0,0 +1,41 @@ +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 = 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 +} diff --git a/config/Sphinx/Dev/histo.conf b/config/Sphinx/Dev/histo.conf new file mode 100644 index 0000000..063282c --- /dev/null +++ b/config/Sphinx/Dev/histo.conf @@ -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 +} From 81dfda1597729151f74c538347d035a88a6881e6 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 21 Nov 2011 11:11:00 +0000 Subject: [PATCH 3/7] =?UTF-8?q?Mise=20=C3=A0=20jour=20des=20configs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/Sphinx/MysqlServer/ent.conf | 49 +++++++++++------------ config/Sphinx/MysqlServer/enttmp.conf | 41 +++++++++++++++++++ config/SphinxHisto/MysqlServer/act.conf | 17 ++++---- config/SphinxHisto/MysqlServer/dir.conf | 39 +++++++----------- config/SphinxHisto/MysqlServer/histo.conf | 18 ++++----- config/srvws02/srvws02/dir.conf | 28 ++++++------- 6 files changed, 112 insertions(+), 80 deletions(-) create mode 100644 config/Sphinx/MysqlServer/enttmp.conf diff --git a/config/Sphinx/MysqlServer/ent.conf b/config/Sphinx/MysqlServer/ent.conf index b9f7f15..0017ecf 100644 --- a/config/Sphinx/MysqlServer/ent.conf +++ b/config/Sphinx/MysqlServer/ent.conf @@ -1,41 +1,40 @@ -source source_ent +source ent { type = mysql - sql_host = 192.168.78.230 + 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 - + ' "" ',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 + 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 + 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 } diff --git a/config/Sphinx/MysqlServer/enttmp.conf b/config/Sphinx/MysqlServer/enttmp.conf new file mode 100644 index 0000000..5ca1118 --- /dev/null +++ b/config/Sphinx/MysqlServer/enttmp.conf @@ -0,0 +1,41 @@ +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 = 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 +} diff --git a/config/SphinxHisto/MysqlServer/act.conf b/config/SphinxHisto/MysqlServer/act.conf index 990ea7b..619b3a4 100644 --- a/config/SphinxHisto/MysqlServer/act.conf +++ b/config/SphinxHisto/MysqlServer/act.conf @@ -1,15 +1,16 @@ source source_act { - type = mysql + type = mysql sql_host = 192.168.3.30 sql_user = sphinx sql_pass = indexer - sql_db = jo + 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_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 @@ -26,6 +27,6 @@ index act 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 + 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 } diff --git a/config/SphinxHisto/MysqlServer/dir.conf b/config/SphinxHisto/MysqlServer/dir.conf index bd52a74..0f74f94 100644 --- a/config/SphinxHisto/MysqlServer/dir.conf +++ b/config/SphinxHisto/MysqlServer/dir.conf @@ -1,4 +1,4 @@ -source source_dir +source dir { type = mysql sql_host = 192.168.3.30 @@ -6,29 +6,21 @@ source source_dir 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_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 + sql_attr_uint = actif + sql_attr_uint = genre + sql_attr_uint = adr_dep } index dir @@ -37,9 +29,8 @@ index 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 + 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 } diff --git a/config/SphinxHisto/MysqlServer/histo.conf b/config/SphinxHisto/MysqlServer/histo.conf index ee22bf6..407bafe 100644 --- a/config/SphinxHisto/MysqlServer/histo.conf +++ b/config/SphinxHisto/MysqlServer/histo.conf @@ -1,7 +1,7 @@ -ource histo +source histo { type = mysql - sql_host = 192.168.78.230 + sql_host = 192.168.3.24 sql_user = sphinx_histo sql_pass = sphinx sql_db = histobodacc @@ -13,11 +13,11 @@ ource histo index histo { - source = histo - path = /home/sphinx/histo - docinfo = extern - morphology = none - min_word_len = 1 - charset_type = sbcs - html_strip = 1 + source = histo + path = /home/sphinx/histo + docinfo = extern + morphology = none + min_word_len = 1 + charset_type = sbcs + html_strip = 1 } diff --git a/config/srvws02/srvws02/dir.conf b/config/srvws02/srvws02/dir.conf index 51eca0c..0f74f94 100644 --- a/config/srvws02/srvws02/dir.conf +++ b/config/srvws02/srvws02/dir.conf @@ -1,25 +1,26 @@ -source source_dir +source dir { type = mysql - sql_host = 192.168.3.24 + 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, 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 + sql_attr_uint = actif + sql_attr_uint = genre + sql_attr_uint = adr_dep } index dir @@ -28,7 +29,6 @@ index 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, \ From 41b415961bc358e7704b47c81af9f56f54c8d568 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 25 Nov 2011 16:21:43 +0000 Subject: [PATCH 4/7] script d'indexation --- indexer/indexerAct.sh | 9 +++++++++ indexer/{sh => }/indexerDiri.sh | 2 +- indexer/{sh => }/indexerEtab.sh | 2 +- indexer/sql/countDiri.sql | Bin 1533 -> 44 bytes 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 indexer/indexerAct.sh rename indexer/{sh => }/indexerDiri.sh (92%) rename indexer/{sh => }/indexerEtab.sh (93%) diff --git a/indexer/indexerAct.sh b/indexer/indexerAct.sh new file mode 100644 index 0000000..4e88909 --- /dev/null +++ b/indexer/indexerAct.sh @@ -0,0 +1,9 @@ +#!/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/indexerAct-$(date +%F).log +$PATH_BIN/indexer --rotate act act_phx >> $PATH_LOG/indexerAct-$(date +%F).log +echo "FIN ===== $(date +%H:%M:%S)" >> $PATH_LOG/indexerAct-$(date +%F).log diff --git a/indexer/sh/indexerDiri.sh b/indexer/indexerDiri.sh similarity index 92% rename from indexer/sh/indexerDiri.sh rename to indexer/indexerDiri.sh index 5564529..c4511d9 100755 --- a/indexer/sh/indexerDiri.sh +++ b/indexer/indexerDiri.sh @@ -27,7 +27,7 @@ if test $etab_tmp -gt $etab; then echo "Il y a $etab_tmp lignes dans la nouvelle table dirigeants ($etab lignes dans l'ancienne)" >> $PATH_LOG/indexerDiri-$(date +%F).log $PATH_BIN/indexer --rotate dir dir_phx >> $PATH_LOG/indexerDiri-$(date +%F).log echo "Sphinx - termine : $(date +%H:%M:%S)" >> $PATH_LOG/indexerDiri-$(date +%F).log - mysql -f -uroot -h192.168.3.30 -pscores jo < finIndexationDiri.sql >> $PATH_LOG/indexerDiri-$(date +%F).log + mysql -f -usphinx -h192.168.3.30 -pindexer jo < sql/finIndexationDiri.sql >> $PATH_LOG/indexerDiri-$(date +%F).log else # Il y a plus de lignes dans l'ancienne table dirigeants ==> On ne fait rien echo "Il n'y a pas assez de lignes dans la nouvelle table dirigeants ($etab_tmp / $etab) !" >> $PATH_LOG/indexerDiri-$(date +%F).log diff --git a/indexer/sh/indexerEtab.sh b/indexer/indexerEtab.sh similarity index 93% rename from indexer/sh/indexerEtab.sh rename to indexer/indexerEtab.sh index 0bf8be5..5ef9e32 100755 --- a/indexer/sh/indexerEtab.sh +++ b/indexer/indexerEtab.sh @@ -32,7 +32,7 @@ if test $etab_tmp -gt $etab; then # $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 + mysql -f -usphinx -h192.168.3.30 -pindexer jo < sql/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 diff --git a/indexer/sql/countDiri.sql b/indexer/sql/countDiri.sql index bc24bbe0228a8b98ce58eff726ee621dc3503976..609a33a24c4bec461996bcd81a9ab1ef0474dc40 100644 GIT binary patch literal 44 zcmWG`^>K9$QAo}&%`4H+(o}E^R!A*LOo}hbEl@}+%Fk6u$t=oDPfg4#DYgaxJgyG@ literal 1533 zcmV2K|NlSd{%imL|Na0V2~5BM0ssIA zUQ zRe)ju&;%$qwNR*5g%OVlm_0stNJQ8XgnRGQ^R@AeUm(LEWo;NcLi##ftwWG(9IeBt zy${RL1Q-E=52OeXE>y9`IaS0DQk|(1BzDy}T!ZFlC!M+U2dcs#!NHJL0DBlSr2*h< zY-BbMP2*r|a{=27T&7esJ_lXKZ8@PxP=HX~;dvL7?8 zaWD@v0hLm;EdcP3DReAU@UaNQeNcO9lwuiP>Jf-hp#K45=(-T%Y9@9*00uj8<|H6o zJvWixaB(!nhiy||;yM^T07EmAWr<8c=`$_MDsNic#eNEaNCg89T!HMSyC?Hd`Z%3=o;=H_uE|y%Cq0o|znJ+TYFu15z(JZy~%E6&zTU~M+awS-(g>{6LbCcq&$hp6gn2E-%G{i>8|sp47S$P|39Ac5xt%(xA!ZOvI)c+RjL zgI(n`geF$@Pkr?TRb(z!>!5`APvui1`iRIIgbhWGf$4U=KW-u%P;jey8^#0?$; z#Szmu5~&^C^(r65(N96jP$_JTCBc3!XCu zgRV$WW3Wb`&@AJ)5X#;$4DS-U&||ph5Xl=5%;c&ZYCMi%$~0ni9n{2Nj;n#n97@!| z%rP__#Uvsd?ooBLanHO7%pAhnL)t>5BsPSAHhx$Q3Koq>2GGn~4v6S_LSn{+nE(m@A z!79Q@7(zl-1BiNPJ3%!f;F;Wrd<`8;DR9=IxH_Eb6HLJ{ZQC8uy$s@*1PEH-aI^;cXN?o_>THi%T` zBrqW`x3~^Q&~JJ#C^#T>Tb$Dz&r>Mxjj8@22u-Y7Igo&u8UQMH98Pd5XcR7Oat&B9 z8i;pMAgp3Jm5LVR0_3vr5-GBPYY{L91RQ~2YGXin#%Xjgci!L}0NRO|F+%Xg4znEK j3~hT%b|GU>yy7(sXzLzu|BMZS5B@IXig2MJ Date: Fri, 25 Nov 2011 16:37:44 +0000 Subject: [PATCH 5/7] Confusion dans la configuration --- config/Sphinx/Dev/dir.conf | 31 +++++++++--------- config/Sphinx/Dev/dirtmp.conf | 37 ++++++++++++++++++++++ config/SphinxHisto/MysqlServer/dir.conf | 36 --------------------- config/SphinxHisto/MysqlServer/dirtmp.conf | 37 ++++++++++++++++++++++ config/srvws02/srvws02/dir.conf | 29 +++++++++-------- 5 files changed, 105 insertions(+), 65 deletions(-) create mode 100644 config/Sphinx/Dev/dirtmp.conf delete mode 100644 config/SphinxHisto/MysqlServer/dir.conf create mode 100644 config/SphinxHisto/MysqlServer/dirtmp.conf diff --git a/config/Sphinx/Dev/dir.conf b/config/Sphinx/Dev/dir.conf index 609fb58..188a76d 100644 --- a/config/Sphinx/Dev/dir.conf +++ b/config/Sphinx/Dev/dir.conf @@ -7,25 +7,26 @@ source dir 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 + 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; + 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 = adr_dep } index dir { - source = source_dir + source = dir path = /dbs/sphinx/dir docinfo = extern morphology = none diff --git a/config/Sphinx/Dev/dirtmp.conf b/config/Sphinx/Dev/dirtmp.conf new file mode 100644 index 0000000..e26bd34 --- /dev/null +++ b/config/Sphinx/Dev/dirtmp.conf @@ -0,0 +1,37 @@ +source dir +{ + 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, 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 = adr_dep +} + +index dir +{ + source = dir + path = /dbs/sphinx/dir + 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 +} diff --git a/config/SphinxHisto/MysqlServer/dir.conf b/config/SphinxHisto/MysqlServer/dir.conf deleted file mode 100644 index 0f74f94..0000000 --- a/config/SphinxHisto/MysqlServer/dir.conf +++ /dev/null @@ -1,36 +0,0 @@ -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_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 - 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 -} diff --git a/config/SphinxHisto/MysqlServer/dirtmp.conf b/config/SphinxHisto/MysqlServer/dirtmp.conf new file mode 100644 index 0000000..62472cb --- /dev/null +++ b/config/SphinxHisto/MysqlServer/dirtmp.conf @@ -0,0 +1,37 @@ +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, 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 = adr_dep +} + +index dir +{ + source = source_dir + path = /dbs/sphinx/dir + 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 +} diff --git a/config/srvws02/srvws02/dir.conf b/config/srvws02/srvws02/dir.conf index 0f74f94..197d68c 100644 --- a/config/srvws02/srvws02/dir.conf +++ b/config/srvws02/srvws02/dir.conf @@ -7,20 +7,21 @@ source dir 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 + 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; + 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 = adr_dep } index dir From cc8e122575a2168fa83c5d90a8bc1fa42d59939e Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 28 Nov 2011 08:10:53 +0000 Subject: [PATCH 6/7] =?UTF-8?q?Correction=20retour=20=C3=A0=20la=20ligne?= =?UTF-8?q?=20dans=20la=20requete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/Sphinx/Dev/act.conf | 2 +- config/Sphinx/Dev/dir.conf | 2 +- config/Sphinx/Dev/dirtmp.conf | 2 +- config/SphinxHisto/MysqlServer/act.conf | 2 +- config/SphinxHisto/MysqlServer/dirtmp.conf | 2 +- config/srvws02/srvws02/dir.conf | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/Sphinx/Dev/act.conf b/config/Sphinx/Dev/act.conf index 0b64120..cf79880 100644 --- a/config/Sphinx/Dev/act.conf +++ b/config/Sphinx/Dev/act.conf @@ -6,7 +6,7 @@ source source_act sql_pass = indexer sql_db = jo sql_query_pre = - sql_query = + 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 \ diff --git a/config/Sphinx/Dev/dir.conf b/config/Sphinx/Dev/dir.conf index 188a76d..4defb61 100644 --- a/config/Sphinx/Dev/dir.conf +++ b/config/Sphinx/Dev/dir.conf @@ -6,7 +6,7 @@ source dir sql_pass = indexer sql_db = jo sql_query_pre = - sql_query = + 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, \ diff --git a/config/Sphinx/Dev/dirtmp.conf b/config/Sphinx/Dev/dirtmp.conf index e26bd34..7b056a5 100644 --- a/config/Sphinx/Dev/dirtmp.conf +++ b/config/Sphinx/Dev/dirtmp.conf @@ -6,7 +6,7 @@ source dir sql_pass = indexer sql_db = jo sql_query_pre = - sql_query = + 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, \ diff --git a/config/SphinxHisto/MysqlServer/act.conf b/config/SphinxHisto/MysqlServer/act.conf index 619b3a4..4a8d83d 100644 --- a/config/SphinxHisto/MysqlServer/act.conf +++ b/config/SphinxHisto/MysqlServer/act.conf @@ -6,7 +6,7 @@ source source_act sql_pass = indexer sql_db = jo sql_query_pre = - sql_query = + 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 \ diff --git a/config/SphinxHisto/MysqlServer/dirtmp.conf b/config/SphinxHisto/MysqlServer/dirtmp.conf index 62472cb..9597f30 100644 --- a/config/SphinxHisto/MysqlServer/dirtmp.conf +++ b/config/SphinxHisto/MysqlServer/dirtmp.conf @@ -6,7 +6,7 @@ source dir sql_pass = indexer sql_db = jo sql_query_pre = - sql_query = + 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, \ diff --git a/config/srvws02/srvws02/dir.conf b/config/srvws02/srvws02/dir.conf index 197d68c..129a5aa 100644 --- a/config/srvws02/srvws02/dir.conf +++ b/config/srvws02/srvws02/dir.conf @@ -6,7 +6,7 @@ source dir sql_pass = indexer sql_db = jo sql_query_pre = - sql_query = + 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, \ From 1ba2583ae50917b7a6ed3e572f1a2232ac0951f5 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Thu, 8 Dec 2011 08:33:02 +0000 Subject: [PATCH 7/7] Ajout de la version 2.0.2 de sphinx --- Sphinx.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Sphinx.sh b/Sphinx.sh index 41c8137..3433974 100755 --- a/Sphinx.sh +++ b/Sphinx.sh @@ -1,6 +1,6 @@ #!/bin/bash -allVersion=("2.0.1" "0.9.9") +allVersion=("2.0.1" "0.9.9" "2.0.2") declare -A ERREURS declare -A ASTUCES @@ -32,7 +32,7 @@ ASTUCES=( function loadIndication() { while [ -d "/proc/$1" ] - do #Current PID in /proc | + do #Current PID in /proc echo -en "Loading... /\033[1G"; sleep .07 echo -en "Loading... -\033[1G"; sleep .07 echo -en "Loading... / \033[1G"; sleep .07 @@ -70,13 +70,15 @@ then 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 ] + if [ ! -e sphinx-2.0.1.tar.gz ] || [ ! -e sphinx-0.9.9.tar.gz ] || [ ! -e sphinx-2.0.2.tar.gz ] then if [ ! -z $2 ]; then if [ $2 == "2.0.1" ]; then version="$2-beta" elif [ $2 == "0.9.9" ]; then - version="$2" + version="$2-beta" + elif [ $2 == "2.0.2" ]; then + version="$2" else echo -e $ROUGE"[Erreur]: This version not exist !"$NORMAL exit