Actualise

This commit is contained in:
Michael RICOIS 2013-10-28 08:40:59 +00:00
parent e7acccd1fc
commit c92efda6c9
15 changed files with 121 additions and 152 deletions

View File

@ -0,0 +1,64 @@
source dir
{
type = mysql
sql_host = 192.168.3.30
sql_user = sphinx
sql_pass = indexer
sql_db = jo
sql_query_pre = SET NAMES utf8
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 = genre
sql_attr_uint = adr_dep
}
index dir
{
source = dir
path = /dbs/sphinx/dir
docinfo = extern
morphology = none
charset_type = utf-8
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0->a, U+C1->a, U+C2->a, U+C3->a, U+C4->a, U+C5->a, U+C6->a, U+C7->c, \
U+C8->e, U+C8->e, U+C9->e, U+CA->e, U+CB->e, U+CC->i, U+CD->i, U+CE->i, \
U+CF->i, U+D0->d, U+D1->n, U+D2->o, U+D3->o, U+D4->o, U+D5->o, U+D6->o, \
U+D8->o, U+D9->u, U+DA->u, U+DB->u, U+DC->u, U+DD->y, U+E0->a, U+E1->a, \
U+E2->a, U+E3->a, U+E4->a, U+E5->a, U+E7->c, U+E8->e, U+E9->e, U+EA->e, \
U+EB->e, U+EC->i, U+ED->i, U+EE->i, U+EF->i, U+F1->n, U+F2->o, U+F3->o, \
U+F4->o, U+F5->o, U+F6->o, U+F8->o, U+F9->u, U+FA->u,U+FB->u, U+FC->u, \
U+FD->y, U+FF->y, U+0152->U+0153, U+0153
}
index dir_phx
{
source = dir
path = /dbs/sphinx/dir_phx
docinfo = extern
morphology = libstemmer_french
charset_type = utf-8
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0->a, U+C1->a, U+C2->a, U+C3->a, U+C4->a, U+C5->a, U+C6->a, U+C7->c, \
U+C8->e, U+C8->e, U+C9->e, U+CA->e, U+CB->e, U+CC->i, U+CD->i, U+CE->i, \
U+CF->i, U+D0->d, U+D1->n, U+D2->o, U+D3->o, U+D4->o, U+D5->o, U+D6->o, \
U+D8->o, U+D9->u, U+DA->u, U+DB->u, U+DC->u, U+DD->y, U+E0->a, U+E1->a, \
U+E2->a, U+E3->a, U+E4->a, U+E5->a, U+E7->c, U+E8->e, U+E9->e, U+EA->e, \
U+EB->e, U+EC->i, U+ED->i, U+EE->i, U+EF->i, U+F1->n, U+F2->o, U+F3->o, \
U+F4->o, U+F5->o, U+F6->o, U+F8->o, U+F9->u, U+FA->u,U+FB->u, U+FC->u, \
U+FD->y, U+FF->y, U+0152->U+0153, U+0153
}

View File

@ -31,7 +31,6 @@ index dir
path = /dbs/sphinx/dir
docinfo = extern
morphology = none
#ispell_aff = /usr/local/sphinx/etc/francais.aff
charset_type = utf-8
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \

View File

@ -1,37 +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, 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
}

View File

@ -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 = 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
}

View File

@ -1,37 +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, 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
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
}

View File

@ -0,0 +1,7 @@
#!/bin/bash
PATH_BIN=/usr/local/sphinx/bin
PATH_LOG=/dbs/sphinxlog
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

View File

@ -0,0 +1,8 @@
#!/bin/bash
PATH_BIN=/usr/local/sphinx/bin
PATH_LOG=/dbs/sphinxlog
echo "DEBUT de l'indexation ==== $(date +%H:%M:%S)" >> $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
echo "FIN ===== $(date +%H:%M:%S)" >> $PATH_LOG/indexerDiri-$(date +%F).log

View File

@ -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