Subversion Repositories Applications.papyrus

Rev

Rev 2137 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2103 drzraf 1
#
2
# Minimal Sphinx configuration sample (clean, simple, functional)
3
#
4
# http://www.tela-botanica.org/page:recherche
5
# mysql -h0 -P 9306
6
# SELECT * FROM i_spip WHERE MATCH('@texte mousse');
7
 
8
# sudo sphinx-indexer i_spip -c /etc/sphinx/sphinx-min.conf
9
# sudo sphinx-searchd -c /etc/sphinx/sphinx-min.conf
10
source common
11
{
12
	type			= mysql
13
 
14
	sql_host		= localhost
2149 mathias 15
	sql_user		= root
16
	sql_pass		= mat87cho
2137 drzraf 17
	sql_db			= tela_prod_v4
2149 mathias 18
	#sql_sock		= /run/mysqld/mysqld.sock
2137 drzraf 19
 
2115 drzraf 20
    sql_query_pre   = SET NAMES utf8
21
    sql_query_pre   = SET CHARACTER_SET_RESULTS=utf8
22
 
23
    sql_query       = SELECT 1
2103 drzraf 24
}
25
 
26
index i_common
27
{
2115 drzraf 28
    # ces deux directive permettent à la source abstraite d'être valide
29
    # lors de l'utilisation de sphinx-search sans précision d'index
30
	source			= common
2137 drzraf 31
	path			= /var/lib/sphinxsearch/void
2103 drzraf 32
	docinfo			= extern
33
	stopwords		= /etc/sphinx/stopwords.txt
34
 
35
    # http://sphinxsearch.com/docs/2.1.1/conf-morphology.html
36
	morphology		= libstemmer_french
37
	enable_star		= 1
38
    min_word_len    = 3
39
    # min_prefix_len  = 3
40
    min_infix_len   = 3
41
 
42
    # prefix_fields   =
43
    # infix_fields    =
44
 
45
    phrase_boundary = ., ?, !, U+2026
46
 
47
    # http://sphinxsearch.com/wiki/doku.php?id=charset_tables
2137 drzraf 48
    # mysql tela_prod_v4<<<"SELECT p_description FROM projet WHERE p_id = 121"|xxd
2103 drzraf 49
    # sphinx-search -q -c sphinx-min.conf -i i_projet "homoge*|homogé"|grep -w hits
50
    # SELECT * FROM i_projet WHERE MATCH('homoge*|homogé'); SHOW META;
2115 drzraf 51
	charset_type	= utf-8
52
    # valeur par défaut, cf http://sphinxsearch.com/docs/archives/1.10/conf-charset-table.html
53
    # pour écraser i_common
54
    charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F, \
55
	    U+041..U+05a, U+0c6, U+0d0, U+0d8, U+110, U+126, U+132, U+13f, U+141, U+14a, \
56
		U+152, U+166, U+181, U+186, U+187, U+18a, U+18e..U+190, U+193, U+198, U+19f, U+1a2, \
57
		U+1b3, U+1c4, U+1c7, U+1ca, U+1e4, U+21c, U+061->U+041, U+0c0->U+041, U+0c1->U+041, \
58
		U+0c2->U+041, U+0c3->U+041, U+0c4->U+041, U+0c5->U+041, U+0e0->U+041, U+0e1->U+041, \
59
		U+0e2->U+041, U+0e3->U+041, U+0e4->U+041, U+0e5->U+041, U+100->U+041, U+101->U+041, \
60
		U+102->U+041, U+103->U+041, U+104->U+041, U+105->U+041, U+1cd->U+041, U+1ce->U+041, \
61
		U+1de->U+041, U+1df->U+041, U+1e0->U+041, U+1e1->U+041, U+1fa->U+041, U+1fb->U+041, \
62
		U+200->U+041, U+201->U+041, U+202->U+041, U+203->U+041, U+226->U+041, U+227->U+041, \
63
		U+1e01->U+041, U+1ea0->U+041, U+1ea1->U+041, U+1ea2->U+041, U+1ea3->U+041, \
64
		U+1ea4->U+041, U+1ea5->U+041, U+1ea6->U+041, U+1ea7->U+041, U+1ea8->U+041, \
65
		U+1ea9->U+041, U+1eaa->U+041, U+1eab->U+041, U+1eac->U+041, U+1ead->U+041, \
66
		U+1eae->U+041, U+1eaf->U+041, U+1eb0->U+041, U+1eb1->U+041, U+1eb2->U+041, \
67
		U+1eb3->U+041, U+1eb4->U+041, U+1eb5->U+041, U+1eb6->U+041, U+1eb7->U+041, \
68
		U+062->U+042, U+1e02->U+042, U+1e03->U+042, U+1e04->U+042, U+1e05->U+042, \
69
		U+1e06->U+042, U+1e07->U+042, U+063->U+043, U+0c7->U+043, U+0e7->U+043, \
70
		U+106->U+043, U+107->U+043, U+108->U+043, U+109->U+043, U+10a->U+043, U+10b->U+043, \
71
		U+10c->U+043, U+10d->U+043, U+1e08->U+043, U+1e09->U+043, U+064->U+044, \
72
		U+10e->U+044, U+10f->U+044, U+1e0a->U+044, U+1e0b->U+044, U+1e0c->U+044, \
73
		U+1e0d->U+044, U+1e0e->U+044, U+1e0f->U+044, U+1e10->U+044, U+1e11->U+044, \
74
		U+1e12->U+044, U+1e13->U+044, U+065->U+045, U+0c8->U+045, U+0c9->U+045, \
75
		U+0ca->U+045, U+0cb->U+045, U+0e8->U+045, U+0e9->U+045, U+0ea->U+045, U+0eb->U+045, \
76
		U+112->U+045, U+113->U+045, U+114->U+045, U+115->U+045, U+116->U+045, U+117->U+045, \
77
		U+118->U+045, U+119->U+045, U+11a->U+045, U+11b->U+045, U+204->U+045, U+205->U+045, \
78
		U+206->U+045, U+207->U+045, U+228->U+045, U+229->U+045, U+1e14->U+045, \
79
		U+1e15->U+045, U+1e16->U+045, U+1e17->U+045, U+1e18->U+045, U+1e19->U+045, \
80
		U+1e1a->U+045, U+1e1b->U+045, U+1e1c->U+045, U+1e1d->U+045, U+1eb8->U+045, \
81
		U+1eb9->U+045, U+1eba->U+045, U+1ebb->U+045, U+1ebc->U+045, U+1ebd->U+045, \
82
		U+1ebe->U+045, U+1ebf->U+045, U+1ec0->U+045, U+1ec1->U+045, U+1ec2->U+045, \
83
		U+1ec3->U+045, U+1ec4->U+045, U+1ec5->U+045, U+1ec6->U+045, U+1ec7->U+045, \
84
		U+066->U+046, U+1e1e->U+046, U+1e1f->U+046, U+067->U+047, U+11c->U+047, \
85
		U+11d->U+047, U+11e->U+047, U+11f->U+047, U+120->U+047, U+121->U+047, U+122->U+047, \
86
		U+123->U+047, U+1e6->U+047, U+1e7->U+047, U+1f4->U+047, U+1f5->U+047, \
87
		U+1e20->U+047, U+1e21->U+047, U+068->U+048, U+124->U+048, U+125->U+048, \
88
		U+21e->U+048, U+21f->U+048, U+1e22->U+048, U+1e23->U+048, U+1e24->U+048, \
89
		U+1e25->U+048, U+1e26->U+048, U+1e27->U+048, U+1e28->U+048, U+1e29->U+048, \
90
		U+1e2a->U+048, U+1e2b->U+048, U+1e96->U+048, U+069->U+049, U+0cc->U+049, \
91
		U+0cd->U+049, U+0ce->U+049, U+0cf->U+049, U+0ec->U+049, U+0ed->U+049, U+0ee->U+049, \
92
		U+0ef->U+049, U+128->U+049, U+129->U+049, U+12a->U+049, U+12b->U+049, U+12c->U+049, \
93
		U+12d->U+049, U+12e->U+049, U+12f->U+049, U+130->U+049, U+131->U+049, U+1cf->U+049, \
94
		U+1d0->U+049, U+208->U+049, U+209->U+049, U+20a->U+049, U+20b->U+049, \
95
		U+1e2c->U+049, U+1e2d->U+049, U+1e2e->U+049, U+1e2f->U+049, U+1ec8->U+049, \
96
		U+1ec9->U+049, U+1eca->U+049, U+1ecb->U+049, U+06a->U+04a, U+134->U+04a, \
97
		U+135->U+04a, U+1f0->U+04a, U+06b->U+04b, U+136->U+04b, U+137->U+04b, U+1e8->U+04b, \
98
		U+1e9->U+04b, U+1e30->U+04b, U+1e31->U+04b, U+1e32->U+04b, U+1e33->U+04b, \
99
		U+1e34->U+04b, U+1e35->U+04b, U+06c->U+04c, U+139->U+04c, U+13a->U+04c, \
100
		U+13b->U+04c, U+13c->U+04c, U+13d->U+04c, U+13e->U+04c, U+1e36->U+04c, \
101
		U+1e37->U+04c, U+1e38->U+04c, U+1e39->U+04c, U+1e3a->U+04c, U+1e3b->U+04c, \
102
		U+1e3c->U+04c, U+1e3d->U+04c, U+06d->U+04d, U+1e3e->U+04d, U+1e3f->U+04d, \
103
		U+1e40->U+04d, U+1e41->U+04d, U+1e42->U+04d, U+1e43->U+04d, U+06e->U+04e, \
104
		U+0d1->U+04e, U+0f1->U+04e, U+143->U+04e, U+144->U+04e, U+145->U+04e, U+146->U+04e, \
105
		U+147->U+04e, U+148->U+04e, U+1f8->U+04e, U+1f9->U+04e, U+1e44->U+04e, \
106
		U+1e45->U+04e, U+1e46->U+04e, U+1e47->U+04e, U+1e48->U+04e, U+1e49->U+04e, \
107
		U+1e4a->U+04e, U+1e4b->U+04e, U+06f->U+04f, U+0d2->U+04f, U+0d3->U+04f, \
108
		U+0d4->U+04f, U+0d5->U+04f, U+0d6->U+04f, U+0f2->U+04f, U+0f3->U+04f, U+0f4->U+04f, \
109
		U+0f5->U+04f, U+0f6->U+04f, U+14c->U+04f, U+14d->U+04f, U+14e->U+04f, U+14f->U+04f, \
110
		U+150->U+04f, U+151->U+04f, U+1a0->U+04f, U+1a1->U+04f, U+1d1->U+04f, U+1d2->U+04f, \
111
		U+1ea->U+04f, U+1eb->U+04f, U+1ec->U+04f, U+1ed->U+04f, U+20c->U+04f, U+20d->U+04f, \
112
		U+20e->U+04f, U+20f->U+04f, U+22a->U+04f, U+22b->U+04f, U+22c->U+04f, U+22d->U+04f, \
113
		U+22e->U+04f, U+22f->U+04f, U+230->U+04f, U+231->U+04f, U+1e4c->U+04f, \
114
		U+1e4d->U+04f, U+1e4e->U+04f, U+1e4f->U+04f, U+1e50->U+04f, U+1e51->U+04f, \
115
		U+1e52->U+04f, U+1e53->U+04f, U+1ecc->U+04f, U+1ecd->U+04f, U+1ece->U+04f, \
116
		U+1ecf->U+04f, U+1ed0->U+04f, U+1ed1->U+04f, U+1ed2->U+04f, U+1ed3->U+04f, \
117
		U+1ed4->U+04f, U+1ed5->U+04f, U+1ed6->U+04f, U+1ed7->U+04f, U+1ed8->U+04f, \
118
		U+1ed9->U+04f, U+1eda->U+04f, U+1edb->U+04f, U+1edc->U+04f, U+1edd->U+04f, \
119
		U+1ede->U+04f, U+1edf->U+04f, U+1ee0->U+04f, U+1ee1->U+04f, U+1ee2->U+04f, \
120
		U+1ee3->U+04f, U+070->U+050, U+1e54->U+050, U+1e55->U+050, U+1e56->U+050, \
121
		U+1e57->U+050, U+071->U+051, U+072->U+052, U+154->U+052, U+155->U+052, \
122
		U+156->U+052, U+157->U+052, U+158->U+052, U+159->U+052, U+210->U+052, U+211->U+052, \
123
		U+212->U+052, U+213->U+052, U+1e58->U+052, U+1e59->U+052, U+1e5a->U+052, \
124
		U+1e5b->U+052, U+1e5c->U+052, U+1e5d->U+052, U+1e5e->U+052, U+1e5f->U+052, \
125
		U+073->U+053, U+0df->U+053, U+15a->U+053, U+15b->U+053, U+15c->U+053, U+15d->U+053, \
126
		U+15e->U+053, U+15f->U+053, U+160->U+053, U+161->U+053, U+17f->U+053, U+218->U+053, \
127
		U+219->U+053, U+1e60->U+053, U+1e61->U+053, U+1e62->U+053, U+1e63->U+053, \
128
		U+1e64->U+053, U+1e65->U+053, U+1e66->U+053, U+1e67->U+053, U+1e68->U+053, \
129
		U+1e69->U+053, U+1e9b->U+053, U+074->U+054, U+162->U+054, U+163->U+054, \
130
		U+164->U+054, U+165->U+054, U+21a->U+054, U+21b->U+054, U+1e6a->U+054, \
131
		U+1e6b->U+054, U+1e6c->U+054, U+1e6d->U+054, U+1e6e->U+054, U+1e6f->U+054, \
132
		U+1e70->U+054, U+1e71->U+054, U+1e97->U+054, U+075->U+055, U+0d9->U+055, \
133
		U+0da->U+055, U+0db->U+055, U+0dc->U+055, U+0f9->U+055, U+0fa->U+055, U+0fb->U+055, \
134
		U+0fc->U+055, U+168->U+055, U+169->U+055, U+16a->U+055, U+16b->U+055, U+16c->U+055, \
135
		U+16d->U+055, U+16e->U+055, U+16f->U+055, U+170->U+055, U+171->U+055, U+172->U+055, \
136
		U+173->U+055, U+1af->U+055, U+1b0->U+055, U+1d3->U+055, U+1d4->U+055, U+1d5->U+055, \
137
		U+1d6->U+055, U+1d7->U+055, U+1d8->U+055, U+1d9->U+055, U+1da->U+055, U+1db->U+055, \
138
		U+1dc->U+055, U+214->U+055, U+215->U+055, U+216->U+055, U+217->U+055, \
139
		U+1e72->U+055, U+1e73->U+055, U+1e74->U+055, U+1e75->U+055, U+1e76->U+055, \
140
		U+1e77->U+055, U+1e78->U+055, U+1e79->U+055, U+1e7a->U+055, U+1e7b->U+055, \
141
		U+1ee4->U+055, U+1ee5->U+055, U+1ee6->U+055, U+1ee7->U+055, U+1ee8->U+055, \
142
		U+1ee9->U+055, U+1eea->U+055, U+1eeb->U+055, U+1eec->U+055, U+1eed->U+055, \
143
		U+1eee->U+055, U+1eef->U+055, U+1ef0->U+055, U+1ef1->U+055, U+076->U+056, \
144
		U+1e7c->U+056, U+1e7d->U+056, U+1e7e->U+056, U+1e7f->U+056, U+077->U+057, \
145
		U+174->U+057, U+175->U+057, U+1e80->U+057, U+1e81->U+057, U+1e82->U+057, \
146
		U+1e83->U+057, U+1e84->U+057, U+1e85->U+057, U+1e86->U+057, U+1e87->U+057, \
147
		U+1e88->U+057, U+1e89->U+057, U+1e98->U+057, U+078->U+058, U+1e8a->U+058, \
148
		U+1e8b->U+058, U+1e8c->U+058, U+1e8d->U+058, U+079->U+059, U+0dd->U+059, \
149
		U+0fd->U+059, U+0ff->U+059, U+176->U+059, U+177->U+059, U+178->U+059, U+232->U+059, \
150
		U+233->U+059, U+1e8e->U+059, U+1e8f->U+059, U+1e99->U+059, U+1ef2->U+059, \
151
		U+1ef3->U+059, U+1ef4->U+059, U+1ef5->U+059, U+1ef6->U+059, U+1ef7->U+059, \
152
		U+1ef8->U+059, U+1ef9->U+059, U+07a->U+05a, U+179->U+05a, U+17a->U+05a, \
153
		U+17b->U+05a, U+17c->U+05a, U+17d->U+05a, U+17e->U+05a, U+1e90->U+05a, \
154
		U+1e91->U+05a, U+1e92->U+05a, U+1e93->U+05a, U+1e94->U+05a, U+1e95->U+05a, \
155
		U+0e6->U+0c6, U+1e2->U+0c6, U+1e3->U+0c6, U+1fc->U+0c6, U+1fd->U+0c6, U+0f0->U+0d0, \
156
		U+0f8->U+0d8, U+1fe->U+0d8, U+1ff->U+0d8, U+111->U+110, U+127->U+126, U+133->U+132, \
157
		U+140->U+13f, U+142->U+141, U+14b->U+14a, U+153->U+152, U+167->U+166, U+253->U+181, \
158
		U+254->U+186, U+188->U+187, U+257->U+18a, U+1dd->U+18e, U+259->U+18f, U+25b->U+190, \
159
		U+260->U+193, U+199->U+198, U+275->U+19f, U+1a3->U+1a2, U+1b4->U+1b3, U+1c5->U+1c4, \
160
		U+1c6->U+1c4, U+1c8->U+1c7, U+1c9->U+1c7, U+1cb->U+1ca, U+1cc->U+1ca, U+1e5->U+1e4, \
161
		U+1f2->U+1f1, U+1f3->U+1f1, U+21d->U+21c
2103 drzraf 162
 
2115 drzraf 163
 
164
 
165
 
2103 drzraf 166
    # later (2.1.1)
167
    # lemmatizer_base = /usr/share/sphinx/dicts/
168
}
169
 
