This commit is contained in:
parent
3ba0ebe461
commit
64c8f2ef1e
23
Sphinx.sh
23
Sphinx.sh
@ -127,24 +127,7 @@ then
|
||||
read response
|
||||
for index in ${response[@]}
|
||||
do
|
||||
case $index in
|
||||
"ent")
|
||||
`cp files/SdIndexe/$index.conf indexeConf/$index.sphinx.conf`
|
||||
;;
|
||||
"act")
|
||||
`cp files/SdIndexe/$index.conf indexeConf/$index.sphinx.conf`
|
||||
;;
|
||||
"dir")
|
||||
`cp files/SdIndexe/$index.conf indexeConf/$index.sphinx.conf`
|
||||
;;
|
||||
"comptage")
|
||||
`cp files/SdIndexe/$index.conf indexeConf/$index.sphinx.conf`
|
||||
;;
|
||||
*)
|
||||
`cp files/generic.sphinx.conf indexeConf/$index.sphinx.conf`
|
||||
`sed -e "s/xindex/$index/g" -i indexeConf/$index.sphinx.conf`
|
||||
esac
|
||||
`cat indexeConf/$index.sphinx.conf >> indexeConf/sphinx.conf`
|
||||
createIndexeFile $index "false"
|
||||
echo -e " - Written data in $index.sphinx.conf"
|
||||
echo -e $VERT"File $index as been create"$NORMAL
|
||||
done
|
||||
@ -161,9 +144,7 @@ then
|
||||
echo -e $CYAN"Adding index progress..."$NORMAL
|
||||
`cp files/generic.sphinx.conf indexeConf/$2.sphinx.conf`
|
||||
`sed -e "s/xindex/$2/g" -i indexeConf/$2.sphinx.conf`
|
||||
`cat indexeConf/sphinx.conf > tmp`
|
||||
`cat indexeConf/$2.sphinx.conf > indexeConf/sphinx.conf`
|
||||
`cat tmp >> indexeConf/sphinx.conf`
|
||||
createIndexeFile $2 "true"
|
||||
echo -e " - Check if this index exist"
|
||||
echo -e " - Create file in indexeConf/$2.sphinx.conf"
|
||||
echo -e " - Adding index in sphinx.conf"
|
||||
|
33
function.sh
33
function.sh
@ -18,4 +18,37 @@ function loadIndicationFile() {
|
||||
echo -en "$CYAN Load... / \033[1G"; sleep .07
|
||||
echo -en "$NORMAL Load... |\033[1G"; sleep .07
|
||||
done
|
||||
}
|
||||
|
||||
function createIndexeFile() {
|
||||
if [$2 = "true"];then
|
||||
index=$2
|
||||
else
|
||||
index=$1
|
||||
fi
|
||||
case $index in
|
||||
"ent")
|
||||
`cp files/SdIndexe/$index.conf indexeConf/$index.sphinx.conf`
|
||||
;;
|
||||
"act")
|
||||
`cp files/SdIndexe/$index.conf indexeConf/$index.sphinx.conf`
|
||||
;;
|
||||
"dir")
|
||||
`cp files/SdIndexe/$index.conf indexeConf/$index.sphinx.conf`
|
||||
;;
|
||||
"comptage")
|
||||
`cp files/SdIndexe/$index.conf indexeConf/$index.sphinx.conf`
|
||||
;;
|
||||
*)
|
||||
`cp files/generic.sphinx.conf indexeConf/$index.sphinx.conf`
|
||||
`sed -e "s/xindex/$index/g" -i indexeConf/$index.sphinx.conf`
|
||||
esac
|
||||
if [ $2 == "true" ]
|
||||
then
|
||||
`cat indexeConf/sphinx.conf > tmp`
|
||||
`cat indexeConf/$index.sphinx.conf > indexeConf/sphinx.conf`
|
||||
`cat tmp >> indexeConf/sphinx.conf`
|
||||
else
|
||||
`cat indexeConf/$index.sphinx.conf >> indexeConf/sphinx.conf`
|
||||
fi
|
||||
}
|
116
sphinx.conf
116
sphinx.conf
@ -1,4 +1,62 @@
|
||||
|
||||
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
|
||||
}
|
||||
source source_act
|
||||
{
|
||||
type = mysql
|
||||
@ -109,64 +167,6 @@ index ent_phx
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
#############################################################################
|
||||
## indexer settings
|
||||
#############################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user