Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / sphinx / sphinx_documents @ 17f78427

Historique | Voir | Annoter | Télécharger (664 octets)

1
#!/bin/bash
2

    
3
# Damien Alexandre © 2013
4
#
5
# Output number of documents per Sphinx Index
6
# Need indextool (since version 0.9.9 )
7

    
8
# Index path (where .sphx files are)
9
idxpath=/var/lib/sphinxsearch/data/
10

    
11
#
12
#
13

    
14
case $1 in
15
   config)
16
        cat <<'EOM'
17
graph_title Documents per index
18
graph_vlabel number
19
graph_scale no
20
graph_category search
21
graph_info Report number of documents (using indextool) by Sphinx Index.
22
EOM
23
for i in `ls $idxpath/*.sph`; do
24
	fn=`basename $i .sph`
25
	echo "$fn.label $fn"
26
done
27
        exit 0;;
28
esac
29

    
30
for i in `ls $idxpath/*.sph`; do
31
	echo -n "`basename $i .sph`.value "
32
	echo `indextool --dumpheader $i | grep ^total-doc | cut -f2 -d\:`
33
done