170
 
171
# SPIP
172
source spip : common
173
{
2118 drzraf 174
	# sql_db = tela_prod_spip_actu
2103 drzraf 175
	# bibliotheque/more_recherche_spip_article.class.php
176
	# premier champ = index (obligatoire)
177
 
178
	# surtitre = '' partout
179
	# descriptif = '' partout
180
	# chapo = '' partout
181
	# soustitre = '' partout sauf id = 19
182
	# ps = '' partout sauf id = 19
183
	sql_query		= \
2116 drzraf 184
		SELECT id_article, titre, texte, UNIX_TIMESTAMP(date) AS date, lang, "spip" AS group_id, CONCAT("spip-", id_article) as main_id \
2103 drzraf 185
              FROM spip_articles WHERE statut = "publie"
186
 
187
#	sql_attr_uint		= id_article
188
	sql_attr_timestamp	= date
189
	sql_attr_string		= lang
2105 drzraf 190
	sql_field_string	= group_id      # sql field pour permettre du filtrage @group_id != spip par exemple
2103 drzraf 191
	sql_attr_string		= main_id
192
 
193
	sql_field_string	= titre
194
 
2115 drzraf 195
	sql_query_info		= SELECT * FROM spip_articles WHERE id_article=$id
2103 drzraf 196
}
197
 
