diff --git a/1.0/Sphinx.sh b/1.0/Sphinx.sh index 41c8137..3433974 100755 --- a/1.0/Sphinx.sh +++ b/1.0/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 diff --git a/1.0/config/Sphinx/Dev/act.conf b/1.0/config/Sphinx/Dev/act.conf new file mode 100644 index 0000000..cf79880 --- /dev/null +++ b/1.0/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/1.0/config/Sphinx/Dev/dir.conf b/1.0/config/Sphinx/Dev/dir.conf new file mode 100644 index 0000000..4defb61 --- /dev/null +++ b/1.0/config/Sphinx/Dev/dir.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; + 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/1.0/config/Sphinx/Dev/dirtmp.conf b/1.0/config/Sphinx/Dev/dirtmp.conf new file mode 100644 index 0000000..7b056a5 --- /dev/null +++ b/1.0/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/1.0/config/Sphinx/Dev/ent.conf b/1.0/config/Sphinx/Dev/ent.conf new file mode 100644 index 0000000..3c1347c --- /dev/null +++ b/1.0/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/1.0/config/Sphinx/Dev/enttmp.conf b/1.0/config/Sphinx/Dev/enttmp.conf new file mode 100644 index 0000000..609cf1d --- /dev/null +++ b/1.0/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/1.0/config/Sphinx/Dev/histo.conf b/1.0/config/Sphinx/Dev/histo.conf new file mode 100644 index 0000000..063282c --- /dev/null +++ b/1.0/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 +} diff --git a/1.0/config/Sphinx/MysqlServer/ent.conf b/1.0/config/Sphinx/MysqlServer/ent.conf index b9f7f15..0017ecf 100644 --- a/1.0/config/Sphinx/MysqlServer/ent.conf +++ b/1.0/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/1.0/config/Sphinx/MysqlServer/enttmp.conf b/1.0/config/Sphinx/MysqlServer/enttmp.conf new file mode 100644 index 0000000..5ca1118 --- /dev/null +++ b/1.0/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/1.0/config/SphinxHisto/MysqlServer/act.conf b/1.0/config/SphinxHisto/MysqlServer/act.conf index 990ea7b..4a8d83d 100644 --- a/1.0/config/SphinxHisto/MysqlServer/act.conf +++ b/1.0/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/1.0/config/SphinxHisto/MysqlServer/dir.conf b/1.0/config/SphinxHisto/MysqlServer/dir.conf deleted file mode 100644 index bd52a74..0000000 --- a/1.0/config/SphinxHisto/MysqlServer/dir.conf +++ /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 -} diff --git a/1.0/config/SphinxHisto/MysqlServer/dirtmp.conf b/1.0/config/SphinxHisto/MysqlServer/dirtmp.conf new file mode 100644 index 0000000..9597f30 --- /dev/null +++ b/1.0/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/1.0/config/SphinxHisto/MysqlServer/histo.conf b/1.0/config/SphinxHisto/MysqlServer/histo.conf index ee22bf6..407bafe 100644 --- a/1.0/config/SphinxHisto/MysqlServer/histo.conf +++ b/1.0/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/1.0/config/srvws02/srvws02/dir.conf b/1.0/config/srvws02/srvws02/dir.conf index 51eca0c..129a5aa 100644 --- a/1.0/config/srvws02/srvws02/dir.conf +++ b/1.0/config/srvws02/srvws02/dir.conf @@ -1,25 +1,27 @@ -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_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_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; + 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 @@ -28,7 +30,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, \ diff --git a/1.0/configure.php b/1.0/configure.php index db2e230..2e97b30 100644 --- a/1.0/configure.php +++ b/1.0/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)) { diff --git a/1.0/indexer/indexerAct.sh b/1.0/indexer/indexerAct.sh new file mode 100644 index 0000000..4e88909 --- /dev/null +++ b/1.0/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/1.0/indexer/indexerDiri.sh b/1.0/indexer/indexerDiri.sh new file mode 100755 index 0000000..c4511d9 --- /dev/null +++ b/1.0/indexer/indexerDiri.sh @@ -0,0 +1,37 @@ +#!/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/indexerDiri-$(date +%F).log + +# nombre de lignes dans la table etab +output=$(mysql -h192.168.3.30 -usphinx -pindexer jo < sql/countDiri.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") + +# nombre de lignes dans la table diri_tmp +output=$(mysql -h192.168.3.30 -usphinx -pindexer jo < sql/countDiri_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") + +# 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 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 -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 + exit +fi + +echo "FIN ===== $(date +%H:%M:%S)" >> $PATH_LOG/indexerDiri-$(date +%F).log diff --git a/1.0/indexer/indexerEtab.sh b/1.0/indexer/indexerEtab.sh new file mode 100755 index 0000000..5ef9e32 --- /dev/null +++ b/1.0/indexer/indexerEtab.sh @@ -0,0 +1,42 @@ +#!/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 -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 + exit +fi + +echo "FIN ===== $(date +%H:%M:%S)" >> $PATH_LOG/indexerEtab-$(date +%F).log diff --git a/1.0/indexer/sql/countDiri.sql b/1.0/indexer/sql/countDiri.sql index bc24bbe..609a33a 100644 Binary files a/1.0/indexer/sql/countDiri.sql and b/1.0/indexer/sql/countDiri.sql differ