From 0f672f4c8374df8f14ee3bd9393d956a875d3bf3 Mon Sep 17 00:00:00 2001 From: Damien Alexandre Date: Fri, 7 Jun 2013 17:37:01 -0400 Subject: [PATCH 1/2] New Sphinx Plugin: sphinx_documents --- plugins/sphinx/sphinx_documents | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 plugins/sphinx/sphinx_documents diff --git a/plugins/sphinx/sphinx_documents b/plugins/sphinx/sphinx_documents new file mode 100755 index 00000000..6f0866cd --- /dev/null +++ b/plugins/sphinx/sphinx_documents @@ -0,0 +1,33 @@ +#!/bin/bash + +# Damien Alexandre © 2013 +# +# Output number of documents per Sphinx Index +# Need indextool (since version 0.9.9 ) + +# Index path (where sphx files are) +idxpath=/var/lib/sphinxsearch/data/ + +# +# + +case $1 in + config) + cat <<'EOM' +graph_title Documents par index +graph_vlabel nombre +graph_scale no +graph_category sphinx +graph_info Report number of documents (using indextool) by Sphinx Index. +EOM +for i in `ls $idxpath/*.sph`; do + fn=`basename $i .sph` + echo "$fn.label $fn" +done + exit 0;; +esac + +for i in `ls $idxpath/*.sph`; do + echo -n "`basename $i .sph`.value " + echo `indextool --dumpheader $i | grep ^total-doc | cut -f2 -d\:` +done From 52f29a4c9b1d0699fd52b23110be553c923a5bf1 Mon Sep 17 00:00:00 2001 From: Damien Alexandre Date: Fri, 7 Jun 2013 17:43:34 -0400 Subject: [PATCH 2/2] English comment --- plugins/sphinx/sphinx_documents | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/sphinx/sphinx_documents b/plugins/sphinx/sphinx_documents index 6f0866cd..0e291c9d 100755 --- a/plugins/sphinx/sphinx_documents +++ b/plugins/sphinx/sphinx_documents @@ -5,7 +5,7 @@ # Output number of documents per Sphinx Index # Need indextool (since version 0.9.9 ) -# Index path (where sphx files are) +# Index path (where .sphx files are) idxpath=/var/lib/sphinxsearch/data/ # @@ -14,8 +14,8 @@ idxpath=/var/lib/sphinxsearch/data/ case $1 in config) cat <<'EOM' -graph_title Documents par index -graph_vlabel nombre +graph_title Documents per index +graph_vlabel number graph_scale no graph_category sphinx graph_info Report number of documents (using indextool) by Sphinx Index.