198
index i_spip : i_common {
199
	source			= spip
2137 drzraf 200
	path			= /var/lib/sphinxsearch/spip
2103 drzraf 201
 
202
    # prefix_fields   = titre, texte
203
    infix_fields    = titre, texte
204
}
205
 
206
 
207
# PAPYRUS
208
source papyrus : common
209
{
210
    #gm_nom
211
	#gm_titre
212
	#gm_titre_alternatif
213
    #gm_mots_cles                       # TODO
214
    #gm_description_libre               # TODO
215
	#gm_description_resume              # TODO
216
	#gm_description_table_matieres      partout '' sauf gm_id_menu = 1
217
    #gm_source                          partout '' sauf gm_id_menu = 587
218
	#gm_auteur                          # TODO
219
	#gm_contributeur                    # TODO
220
	#gm_editeur                         # TODO
221
	#gm_categorie                       # TODO
222
    #gm_public                          partout ''
223
    #gmc_contenu
224
    sql_query = \
225
        SELECT m.gm_id_menu, \
226
               IF(gm_nom != '', gm_nom, IF(gm_titre != '', gm_titre, gm_titre_alternatif)) as titre, \
227
               gmc_contenu AS texte, \
228
               gm_mots_cles,gm_source, gm_auteur, gm_contributeur, gm_editeur, gm_categorie, \
229
               \
2116 drzraf 230
               UNIX_TIMESTAMP(gm_date_creation) AS date,        \
2103 drzraf 231
               "papyrus" AS group_id,    \
232
               CONCAT("papyrus-", m.gm_id_menu) as main_id \
233
               \
234
               FROM gen_menu m \
235
               LEFT JOIN gen_menu_contenu mc  ON mc.gmc_ce_menu      = m.gm_id_menu \
236
                                              AND mc.gmc_bool_dernier = 1 \
237
               WHERE m.gm_date_fin_validite = '0000-00-00 00:00:00' OR LOWER(m.gm_date_fin_validite) < now()
238
 
2116 drzraf 239
	sql_attr_timestamp	= date
2105 drzraf 240
	sql_field_string	= group_id
2103 drzraf 241
	sql_attr_string		= main_id
2115 drzraf 242
 
243
	sql_query_info		= SELECT * FROM gen_menu WHERE gm_id_menu=$id
2103 drzraf 244
}
245
 
