You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Matthew Runo <mr...@zappos.com> on 2009/12/02 21:35:23 UTC

Solr Admin XPath

Hello folks!

I'm attempting (!) to pull some data from the stats.jsp page using XPath so that it can be reported in a different application. I cannot seem to get the average QPS for the dismax handler, no matter how I try:

        try {
            XPathExpression reqPerSec = xpath.compile("/solr/solr-info/QUERYHANDLER/entry[name = 'dismax']/stats/stat[@name = 'avgRequestsPerSecond']");

            this.setDismaxRequestsPerSecond((String) reqPerSec.evaluate(doc, XPathConstants.STRING));
        } catch (XPathExpressionException e) {
            LOG.error("Failed to parse solr stats output", e);
        }

This doesn't throw any errors, and the XPath works just fine in /any/ XPath tester I try... except Java. 

Any tips? I have a feeling this is something obvious that I'm missing =\

Thanks for your time!

Matthew Runo
Software Engineer, Zappos.com
mruno@zappos.com - 702-943-7833


Re: Solr Admin XPath

Posted by Chris Hostetter <ho...@fucit.org>.
Wild shots in the dark:

 * remove the white psace arround the "=" characters
 * replace the single-quote characters with double quote characters

:             XPathExpression reqPerSec = xpath.compile("/solr/solr-info/QUERYHANDLER/entry[name = 'dismax']/stats/stat[@name = 'avgRequestsPerSecond']");
	...
: This doesn't throw any errors, and the XPath works just fine in /any/ XPath tester I try... except Java. 


-Hoss