From 05215bc2dc9f0674eb729b6400a8627c0f1549b1 Mon Sep 17 00:00:00 2001 From: Nicolas Moussikian Date: Sun, 6 Feb 2011 11:44:16 +0100 Subject: [PATCH] Initial version --- plugins/other/solr-stats | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 plugins/other/solr-stats diff --git a/plugins/other/solr-stats b/plugins/other/solr-stats new file mode 100755 index 00000000..9c3d84a6 --- /dev/null +++ b/plugins/other/solr-stats @@ -0,0 +1,59 @@ +#!/usr/bin/php +load($file); + + $xpath = new DOMXpath($doc); + + $elements = $xpath->query('/solr/solr-info/' . $category . '/entry'); + + foreach($elements as $element) + { + if($item == trim($element->getElementsByTagName('name')->item(0)->textContent)) + { + $stats = $element->getElementsByTagName('stat'); + + foreach($stats as $stat) + { + if($property == trim($stat->getAttribute('name'))) + { + echo $core . $item . $property . 'solr.value ' . floatval(trim($stat->textContent)) . "\n"; + } + } + } + } +} +