246
index i_papyrus : i_common {
247
	source			= papyrus
2137 drzraf 248
	path			= /var/lib/sphinxsearch/papyrus
2103 drzraf 249
 
250
    # prefix_fields   = titre, texte
251
    infix_fields    = titre, texte
252
}
253
 
254
 
255
 
256
# PROJET
257
source projet : common {
258
    # p_id
259
    # p_titre
260
    # p_resume
261
    # p_description
262
    # pd_nom            # erreur dans more_recherche_projet.class.php
263
    # pd_description    # erreur dans more_recherche_projet.class.php
264
	sql_query		= \
265
        SELECT p_id, p_titre AS titre, p_description AS texte, \
266
               p_resume, \
2116 drzraf 267
               UNIX_TIMESTAMP(p_date_creation) AS date, \
2103 drzraf 268
               "projet" AS group_id,    \
269
               CONCAT("projet-", p_id) as main_id \
270
        FROM projet
271
 
2116 drzraf 272
	sql_attr_timestamp	= date
2105 drzraf 273
	sql_field_string	= group_id
2103 drzraf 274
	sql_attr_string		= main_id
2115 drzraf 275
 
276
	sql_query_info		= SELECT * FROM projet WHERE p_id=$id
2103 drzraf 277
}
278
 
279
index i_projet : i_common {
280
	source			= projet
2137 drzraf 281
	path			= /var/lib/sphinxsearch/projet
2103 drzraf 282
 
283
    # prefix_fields   = titre, texte
284
    infix_fields    = titre, texte
285
}
286
 
287
 
288
 
289
# BAZAR
290
source bazar : common {
291
	sql_query		= \
2116 drzraf 292
        SELECT bf_id_fiche, bf_description AS texte, bf_titre AS titre, UNIX_TIMESTAMP(bf_date_debut_evenement) AS date, \
293
        "bazar" AS group_id, CONCAT("bazar-", bf_id_fiche) as main_id \
2103 drzraf 294
        FROM bazar_fiche
295
 
2116 drzraf 296
	sql_attr_timestamp	= date
2105 drzraf 297
	sql_field_string	= group_id
2103 drzraf 298
	sql_attr_string		= main_id
2115 drzraf 299
 
300
	sql_query_info		= SELECT * FROM bazar_fiche WHERE bf_id_fiche=$id
2103 drzraf 301
}
302
 
303
index i_bazar : i_common {
304
	source			= bazar
2137 drzraf 305
	path			= /var/lib/sphinxsearch/bazar
2103 drzraf 306
 
307
    # prefix_fields   = titre, texte
308
    infix_fields    = titre, texte
309
}
310
 
2112 drzraf 311
 
312
 
313
# COSTE
314
source coste : common {
2115 drzraf 315
	sql_db			= tb_eflore
316
 
2112 drzraf 317
	sql_query		= \
2117 drzraf 318
        SELECT c.flore_bdtfx_nn AS id, c.nom_sci AS titre, dsc.body AS texte, cle.body AS determination, \
319
        "coste" AS group_id, CONCAT("coste-", c.flore_bdtfx_nn) as main_id	\
2112 drzraf 320
        FROM tb_eflore.coste_v2_00 c \
321
        LEFT JOIN tela_prod_wikini.florecoste_pages dsc ON c.page_wiki_dsc = dsc.tag AND dsc.latest = 'Y' \
2117 drzraf 322
        LEFT JOIN tela_prod_wikini.florecoste_pages cle ON c.page_wiki_cle = cle.tag AND cle.latest = 'Y' \
323
        WHERE c.flore_bdtfx_nn != ''
2112 drzraf 324
 
325
	sql_field_string	= group_id
2117 drzraf 326
	sql_attr_string		= main_id
2113 drzraf 327
 
2117 drzraf 328
	sql_query_info	= SELECT * FROM coste_v2_00  WHERE flore_bdtfx_nn=$id
2112 drzraf 329
}
330
 
331
index i_coste : i_common {
332
	source			= coste
2137 drzraf 333
	path			= /var/lib/sphinxsearch/coste
2112 drzraf 334
 
2117 drzraf 335
    infix_fields    = texte, titre
2112 drzraf 336
}
337
 
2123 drzraf 338
 
339
 
340
# NVJFL
341
source nvjfl : common {
342
	sql_db			= tb_eflore
343
 
344
    # note: 66 taxons nvjfl n'ont pas de numéro nomenclatural
345
	sql_query		= \
2129 drzraf 346
        SELECT b.num_nom, num_taxon, nom_sci AS titre, GROUP_CONCAT(DISTINCT nom_vernaculaire) AS texte, \
2123 drzraf 347
        "nvjfl" AS group_id, CONCAT("nvjfl-", b.num_nom) as main_id	\
348
        FROM nvjfl_v2007 n \
2125 drzraf 349
        LEFT JOIN bdtfx_v1_01 b ON n.num_taxon = b.num_taxonomique \
2123 drzraf 350
        WHERE b.num_nom IS NOT NULL \
351
        GROUP by num_taxon
352
 
2129 drzraf 353
	sql_field_string	= titre
354
	sql_field_string	= texte
355
 
2123 drzraf 356
	sql_field_string	= group_id
357
	sql_attr_string		= main_id
358
    sql_attr_uint       = num_taxon
359
 
360
	sql_query_info	= SELECT * FROM nvjfl_v2007 WHERE num_taxon=$id
361
}
362
 
363
index i_nvjfl : i_common {
364
	source			= nvjfl
2137 drzraf 365
	path			= /var/lib/sphinxsearch/nvjfl
2123 drzraf 366
 
367
    infix_fields    = texte, titre
368
}
369
 
370
 
371
 
2128 drzraf 372
# noms scientifiques / noms d'auteur BDTFX
373
source bdtfx : common {
374
	sql_db			= tb_eflore
375
 
376
	sql_query		= \
377
        SELECT b.num_nom, b.nom_sci AS nom_sci, b.auteur AS auteur, \
2134 drzraf 378
        "bdtfx" AS group_id, CONCAT("bdtfx-", b.num_nom) as main_id, b.num_nom, \
379
        CONCAT(bret.nom_sci, ' ', bret.auteur) AS nom_ret \
380
        FROM bdtfx_v1_01 b LEFT JOIN bdtfx_v1_01 bret ON b.num_nom_retenu = bret.num_nom \
2128 drzraf 381
        UNION ALL \
382
        SELECT a.num_nom + 500000, a.nom_sci, a.auteur, \
2134 drzraf 383
        "bdtxa" AS group_id, CONCAT("bdtxa-", a.num_nom) AS main_id, a.num_nom,	\
384
        CONCAT(aret.nom_sci, ' ', aret.auteur) AS nom_ret \
2137 drzraf 385
        FROM bdtxa_v1_01 a LEFT JOIN bdtxa_v1_01 aret ON a.num_nom_retenu = aret.num_nom \
2128 drzraf 386
        UNION ALL \
387
        SELECT i.num_nom + 1000000, i.nom_sci, i.auteur, \
2134 drzraf 388
        "isfan" AS group_id, CONCAT("isfan-", i.num_nom) AS main_id, i.num_nom, \
389
        CONCAT(iret.nom_sci, ' ', iret.auteur) AS nom_ret \
390
        FROM isfan_v2013 i LEFT JOIN isfan_v2013 iret ON i.num_nom_retenu = iret.num_nom
2128 drzraf 391
 
392
	sql_field_string	= group_id
393
	sql_field_string	= nom_sci
394
	sql_field_string	= auteur
395
	sql_attr_string		= main_id
396
    sql_attr_uint       = num_nom
2134 drzraf 397
    sql_attr_string     = nom_ret
2128 drzraf 398
 
2137 drzraf 399
	sql_query_info	= SELECT num_nom, num_nom_retenu, num_tax_sup, rang, nom_sci, genre, auteur, annee, homonyme, nom_francais, num_taxonomique, nom_complet, famille FROM bdtfx_v1_01 \
400
                          WHERE num_nom=$id UNION \
401
                          SELECT num_nom, num_nom_retenu, num_tax_sup, rang, nom_sci, genre, auteur, annee, homonyme, nom_francais, num_tax, nom_complet, famille FROM bdtxa_v1_01 \
402
                          WHERE num_nom=$id UNION \
403
                          SELECT num_nom, num_nom_retenu, num_tax_sup, rang, nom_sci, genre, auteur, annee, NULL, NULL, num_taxonomique, nom_complet, famille FROM isfan_v2013 \
404
                          WHERE num_nom=$id
2128 drzraf 405
}
406
 
407
index i_bdtfx : i_common {
408
	source			= bdtfx
2137 drzraf 409
	path			= /var/lib/sphinxsearch/bdtfx
2128 drzraf 410
 
2132 drzraf 411
	stopwords		=
412
	morphology		=
2128 drzraf 413
    infix_fields    = b.nom_sci, b.auteur
2132 drzraf 414
	enable_star		= 0
415
    min_word_len    = 1
416
    min_prefix_len  = 0
417
    min_infix_len   = 3
418
 
2128 drzraf 419
}
420
 
421
 
2134 drzraf 422
# noms scientifiques / noms d'auteur BDTFX2
423
source bdtfx2 : common {
424
	sql_db			= tb_eflore
2128 drzraf 425
 
2134 drzraf 426
	sql_query		= \
427
        SELECT b.num_nom, b.nom_sci AS nom_sci, b.auteur AS auteur, \
428
        "bdtfx2" AS group_id, CONCAT("bdtfx2-", b.num_nom) as main_id, b.num_nom, \
429
        CONCAT(bret.nom_sci, ' ', bret.auteur) AS nom_ret \
430
        FROM bdtfx_v2_00 b LEFT JOIN bdtfx_v2_00 bret ON b.num_nom_retenu = bret.num_nom \
431
        UNION ALL \
432
        SELECT a.num_nom + 500000, a.nom_sci, a.auteur, \
433
        "bdtxa" AS group_id, CONCAT("bdtxa-", a.num_nom) AS main_id, a.num_nom,	\
434
        CONCAT(aret.nom_sci, ' ', aret.auteur) AS nom_ret \
2137 drzraf 435
        FROM bdtxa_v1_01 a LEFT JOIN bdtxa_v1_01 aret ON a.num_nom_retenu = aret.num_nom \
2134 drzraf 436
        UNION ALL \
437
        SELECT i.num_nom + 1000000, i.nom_sci, i.auteur, \
438
        "isfan" AS group_id, CONCAT("isfan-", i.num_nom) AS main_id, i.num_nom, \
439
        CONCAT(iret.nom_sci, ' ', iret.auteur) AS nom_ret \
440
        FROM isfan_v2013 i LEFT JOIN isfan_v2013 iret ON i.num_nom_retenu = iret.num_nom
441
 
442
	sql_field_string	= group_id
443
	sql_field_string	= nom_sci
444
	sql_field_string	= auteur
445
	sql_attr_string		= main_id
446
    sql_attr_uint       = num_nom
447
    sql_attr_string     = nom_ret
448
 
2137 drzraf 449
	sql_query_info	= SELECT num_nom, num_nom_retenu, num_tax_sup, rang, nom_sci, genre, auteur, annee, homonyme, nom_francais, num_taxonomique, nom_complet, famille FROM bdtfx_v2_00 \
450
                          WHERE num_nom=$id UNION \
451
                          SELECT num_nom, num_nom_retenu, num_tax_sup, rang, nom_sci, genre, auteur, annee, homonyme, nom_francais, num_tax, nom_complet, famille FROM bdtxa_v1_01 \
452
                          WHERE num_nom=$id UNION \
453
                          SELECT num_nom, num_nom_retenu, num_tax_sup, rang, nom_sci, genre, auteur, annee, NULL, NULL, num_taxonomique, nom_complet, famille FROM isfan_v2013 \
454
                          WHERE num_nom=$id
2134 drzraf 455
}
456
 
457
index i_bdtfx2 : i_common {
458
	source			= bdtfx2
2137 drzraf 459
	path			= /var/lib/sphinxsearch/bdtfx2
2134 drzraf 460
 
461
	stopwords		=
462
	morphology		=
463
    infix_fields    = b.nom_sci, b.auteur
464
	enable_star		= 0
465
    min_word_len    = 1
466
    min_prefix_len  = 0
467
    min_infix_len   = 3
468
 
469
}
470
 
471
 
472
 
2123 drzraf 473
# COSTE / NVJFL
474
# source costenvjfl : common {
475
# 	sql_db			= tb_eflore
476
 
477
# 	sql_query		= \
478
#         SELECT c.flore_bdtfx_nn AS id, c.nom_sci AS titre, dsc.body AS texte, cle.body AS determination, \
479
#         GROUP_CONCAT(n.nom_vernaculaire) AS nvjfl, n.num_taxon AS num_taxonomique, \
480
#         "costenvjfl" AS group_id, CONCAT("costenvjfl-", c.flore_bdtfx_nn) as main_id	\
481
#         FROM tb_eflore.coste_v2_00 c \
482
#         LEFT JOIN tela_prod_wikini.florecoste_pages dsc ON c.page_wiki_dsc = dsc.tag AND dsc.latest = 'Y' \
483
#         LEFT JOIN tela_prod_wikini.florecoste_pages cle ON c.page_wiki_cle = cle.tag AND cle.latest = 'Y' \
2125 drzraf 484
#         LEFT JOIN bdtfx_v1_01 b ON c.flore_bdtfx_nn = b.num_nom \
2123 drzraf 485
#         LEFT JOIN nvjfl_v2007 n ON b.num_taxonomique = n.num_taxon \
486
#         WHERE c.flore_bdtfx_nn != ''
487
 
488
# 	sql_field_string	= group_id
489
# 	sql_attr_string		= main_id
490
#     sql_attr_uint       = num_taxonomique
491
 
492
# 	sql_query_info	= SELECT * FROM coste_v2_00  WHERE flore_bdtfx_nn=$id
493
# }
494
 
495
# index i_costenvjfl : i_common {
496
# 	source			= costenvjfl
2137 drzraf 497
# 	path			= /var/lib/sphinxsearch/costenvjfl
2123 drzraf 498
 
499
#     infix_fields    = texte, titre
500
# }
501
 
2117 drzraf 502
# notes:
503
# une nouvelle source d'indexation *DOIT*, pour être utilisable par le moteur de recherche papyrus,
504
# définir les attributs *group_id* et *main_id*.
505
# cf: sphinx_search dans moteur_recherche_sphinx.php
2112 drzraf 506
 
2117 drzraf 507
 
508
 
2112 drzraf 509
# misc...
2116 drzraf 510
# index testrt
511
# {
512
# 	type			= rt
513
# 	rt_mem_limit		= 32M
2103 drzraf 514
 
2137 drzraf 515
# 	path			= /var/lib/sphinxsearch/testrt
2116 drzraf 516
# 	charset_type		= utf-8
2103 drzraf 517
 
2116 drzraf 518
# 	rt_field		= title
519
# 	rt_field		= content
520
# 	rt_attr_uint		= gid
521
# }
2103 drzraf 522
 
523
 
524
indexer
525
{
526
	mem_limit		= 32M
527
}
528
 
529
 
530
searchd
531
{
532
	listen			= 127.0.0.1:9312
533
	listen			= 9306:mysql41
2108 drzraf 534
	log             = /var/log/sphinx/sphinx-searchd.log
2103 drzraf 535
	query_log		= /var/log/sphinx/sphinx-query.log
2108 drzraf 536
	read_timeout	= 5
537
	max_children	= 30
2103 drzraf 538
	pid_file		= /run/sphinx/sphinx-searchd.pid
539
	max_matches		= 1000
2108 drzraf 540
	seamless_rotate	= 1
541
	preopen_indexes	= 1
2103 drzraf 542
	unlink_old		= 1
543
	workers			= threads # for RT to work
544
	binlog_path		= /var/lib/sphinx
545
 
2113 drzraf 546
    # note: les collations n'affectent pas l'indexation mais seulement
547
    # les attributs:
548
    # cf: http://sphinxsearch.com/bugs/view.php?id=1597
549
    # collation_server = utf8_general_ci
2112 drzraf 550
    # collation_libc_locale = fr_FR.UTF-8
2103 drzraf 551
    # collation_libc_locale = fr_FR@euro
552
}
553
 
554
 
2112 drzraf 555
# sudo sphinx-searchd --stopwait -c sphinx-min.conf; sudo sphinx-indexer -c sphinx-min.conf i_projet; sphinx-search -q -c sphinx-min.conf -i i_projet "@texte homogé*"
2103 drzraf 556
# sudo sphinx-searchd -c sphinx-min.conf
2112 drzraf 557
 
558
 
2113 drzraf 559
# problème de charsets et génération de charset_table pour i_coste:
560
# + https://raw.github.com/melo/scripts/master/bin/x-sphinx-charset-generator [ moins fiable ]
2112 drzraf 561
# $ wget https://raw.github.com/tom--/Collation-to-Charset-Table/master/collation_2_charset_table-{1,2}.php
562
# $ php collation_2_charset_table-1.php|sed -n -e '/^[A-Z]/p'|php collation_2_charset_table-2.php